Ghost on my installation? Switch triggers itself on reboot

I have a strange problem with one of my switches - on every reboot of hassio (reboot of host, not restart of home assistant) one of switches is triggered causing undesired action (only one of switches listed below). It is command line switch that sends echo command to LAN relay (SR-201 board). Command causes relay on switch to close momentarily to trigger blinds up movement.
Now, I can’t imagine how this could work:

  • There is no automation that would trigger this switch on restart (so also should not trigger on reboot).
  • It requires to send very specific command, so it is not something accidental (e.g. switch initialization). - Relay uses normally open contacts, so even some power fluctuation on board itself should not cause this behavior.
  • switch is located quite far from hassio server (VM running on ESXi). and connected only over wired LAN, so no direct interaction possible.
  • there is no trial of using the switch in log… but I’m not sure if something can be traced directly for just sending command to relay board?

Here is the code for switches:

- platform: command_line
  scan_interval: 5
  switches:
    blinds_up:
      command_on: echo -n 11* | nc 192.168.52.150 6722
      command_off: echo -n 21 | nc 192.168.52.150 6722
      command_state: echo -n '00:0^' | nc 192.168.52.150 6722 | sed 's/^.......\(.\)/\1/'
      value_template: '{{ value[0:1] == "1" }}'
    
    blinds_down:
      command_on: echo -n 12* | nc 192.168.52.150 6722
      command_off: echo -n 22 | nc 192.168.52.150 6722
      command_state: echo -n '00:0^' | nc 192.168.52.150 6722 | sed 's/^.......\(.\)/\1/'
      value_template: '{{ value[1:2] == "1" }}'

    blinds_stop:
      command_on: echo -n 1X* | nc 192.168.52.150 6722
      command_off: echo -n 2X* | nc 192.168.52.150 6722
      command_state: echo -n '00:0^' | nc 192.168.52.150 6722 | sed 's/^.......\(.\)/\1/'
      value_template: '{{ value[1:2] == "1" }}'

Any idea how to troubleshoot this?

Could it be that it’s the last command before the restart that triggers?
Maybe try a

echo '' | nc 192.168.52.150 6722

before the restart.
Just a thought.