Picture card with links for PTZ Cam presets?

I tried a picture-glance and adding urls for my cams presets via the weblink component, but this opens a popup with the link in it. Not what I’m looking for.
I would really like to be able to change the icons to something that makes sense for my locale and simply have touching the icon send the url to move my cam to the PTZ preset.

Any thoughts on how to do this?

Create command line scripts for your P T anz Z controls. Give them appropriate icons in the customization section. Put the scripts in the picture glance card and set the icon tap action to " call-service" for each icon.

1 Like

Thanks for the reply!
I have tried to do this and am not having the desired result.
I am not very experienced with scripts and can’t figure how to make one call a url like I’m trying to do. So I got a rest_command that will successfully send the url and change the PTZ preset.
My issue is that it seems to keep doing this as all ways I have tried in the picture glance card use ON/OFF like it is a switch. So I can’t move it anywhere else as it keeps sending the command.
The other issue is that it still pops up another card which makes it worse than the weblink method I already had.

Any thoughts on how to add an entity that will just fire the url once and not look back so I don’t have an ON/OFF thing going on?

Okay after much trial and error I finally figured out a way to do this.

Thanks to tom for pushing me in the right direction.

So what I ended up doing is sticking with the picture-glance card, making shell commands to curl my URL then calling this from a switch.

shell_command:
ptz_firepit: 'curl  "YOUR_URL_HERE"' 

The on/off issue was solved by using the following that was posted by thomasloven:

switch:
  - platform: template
    switches:
    ptzfirepit:
    value_template: "{{ True }}"
    turn_on:
    turn_off:
      - service: shell_command.ptz_firepit

so it shows as “ON” but that doesn’t really matter much for my household.
In lovelace I did this config of the picture-glance so it just shows icons for each position:

    camera_image: camera.backyard
    entities:
      - entity: switch.ptzfirepit
        icon: 'mdi:fire'

Hope this helps someone else.

1 Like

I created a PTZ automation:
front door, opens, zoom in on front door. returns to home position after door closed for 10 seconds.

configuration.yaml

shell_command:
  ptz_front_door: 'curl  "http://192.168.1.XX:81/admin?camera=Cam1&trigger&preset=3&user=BIUSER&pw=BIPASS"'
  ptz_living_room_home: 'curl  "http://192.168.1.XX:81/admin?camera=Cam1&preset=1&user=BIUSER&pw=BIPASS"'

automation :

alias: PTZ Front Door Opened
description: 'front door, opens, zoom in on front door. returns to home position after door closed for 10 seconds.'
trigger:
  - type: opened
    platform: device
    device_id: 1abf48bef78976c98e45df54bbca0ae0
    entity_id: binary_sensor.front_door_contact
    domain: binary_sensor
condition: []
action:
  - service: shell_command.ptz_front_door
    data: {}
  - wait_for_trigger:
      - type: not_opened
        platform: device
        device_id: 1abf48bef78976c98e45df54bbca0ae0
        entity_id: binary_sensor.front_door_contact
        domain: binary_sensor
        for:
          hours: 0
          minutes: 0
          seconds: 10
  - service: shell_command.ptz_living_room_home
    data: {}
mode: restart