HTTP Command to check if camera is enabled/disabled?
  • Hi Ben,

    Is there a HTTP command that will return the enabled/disabled status of a camera please?

    I know I can modify this setting via camEnabledCheck, and I can check camera modes using ++cameramodes, but I've not been able to find the option to determine the status of this setting yet. (it's so I can create a sensor in Home Assistant to poll for the camera status)

  • There is a "systemInfo" HTTP request that returns an XML document containing comprehensive information about the system. This includes information about enabled cameras only, so if the camera is omitted in this document it means that it is disabled.

    If you load this in a web browser (i.e. http://address:8000/systemInfo), you will see what this contains. I'm not sure exactly how you are linking this up to the Home Assistant sensor, however I hope this will do what you want.
  • Thanks Ben!

    Just to give some background which may help others wanting to do the same, I created a switch template in Home Assistant to monitor the status of Motion and Action schedules so that I could turn them on and off from HA (e.g. when I open the back door, the camera motion detection is disabled), and to update the switch if I manually change these settings in SecuritySpy.

    secrets.yaml file

    gardencam_ma_on: "/usr/bin/curl ''"
    gardencam_ma_off: "/usr/bin/curl ''"
    gardencam_ma_state: "output=$(/usr/bin/curl -s ''); if [[ $(echo \"$output\" | grep \"M:\" | awk -F: '{print $2}') == \"ARMED\" ]] && [[ $(echo \"$output\" | grep \"A:\" | awk -F: '{print $2}') == \"ARMED\" ]]; then exit 0; else exit 1; fi"

    package.yaml (I can't paste with the correct spacing on here, so if using this make sure it is indented correctly)

    - platform: command_line
    scan_interval: 300
    command_on: !secret gardencam_ma_on
    command_off: !secret gardencam_ma_off
    command_state: !secret gardencam_ma_state
    friendly_name: GardenCam Arm On Off

    I plan to work out a bash command that will look at the output of systemInfo and return an enabled/disabled status from that. I'll post back the command once I've figured it out.
  • Very nice - thanks for posting!
  • As promised, here is the Home Assistant switch template for enabling/disabling a camera:

    gardencam_disable: "/usr/bin/curl -d 'cameraNum=7&camEnabledCheck=0&action=save' ''"
    gardencam_enable: "/usr/bin/curl -d 'cameraNum=7&camEnabledCheck=1&action=save' ''"
    gardencam_state: "/usr/bin/curl -s '' | grep -i gardencam"


    - platform: command_line
    scan_interval: 300
    command_on: !secret gardencam_enable
    command_off: !secret gardencam_disable
    command_state: !secret gardencam_state
    friendly_name: GardenCam Enabled Status

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!