cykok
(CY)
March 8, 2018, 10:14am
1
Hi, i am new here. Need some advise.
I have a remote RPI just use GPIO to control some lights and autogate. From local RPI, I have successfully turn on/off my switches with curl example from https://home-assistant.io/developers/rest_api/
$ curl -X POST -H “x-ha-access: my_PASSWORD”
-H “Content-Type: application/json”
-d ‘{“entity_id”: “switch.christmas_lights”}’
http://remoteIP:8123/api/services/switch/turn_on
I wish to do the same with above command for cover type like autogate or garage door. Can this be done ? and what will be the services call i should use ? Sample below;
$ curl -X POST -H “x-ha-access: my_PASSWORD”
-H “Content-Type: application/json”
-d ‘{“entity_id”: “cover.autogate”}’
http://remoteIP:8123/api/services/cover/XXXX
Thanks for any feedback.
cheers, CY
m0wlheld
(Christoph Dahlen)
March 8, 2018, 10:46am
2
The cover service supports close_cover and open_cover (among other service calls), so you should call http://remoteIP:8123/api/services/cover/close_cover or http://remoteIP:8123/api/services/cover/open_cover respectively with the entity_id of your cover component.
1 Like
cykok
(CY)
March 8, 2018, 12:12pm
3
Hi m0wlheld,
It works, Thank you so much.
Cheers.
CY
it works.
curl -X POST -H "Content-Type: application/json" http://localhost:5000/api/services/cover/close_cover -d '{"entity_id": "cover.cover_kitchen"}'
however, where in the official API docs is this URL specified (/api/services/cover/close_cover)?
It’s not in these two pages, and I didn’t find it anywhere else in the official API doc.
Troon
(Troon)
June 10, 2024, 2:18pm
5
In your first link, any valid service can be called thus:
That close_cover
service is listed in the cover documentation: