All, I am trying to configure a command_line switch to stop and start the Homebridge service. Starting and stopping works, however I cannot get a status to work. I have used the command_state below on a command line and it will return a value of 1 or 0. However, I can never get that to show in the HA gui. Any thoughts?
Are you testing the command as your home assistant user in the virtual environment? Some commands will run for your general user but the Homeassistant user may not have the right permissions or other issues and the command cannot run when requested from the Homeassistant user or from the virtual environment (or both).
If your not sure provide the installer you used so I can give instructions.
I used the all in one installer. I have tried switching to that user but I can’t get anything to run with sudo since I don’t know that password. The switches did only start working when I added homeassistant (the user) to the sudo group though.
Since you got it to work do you have an idea why it does not work for me.
I have similar issues described here and just can’t find the reason why my command_states are not working.
Yep, I had to do the same thing in order for it to run. I’ve got it running successfully, only I keep getting errors if Homebridge service is not running (as you mentioned).
Any idea how to fix this and clean up our error logs?
In my environment a have a camera connected to pi running volumio (debian) that is served via motion service. My hassbian sits on another pi, and task was to control camera with switch with correct status monitoring. Switch itself was running fine, (ssh to volumio and start or stop motion service) but had a trouble with getting right status. Solution was to write sh script, which was returning status as numeric value and pointing switch status to that