API : Commander la box domotique Fibaro Home Center par des requêtes HTTP 

 

Vous trouverez ici les principales commandes de l' "API" permettant de contrôler le Home Center 3 et Home Center Lite et via des requêtes HTTP.
Cela peut permettre par exemple de développer sa propre interface Web ou application pour smartphone, ou bien aussi de faire dialoguer le Home Center 2 avec d'autres équipements capables de générer des requêtes HTTP. 

Il est très important de bien respecter les minuscules et majuscules.

 

Signification des variables :

  • <LOGIN> = L'utilisateur autorisé à effectuer l'action (ex: admin)
  • <PASS> = Votre mot de passe 
  • <IP> = L'adresse IP de votre Home Center, il est donc nécessaire de lui attribuer une IP fixe (via la rédervation de bail de votre box / routeur Internet)
  • <ID> = identifiant du module Z-Wave (comment trouver l'ID d'un module ?)
  • name = action (ex: turnOff, turnOn, setValue)
  • <Value> = valeur (ex: niveau de variation à 39 % --> arg1=39 )  

Exemples :

http://<LOGIN>:<PASS>@<IP>/api/callAction?deviceID=<ID>&name=setValue&arg1=<VALUE> 

... devient :

http://admin:mot_de_passe@192.168.1.5/api/callAction?deviceID=4&name=turnOff 
http://admin:mot_de_passe@192.168.1.5/api/callAction?deviceID=7&name=setValue&arg1=39 

 

Liste des API  

  • Variateurs
http://<LOGIN>:<PASS>@<IP>/api/callAction?deviceID=<ID>&name=setValue&arg1=<VALUE>

  

http://<LOGIN>:<PASS>@<IP>/api/callAction?deviceID=<ID>&name=turnOn

http://<LOGIN>:<PASS>@<IP>/api/callAction?deviceID=<ID>&name=turnOff

 

http://<LOGIN>:<PASS>@<IP>/api/callAction?deviceID=<ID>&name=setValue&arg1=<VALUE>

http://<LOGIN>:<PASS>@<IP>/api/callAction?deviceID=<ID>&name=setAjar

http://<LOGIN>:<PASS>@<IP>/api/callAction?deviceID=<ID>&name=stop

 

http://<LOGIN>:<PASS>@<IP>/api/callAction?deviceID=<ID>&name=turnOff

http://<LOGIN>:<PASS>@<IP>/api/callAction?deviceID=<ID>&name=turnOn

 

http://<LOGIN>:<PASS>@<IP>/api/callAction?deviceID=<ID>&name=setColor&arg1=<VALUE>&arg2=<VALUE>&arg3=<VALUE>&arg4=<VALUE>

 

http://<LOGIN>:<PASS>@<IP>/api/callAction?deviceID=<ID>&name=startProgram&arg1=<PROGRAM ID>

 

  • Modules virtuels
ID = device ID 
arg1 = button ID 
arg2 = slider value (only for slider) 

http://<LOGIN>:<PASS>@<IP>/api/callAction?deviceID=<ID>&name=pressButton&arg1=<BUTTON ID>

http://<LOGIN>:<PASS>@<IP>/api/callAction?deviceID=<ID>&name=setSlider&arg1=<SLIDER ID>&arg2=<VALUE>

  

  • Scenes
ID = SceneID 

http://<LOGIN>:<PASS>@<IP>/api/sceneControl?id=<SCENE ID>&action=start

http://<LOGIN>:<PASS>@<IP>/api/sceneControl?id=<SCENE ID>&action=stop

 

http://<LOGIN>:<PASS>@<IP>/api/callAction?deviceID=<ID>&name=setTargetLevel&arg1=<TEMP VALUE>

http://<LOGIN>:<PASS>@<IP>/api/callAction?deviceID=<ID>&name=setTime&arg1=<TIME VALUE>

  • Notifications 
ID = Device (Iphone, e-mail et cetera) 
arg1 = Notification template 
http://<LOGIN>:<PASS>@<IP>/api/callActiondeviceID=9&name=sendDefinedPushNotification&arg1=1 

  

  • Panneau "Energie"
http://<LOGIN>:<PASS>@<IP>/api/energy/now-3600/now/single/devices/power/58

  • Récupérations d'états et de valeurs par requettes JSON : 
http://<LOGIN>:<PASS>@<IP>/api/rooms 
http://<LOGIN>:<PASS>@<IP>/api/scenes 
http://<LOGIN>:<PASS>@<IP>/api/devices 
http://<LOGIN>:<PASS>@<IP>/api/devices?id=316 # Specific value of a device 
http://<LOGIN>:<PASS>@<IP>/api/virtualDevices 
http://<LOGIN>:<PASS>@<IP>/api/globalVariables 
http://<LOGIN>:<PASS>@<IP>/api/weather 
http://<LOGIN>:<PASS>@<IP>/api/sections 
http://<LOGIN>:<PASS>@<IP>/api/users 
http://<LOGIN>:<PASS>@<IP>/api/energy/now-3600/now/single/devices/power/58 

etc. 



  • Modification / création de variables 
curl -X PUT -d '{"name": "Test", "value": "122"}' http://admin:admin@192.16...globalVariables

curl -X POST -d 'name=newvariable&value=0' .....

curl -X PUT -d '{"name":"newvariable", "value":"0", "isEnum":true, "enumValues":["0", "1"]}' .....

  

Plus d'informations sur cette API :
http://forum.fibaro.com/viewtopic.php?t=1252&postdays=0&postorder=asc&start=30  

 

Trouver l'ID d'un module Z-Wave :

Menu paramètres d'un module Z-Wave sur le HC2 Fibaro
Avec un module thermostat Secure SRT321 / Horstmann HRT4-ZW


Mis à jour le : 27/06/2021 à 15:20 Auteur : Jérôme Massiaux, technicien domotique-store.fr



Les nouvelles questions sont affichées en même temps que la réponse du technicien. Nous répondons généralement en moins d'une journée ouvrée, néanmoins, certaines questions peuvent nécessiter des tests ou recherches complémentaires et augmenter ce délai. Nous nous réservons le droit de ne pas publier ni répondre aux questions de service après-vente concernant un produit n'ayant pas été acheté sur notre boutique.