#rest command in automations

1 messages · Page 1 of 1 (latest)

strong topaz
#

Following the instruction here
https://www.home-assistant.io/integrations/rest_command/#using-rest-command-response-in-automations

I edit in yaml on a automation
I set the rest_command in the action
I add the rest_commad at the end of the automation as indicated in the documentation but i get this error

Message malformed: extra keys not allowed @ data['rest_command']

description: ""
triggers:
  - type: turned_on
    device_id: 79248d6c0280a1f9a80315cfac032900
    entity_id: 70b6a6672fa2d27386d9082cf205a57b
    domain: switch
    trigger: device
conditions: []
actions: 
  - action: rest_command.request
mode: single
      
rest_command:
  request:
    url: http:// some api dot com
    method: GET```
flat herald
real sedge
#

The rest command does not go inside the automation. That needs to go into the configuration.yaml

flat herald
#

To be fair, The documentation example doesn't really make this clear. I think its based on creating a sperate file and including it in yaml configuration which hasn't been the standard for a long time.

strong topaz
#

So rest_command in configuration is the current standard