Invalid switch is_on state

In my log file I keep getting invalid switch is_on state for a custom command line switch.

here is the error:

17-02-14 11:10:55 ERROR (MainThread) [homeassistant.components.switch.template] Received invalid switch is_on state: . Expected: on, off, true, false

and here is the configuration code.

switch 2:
  - platform: command_line
    switches:
      pc:
        command_off: 'net rpc shutdown -I 192.168.1.76 -U user%password'
        command_on: switch.wol

  - platform: wake_on_lan
    mac_address: "AA:00:00:AA:AA:00"
    name: "wol"
    host: "192.168.1.76"

  - platform: template
    switches:
      copy:
        value_template: '{{ states.switch.wol.state }}'
        turn_on:
          service: switch.turn_on
          entity_id: switch.wol
        turn_off:
          service: switch.turn_off
          entity_id: switch.pc

The actual switch functions flawless even provides correct state when in a group. I’m pretty new to this whole thing and a point in the right direction would be extremely helpful.

I was getting these errors as well while the switch was actually working. Didn’t find a way to fix it but I did find a way to mute it in the logs. Here is my logger config.

logger:
  default: error
  logs:
    homeassistant.components.switch.template: fatal
    homeassistant.components.switch.command_line: fatal
1 Like

Worked great to hide the errors thank you. let me know if you ever find another solution!

I have another error I would love to hide. Do you happen to have any idea how to hide something like this one

17-02-14 17:37:20 ERROR (Thread-12) [pywemo.ssdp] Error fetching description at http://192.168.1.1:8200/rootDesc.xml

All my wemo devices work without issues. No idea what that error is lol.

Do you have the discovery component loaded and also some Wemo devices on your network? Looks like that is the error. I commented out the discover component until I have a use for it

Oh yes I have the discovery commented out as well and I manually add all my devices now.

I have about 7 wemo devices ranging from light switches, wemo link, garden lights and outlet switches.

And they all work perfectly.

Not sure then. What is at the 192.168.1.1 address? Is that your gateway? I guess you could tell logger to only log fatal on wemo platform devices. I don’t have any to try this out though