I am new to using the Rest Sensors. I want to be able to send the state of certain devices in my home assistant instance to an external server. I created a rest Sensor and I am able to test that it sends messages sucessfully. But I cant figure out how to send a group of sensor states .
If I have light.familyroom ; light.bedroom; light.bathroom. How do I send the state of each of these devices in my rest API endpoints. I can static values with no problem but not sure how to send the states of these light sensor as example. The idea of creating this sensor is to only give limited data to this external server of only the defined entities.
sensor:
- platform: rest
name: HOME_STATUS
resource: api url
headers:
Authorization: !secret access_token
Content-Type: application/json
force_update: true
method: GET
value_template:
I get : {“message”:“Invalid JSON specified.”} when I use Restful Command.
I am sort of stuck in here. Note that my intention is that the external application calls home assistant for the data. If anyone has any ideas. But it sounds like restful commands is intended for home assisstant to initiate the communication to external API endpoints.
No my intention is that the external application calls Home assistant and home assistant hands the values to it. It still causes the Json issue fixing the quotes
Thank you tom you always very knowledgeable. The reason i was trying to do it though home assistant was to restrict the data pulls to a limited data set if that was possible. Not to expose the whole home assistant. Ill try the API