I’m using a command line binary switch to control whether a camera is active with Motion.
it either sends pause or start.
I have managed to get an ack back using tail -f and grep to load the response line to a file
the example I’m trying to use is this one
command_line:
- binary_sensor:
command: '/bin/systemctl is-active [email protected]'
payload_on: "active"
payload_off: "inactive"
will this work
command_line:
- binary_sensor:
command: 'cat /home/odroid/test.txt | grep "/detection/" '
payload_on: "start"
payload_off: "pause"
I would also need someway of deleting the file contents after the sensor has read the payload or
would it be better to erase the contents of the file with the command on the command line binary switch
lounge_cam:
command_on: 'lwp-request http://localhost:7770/101/detection/start'
command_off: 'lwp-request http://localhost:7770/101/detection/pause'
sorta
command_on: ' < delete file contents> && 'lwp-request http://localhost:7770,,,ect'
some guidance would be really appreciated
thanks