Hi everyone,
I just started on Home Assistant a few weeks back, so I’m quite new to this.
I am trying to use Restful command to send a notification within an Automation (when a sensor is triggered), but I can’t seem to get it right.
I came across a couple of posts there were quite helpful (including this and this) and they gave me some confidence that Rest or Restful command is the right approach. But I seem to be missing something because I am still not doing my get request right and sending stuff to the right place. I get specific errors in the logs when I got the templating stuff wrong. But other times I just get a status code 500 error or nothing.
Does anyone have any suggestions or tips for debugging this or maybe I am just missing something?
This is what I have in my configuration.yaml file:
automation: !include automations.yaml
script: !include scripts.yaml
logger:
default: debug
logs:
rest_command.example_request: debug
rest_command:
example_request:
url: 'https://example.com/events/?api_key=abcde'
method: get
payload: '&deviceid=somedeviceid&value="{{value}}"&type="{{type}}"&date="{{date}}"'
and my automation.yaml with the action where I call the rest_command:
action:
- service: rest_command.example_request
data:
value: "value"
type: "type"
date: "{{utcnow()}}"
Again, any help or suggestions will be much appreciated!