Is there an easy way to send/post/push information to Home Assistant? I currently have a script running on my server that pings the phones of everyone in the house, and if there is a change in their status it will run a command.
At first I thought it would be a simple matter to use a curl command to change the state of a virtual switch, or update the value of a “sensor” in HA, but I haven’t been able to find a way to do that. Everything I have read on RESTfull switches and sensors is all about how to get information from them. Is there anyway for as switch or sensor to POST to HA?
I’m stuck again. Using the REST api has my presence detection working, and I have it triggering automations. Now I can’t figure out how to get a shell command to run for the action.
What do I need to do to get the command to run. This is what I have for the shell_command in my configuration.yaml
[code]shell_command:
me_home: curl -X GET http://admin:[REDACTED]@192.168.254.5/rest/vars/set/2/1/1
me_away: curl -X GET http://admin:[REDACTED]@192.168.254.5/rest/vars/set/2/1/0
[/code]
And the automation:
[code]automation:
alias: ‘me Home’
trigger:
platform: state
entity_id: sensor.me
from: ‘Away’
to: ‘Home’
action:
service: shell_command.me_home
alias: ‘me Away’
trigger:
platform: state
entity_id: sensor.me
from: ‘Home’
to: ‘Away’
action:
service: shell_command.me_away
[/code]