Create a switch in configuration.yaml

I’m beginner in YAML.
Trying to create a switch, I wrote this in configuration.yaml

switch:
  - platform: command_line
    switches:
      test_switch:
        command_on: "/bin/echo on"
        command_off: "/bin/echo off"
        command_state: "/bin/echo on"
        value_template: "{{ value == 'on' }}"

But in Developer Tools > States no test_switch is seen.

That’s the old configuration style, I’m guessing you pulled that from a community post or AI?

Check out the documentation and use that as a guide.

1 Like

Thank you so much for pointing in the right direction!
Can’t believe I spent so many hours trying to make this work.

1 Like