Camera Pan, Tilt, Zoom (PTZ) - Help with Foscam example

Hi,

I’m trying to create some controls for controlling the PTZ on an old foscam camera I have. So far I have created the following which does not seem to be being accepted/appearing as an entitie, yet I can seem to see any errors. (Not sure what I’m missing)

APIs - http://www.ipcamcontrol.net/files/Foscam%20IPCamera%20CGI%20User%20Guide-V1.0.4.pdf

Can anyone share any ideas or many have a working PTZ camera control code they can share?

  - platform: command_line
switches:
  move_up:   
    command_on: 'curl -k "https://192.168.102.38:443/cgi-bin/CGIProxy.fcgi?cmd=ptzMoveUp&usr=Username&pwd=Password"'
    command_off: 'curl -k "https://192.168.102.38:443/cgi-bin/CGIProxy.fcgi?cmd=ptzMoveUp&usr=Username&pwd=Password"'
    friendly_name: Move Up
switches:
  move_down:   
    command_on: 'curl -k "https://192.168.102.38:443/cgi-bin/CGIProxy.fcgi?cmd=ptzMoveDown&usr=Username&pwd=Password"'
    command_off: 'curl -k "https://192.168.102.38:443/cgi-bin/CGIProxy.fcgi?cmd=ptzMoveDown&usr=Username&pwd=Password"'
    friendly_name: Move Down

try to format your code like this:

- platform: command_line
  switches:
    move_up:   
      command_on: 'curl -k "https://192.168.102.38:443/cgi-bin/CGIProxy.fcgi?cmd=ptzMoveUp&usr=Username&pwd=Password"'
      command_off: 'curl -k "https://192.168.102.38:443/cgi-bin/CGIProxy.fcgi?cmd=ptzMoveUp&usr=Username&pwd=Password"'
      friendly_name: Move Up
    move_down:   
      command_on: 'curl -k "https://192.168.102.38:443/cgi-bin/CGIProxy.fcgi?cmd=ptzMoveDown&usr=Username&pwd=Password"'
      command_off: 'curl -k "https://192.168.102.38:443/cgi-bin/CGIProxy.fcgi?cmd=ptzMoveDown&usr=Username&pwd=Password"'
      friendly_name: Move Down

Hi,

I did as suggested but only Move Up appears as an entity ? Any ideas ? Thanks

Not really.

If one of them works then the other one should work also as long as you have the syntax correct.

Try posting your code as you have it right now in your config so we can check for errors.

Hi

Here’s what I have so far…

- platform: command_line
    switches:
      move_up:   
        command_on: 'curl -k "https://192.168.102.38:443/cgi-bin/CGIProxy.fcgi?cmd=ptzMoveUp&Username&pwd=Password"'
        command_off: 'curl -k "https://192.168.102.38:443/cgi-bin/CGIProxy.fcgi?cmd=ptzMoveUp&Username&pwd=Password"'
        friendly_name: Move Up
      move_down:   
        command_on: 'curl -k "https://192.168.102.38:443/cgi-bin/CGIProxy.fcgi?cmd=ptzMoveDown&Username&pwd=Password"'
        command_off: 'curl -k "https://192.168.102.38:443/cgi-bin/CGIProxy.fcgi?cmd=ptzMoveDown&Username&pwd=Password"'
        friendly_name: Move Down

are there any errors in the log?

everything looks ok with the code from what i can see.

Nothing , and that’s the strange thing, I can see the Move Down entity but not the new Move Up one? So somehow it’s missing the first one ?

are you able to get it to move at all typing these into the browser? I couldn’t… I have to Foscam R2C PTZ Camera

I was able to figure out why my R2C didn’t work in hassio. It’s trying to use TLS 1.3 and the curl is failing. Using the flag --tls-max 1.2 resolved my problems.