Day 22 of #100DaysOfHomelab

June 10, 2023

Day 22 of #100DaysOfHomelab was about fixing some more deprecated configurations with the latest version of Home Assistant. In the latest version they changed how command line switches are configured, so it required a few tweaks to get working again. I use a command line switch in a few places like to manage the on/off state of my CCTV monitor screen. When my office lights turn off, so does the monitor screen.

So my previous config of:

switch:
    - platform: command_line
      switches:
        cctv_monitor_screen:
          command_on: "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i /config/.ssh/id_ed25519 pi@10.112.0.110 -T 'sudo systemctl start camplayer'"
          command_off: "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i /config/.ssh/id_ed25519 pi@10.112.0.110 -T 'sudo systemctl stop camplayer'"
          command_state: "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i /config/.ssh/id_ed25519 pi@10.112.0.110 -T 'sudo systemctl is-active camplayer'"
          name: CCTV Monitor Screen

Became:

command_line:
  - switch:
      command_on: "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i /config/.ssh/id_ed25519 pi@10.112.0.110 -T 'sudo systemctl start camplayer'"
      command_off: "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i /config/.ssh/id_ed25519 pi@10.112.0.110 -T 'sudo systemctl stop camplayer'"
      command_state: "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i /config/.ssh/id_ed25519 pi@10.112.0.110 -T 'sudo systemctl is-active camplayer'"
      name: CCTV Monitor Screen

Monitor your DNS Zones with ZoneWatcher

Be alerted of DNS record changes moments after they happen, not from upset customers.

ZoneWatcher screenshot