Picture glance card with gate button

I have a picture glance card with 2 gates buttons like below
image
and when I press the gate buttons I get another pop up with open close like so
image

I want the gate buttons to just toggle the gate on/off without the pop up, is that possible?

camera_image: camera.front
camera_view: live
entities:
  - cover.second_gate
  - cover.main_gate
  - switch.meross_front_spots
  - switch.meross_front_led_strips
  - switch.front_downlights
title: null
type: picture-glance

Cover services don’t work in picture glances. Only turn_on / turn_off services do. You’ll have to use a picture-elements card or make a template switch that moves your cover and place the template switch in your picture glance.

Great idea so I did just that and while the gate opens, it doesn’t seem to close (the cover.close is there) so not sure why, is the value_template wrong? I followed https://www.home-assistant.io/components/switch.template/

     main_gate:
        value_template: "{{ is_state('cover.main_gate', 'on') }}"
        turn_on:
          service: cover.open_cover
          data:
            entity_id: cover.main_gate
        turn_off:
          service: cover.close_cover
          data:
            entity_id: cover.main_gate
        icon_template: >-
          {% if is_state('cover.main_gate', 'open') %}
            mdi:garage-open
          {% else %}
            mdi:garage
          {% endif %}

Oh and as a switch it seems to join the lights on the right hand side
image

Can I move it back left somehow?

Your value_template has the wrong state I believe. Because of this, it always thinks the cover is closed so it will only open.

value_template: "{{ is_state('cover.main_gate', 'open') }}"

Unfortunately, no. The left side is reserved for ‘sensors’ (that can’t be switched), the right side is switch like things.

Yes that did the trick thanks, too bad about the positioning.
Any custom picture glance card perhaps?

You can do anything with a picture-element card. I don’t believe there is any custom picture glance cards at the moment.

Thank you. Making the cover a switch template and putting it in my picture-glance card what exactly what I wanted. Thanks.

I have the same issue, but my case is that I have a motorized camera that moves up, down, right and left through button entities. So when I put the buttons in this card it also answers with a pop up window for the button entity when I press them. Any clue on how to do that?

Already got a solution for this?