Can someone help me to figure out why sensor command line fails to run and other works.
I’m using my script (see here: https://hastebin.com/ededepihis.bash) to extract the status of each sensor for temps, setpoint, status etc.
no issue with the script I think
here is the log file where is greps all the data: https://hastebin.com/meqanekexa.css
temperature setpoint
2017-10-27 14:12:07 INFO (SyncWorker_14) [homeassistant.components.sensor.command_line] Running command: /opt/scripts/status/state.sh -s 5
2017-10-27 14:12:07 INFO (SyncWorker_8) [homeassistant.components.sensor.command_line] Running command: /opt/scripts/status/state.sh -s 7
temperature
2017-10-27 14:12:07 INFO (SyncWorker_13) [homeassistant.components.sensor.command_line] Running command: /opt/scripts/status/state.sh -t 6
2017-10-27 14:12:07 INFO (SyncWorker_4) [homeassistant.components.sensor.command_line] Running command: /opt/scripts/status/state.sh -t 0
running on raspberry pi3 (dietpi debian8) with with Virtual Env, file has the corrected permission
I get the temp/setpoint and relay states correct using the same script, it’s just the motion sensors not working correctly.
Although when motion is detected ON, the state is reported but not the OFF state and constant error message of commands failed all the time.
Running the command manually provides no error: ./state.sh -x -m 0:
DEBUG (6484 @2017-10-27 15:57:17): Debugging enabled
DEBUG (6484 @2017-10-27 15:57:17): Checking status of DigitalIn ID 0
DEBUG (6484 @2017-10-27 15:57:17): DigitalIn ID 0 has a raw status of OFF
DEBUG (6484 @2017-10-27 15:57:17): DigitalIn ID 0 has a parsed status of 0
0
succes
2017-10-27 15:54:46 INFO (SyncWorker_0) [homeassistant.components.sensor.command_line] Running command: /opt/scripts/status/state.sh -t 0
2017-10-27 15:54:46 INFO (SyncWorker_8) [homeassistant.components.sensor.command_line] Running command: /opt/scripts/status/state.sh -s 10
To sum up, while there is no activity, I receive constant error messages. Once state is changed to ‘ON’ then the sensor state gets updated, but ones there is no movement is stays “ON” and my log is full of “command failed” messages as shown above. Running the command manually show that the sensor state if “OFF”