Pour envoyer une requête API a une eedomus avec Lua sur une fibaro HC2 il faut crée un scene (les HTTPS ne sont pas accepter dans les virtual device)
Pour envoyer par exemple:
https://api.eedomus.com/set?api_user=xxxxx&api_secret=xxxxexE&action=periph.value&periph_id=494468&value=1
1= alarm activer 0 = desactiver
Il faut ecrire dans la scene
local http = net.HTTPClient()
http:request(« https://api.eedomus.com/set?api_user=F2tgxxxx_secret=6RNN6o4DJu3xqexE&action=periph.value&periph_id=494468&value=1 », {
options = {
method = ‘PUT’,
headers = {},
timeout = 10000
},
success = function(response)
if response.status == 200 or response.status == 201 then
result = json.decode(response.data)
if result.body.error_msg then
fibaro:debug(‘Erreur: ‘..result.body.error_msg)
end
else
fibaro:debug(‘Commande a échoué’)
end
end,
error = function(err)
fibaro:debug(‘[ERREUR] ‘ .. err)
end
})
Lua est diferent dans les scene ou les VD et c est tres mal documente
J’ai beaucoup cherche
Articles récents
- Requête API a une eedomus avec Lua sur une fibaro HC2 20 février 2020
- Problème de démarrage temps froid de la Honda Dominator nx650 9 février 2020
- poil devil 9 février 2020
Hey very interesting blog!
Do you mind if I quote a few of your articles as long as I provide credit and sources back to your webpage?
My blog site is in the exact same niche as yours and my users would really benefit from some of the information you present here.
Please let me know if this okay with you. Thanks!
yes, no problem
If you want to use the photo it would also be good to check with the artist beforehand in case it is subject to copyright. Best wishes. Aaren Reggis Sela
This is my first time visit at here and i am actually impressed to
read everthing at one place.
Thanks for your marvelous posting! I actually
enjoyed reading it, you might be a great author. I will be sure to bookmark your
blog and definitely will come back at some point.
I want to encourage you to definitely continue your great job, have a nice morning!
Hey excellent blog! Does running a blog similar to this take a lot of work?
I have virtually no expertise in coding but I was hoping to start my own blog
in the near future. Anyway, should you have any recommendations or tips
for new blog owners please share. I know this is
off subject however I simply needed to ask. Thank you!
I am actually grateful to the holder of this web site who has
shared this fantastic paragraph at at this place.
Thanks for finally writing about > Requête API a
une eedomus avec Lua sur une fibaro HC2 – stevenin < Liked it!
It’s impressive that you are getting ideas from this post as well
as from our discussion made at this time.
I loved as much as you will receive carried out right here.
The sketch is attractive, your authored subject
matter stylish. nonetheless, you command get bought an shakiness over that you wish be delivering
the following. unwell unquestionably come further formerly again since
exactly the same nearly a lot often inside case you shield this increase.
Good information. Lucky me I ran across your blog by accident (stumbleupon).
I’ve book-marked it for later!