Command line switch took longer than the scheduled update interval *recently*

I have had a few command line switches working perfectly fine for about 2 years. I usually apply updates as soon as they become available (w/ backups), however I cannot pin point the exact update that caused this issue.

My switch looks like:

- platform: command_line
  scan_interval: 90
  switches:
    test_switch:
      command_on: "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa [email protected] 'some linux command'"
      command_off: "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa [email protected] 'some linux command'"
      command_state: "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa [email protected] 'some linux command'"

I confirmed that these commands work w/o password request and perform the desired actions when I execute them manually by dropping into docker comatainer that HA lives in by issuing the following command.

docker exec -it homeassistant /bin/bash

The ssh line executes and everything w/o issues. However, when HA attempts to do it I see the following in my logs

Updating command_line switch took longer than the scheduled update interval 0:01:30

Originally I had 30 for update interval as the commands only takes like 2 seconds to execute but increased to 90 but no success.

If I restart HA it seems like to switches update but then stop working right after and the above entries are in my logs.

Any ideas?

Did you ever resolve this? It just started happening to me.

I noticed the same warning shortly after upgrading to 2023.06, but the command only took a second to complete when I tried it from the shell.

I am also starting to get this:
Command failed (with return code 255): ssh dockerservice@(redacted)

When tested from the shell (ssh), return code is 0.

I am also seeing this on all of my command line switches which have been working fine for at least a year. They are still functioning, but report this message every time they execute the status call. Again, like the other posters, the commands when execute from the shell take a fraction of a second. Has anyone got to the bottom of this yet?

This has been fixed and will be released with .7 (Hopefully!) see: