https://developers.home-assistant.io/docs/api/rest
看文档呗,文档案例如下:
curl \
-H "Authorization: Bearer TOKEN" \
-H "Content-Type: application/json" \
-d '{"entity_id": "switch.christmas_lights"}' \
http://localhost:8123/api/services/switch/turn_on
你直接把/api/services/switch换成/api/services/light,然后再把entity_id改成你的。 |