Rest_command split from main config not working

I’ve got split files set up for several other entity types (binary sensor, sensor, automation, etc…), but I can’t get the rest_command one to play nice. With the config below, none of my rest commands are loaded - but if I leave them all in the main config it works fine. What am I doing wrong?

In configuration.yaml

...
rest_command: !include_dir_merge_list rest_commands/
...

the directory /config/rest_commands/ exists and contains 3 files. I commented two of them out to try to troubleshoot. But here’s the contents of tablet_control.yaml

  office_tablet_night:
    url: http://192.168.1.125:2971/api/command
    method: 'POST'
    content_type: "application/json"
    payload: '{"brightness":40}'
  office_tablet_day:
    url: http://192.168.1.125:2971/api/command
    method: 'POST'
    content_type: "application/json"
    payload: '{"brightness":150}'

I’ve tried with this format as well, and I get an error when running the config check.

- office_tablet_night:
    url: http://192.168.1.125:2971/api/command
    method: 'POST'
    content_type: "application/json"
    payload: '{"brightness":40}'
...

Any ideas?

The Correct format is:

office_tablet_night:
  url: http://192.168.1.125:2971/api/command
  method: 'POST'
  content_type: "application/json"
  payload: '{"brightness":40}'
office_tablet_day:
  url: http://192.168.1.125:2971/api/command
  method: 'POST'
  content_type: "application/json"
  payload: '{"brightness":150}

Note the command names start in column 0.

Also as this is a dictionary not a list (no dashes), you need to use merge_named:

rest_command: !include_dir_merge_named rest_commands/
1 Like

Holy crap. I knew it had to be something minor. Thank you!!!