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- “
Camera1 Detection status ACTIVE
So my switch looks like

        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
        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'
        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

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.

        command_on: curl -s
        command_off: curl -s
        command_state: 'wget -O- -q "" | grep on'

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

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