Hello,
I am struggling with the HTTP binary sensor. In the documentation it says, the binary sensor will be created upon the first REST API call. Doing so by cURL, however, always results in {“message”: “Entity not found”} for me. Here is my cURL line:
curl -X GET -H "x-ha-access: XXX" -H "Content-Type: applicaton/json" -d '{"state": "on", "attributes": {"friendly_name": "REST_SW"}}' http://192.168.1.100:8123/api/states/binary_sensor.REST_SW
In my config.yaml I have frontend
enabled. home-assistant version 0.69.1
What is it I am doing wrong? Other REST API calls are working fine.
–
PS: What I am trying to accomplish is to use the REST API to trigger an automation. Within the automation I am listening on any state change of the HTTP Binary Sensor.
- id: rest_api_sw_test
alias: rest_api_sw_test
trigger:
platform: state
entity_id: binary_sensor.REST_SW
action:
- service: light.toggle
entity_id: light.kitchen
Is this the proper way to do it?