Rest_command not found, but it's in config and I restarted

Hi there, I’m trying to send some data to my WLED panel and I’m following these instructions:

I had this working at one time, then I changed the name of the rest command in configuration.yaml and the automation, now I cannot get it working again, even when I change back to the initial name. I have restarted HA multiple times, but I still get an error “Error: Action rest_command.panel_set_temp not found”.

This is the snippit from my configuration.yaml

rest_command:
  panel_set_temp:
    url: http://172.16.16.237/json/state
    method: POST
    content-type: 'application/json'
    payload: '{"seg":  [{"id": 1,"n": "{{text}}"} ]}'

my automation is:

actions:
  - data:
      text: M {{states("sensor.outdoor_temperature") | round(0)}}F
    action: rest_command.panel_set_temp
mode: single

Any thoughts on how to get my rest_commands to be recognized by HA?
Thanks!

https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371#p-578066-oneone-format-it-properly-16

But your issue is likely that you did not quote your single line template:

See: https://www.home-assistant.io/docs/templating/yaml/#the-quoting-rule

Thanks so much for the reply! It turns out that the rest_command in my configuration.yaml did not like the content-type: section. I remove that, then restarted and now I can find the action and my automation works.

Thanks for the pointer on proper formatting, I fixed the initial post.

Your suggestion about putting quotes around the command did solve another issue I was having. Now I don’t need to have a text string starting the line. :slight_smile:
Thank you!

This is working.
Automation

actions:
  - data:
      text: '{{states("sensor.outdoor_temperature") | round(0)}}'
    action: rest_command.panel_set_temp
mode: single

configuration.yaml section

rest_command:
  panel_set_temp:
    url: http://172.16.16.237/json/state
    method: POST
    payload: '{"seg": [{"id": 1,"n": "{{text}}"}]}'