Advertisement
chrisdaloa

API HOME ASSISTANT

Nov 13th, 2018
371
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. //RESTITUISCE STATO API
  2. curl -X GET -H "x-ha-access: PASSWORD" -H "Content-type: application/json" https://NOME.duckdns.org:8123/api/
  3.  
  4. //ACCENDERE UNO SWITCH 1
  5.  
  6. curl -X POST -H "x-ha-access: PASSWORD" -H "Content-Type: application/json" -d '{"entity_id": "switch.DEVICEID"}' http://NOME.duckdns.org:8123/api/services/switch/turn_on
  7.  
  8. // ACCENDERE UNO SWITCH 2
  9. curl -X POST -H "x-ha-access: PASSWORD" -H "Content-Type: application/json" -d "{\"entity_id\": \"switch.DEVICEID\"}" "https://NOE.duckdns.org:8123/api/services/switch/toggle"
  10.  
  11.  
  12. // LEGGERE LO STATO DI UN DISPOSITIVO
  13. curl -X GET -H "x-ha-access: PASSWORD" -H "Content-type: application/json" https://NOME.duckdns.org:8123/api/states/DEVICE_ID -d {"state"}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement