MotionEye Command_line Switch

HI I am trying to create a command_line Switch to control motion eye detection.
Switch works fine without a status check but I also want to reflect it status.
From the ssh running commands I can use a command to get the status
from ssh command line

wget -O- “http://192.168.0.87:7999/2/detection/status
returns
Camera1 Detection status ACTIVE
So my switch looks like

lounge_detect:
        command_on: 'wget -O- "http://192.168.#.#:7999/2/detection/start" >/dev/null'
        command_off: 'wget -O- "http://192.168.#.#:7999/2/detection/pause" >/dev/null'
 #       command_state: 'wget -O- "http://192.168.#.#:7999/2/detection/status"'
  #      value_template: '{{ value == "ACTIVE" }}'

But switch just bounces back
So I guess my state and or value_template is wrong ??

Thanks still just learning so any help would be appreciated

Hello @Kelvin_Sudlow

I did it this way and it works just perfect:

  - platform: command_line
    switches:
      livingroomcam_motion_notify: 
        command_on: 'wget -q "http://motioneye-server:7999/1/detection/start"'
        command_off: 'wget -q "http://motioneye-server:7999/1/detection/pause"'
        command_state: 'wget -O- -q "motioneye-server:7999/1/detection/status" | grep ACTIVE'
      shedcam_motion_notify: 
        command_on: 'wget -q "http://motioneye-server:7999/2/detection/start"'
        command_off: 'wget -q "http://motioneye-server:7999/2/detection/pause"'
        command_state: 'wget -O- -q "http://motioneye-server:7999/2/detection/status" | grep ACTIVE'

Basically the command_state checks if the wget contains the word “ACTIVE”, in case it will return “true” which is a 0. And 0 means on. If not then it is off. Tested and this works well for me. Also using wget with -q makes the > /dev/null obsolete.

I would like to active the rec function if my alarm system is triggerd. And if the alarm is disarmed the rec should stop. Is it possible to do it with a switch?

Here you have an example of a scene you can also create a boolean automation

hi
trying this with a switch for command_state but not sure why the switch keeps bouncing back to on position. any ideas?
below is my config for the switch. I have curl for on and off because that what i have been using before i ran in to this post explaining the command_state.

dining_light:
        command_on: curl -s http://192.168.1.30:8688/controller/rest/devices/Zooz%20dimmer%20zen22/commands?name=zooz%20dimmer%20a%20on
        command_off: curl -s http://192.168.1.30:8688/controller/rest/devices/Zooz%20dimmer%20zen22/commands?name=zooz%20dimmer%20a%20off
        command_state: 'wget -O- -q "http://192.168.1.30:8688/controller/rest/devices/Zooz%20dimmer%20zen22/status?name=zooz%20dimmer%20a%20switch%20status" | grep on'

when i run in the command for status in a browser, it returns the following:

<sensors>
<sensor name="zooz dimmer a switch status">on</sensor>
</sensors>