#tshooting a browser mod popup card

1 messages · Page 1 of 1 (latest)

hybrid tiger
#

Morning, folks. Trying to figure out why this popup card is not working as intended (when I click, nothing happens), but I don't have any errors to follow. Anything obvious I've wanged up here? tap_action: action: perform-action target: {} data: dismissable: true autoclose: false timeout: 10000 title: These lights are on... content: type: custom:auto-entities card: type: entities filter: template: | {% for light in states.light %} {% if light.state == "on" %} {{ light.entity_id}}, {% endif %} {% endfor %} exclude: - entity_id: light.all_lights - entity_id: light.jp_pc_screen - entity_id: light.1st_floor_lights - entity_id: light.garage* - entity_id: light.front_porch_dimmer - entity_id: light.under_cabinet* card_mod: style: ha-dialog$: | div.mdc-dialog__container { --vertical-align-dialog: center !important; } .: | ha-dialog { --dialog-backdrop-filter: blur(0.8em); } perform_action: browser_mod.popup

#

hm, this actually works fine in chrome. just fails in librewolf

neat hearth
#

Worked for me in Firefox and Chrome but not Edge (on PC). (Still using card_mod 2.4.4; not running v.2.5.0 yet.)

hybrid tiger
#

doesn't work in android HA or chrome, either. oh well

neat hearth
#

Worked for me in HA on Android, but not Chrome or Firefox.
Something looked a bit off to me initially with the 'perform-action', but it didn't click until a little bit ago. The preferred method is fire-dom-event. This method worked for me in Firefox, Chrome, and Edge (on PC) and HA app, Chrome, and Firefox (on Android).
(This example uses a custom:button-card to contain the action but it should work pretty much anywhere else.)

#
type: custom:button-card
name: fire-dom-event
tap_action:
  action: fire-dom-event
  browser_mod:
    service: browser_mod.popup
    data:
      dismissable: true
      autoclose: false
      timeout: 10000
      title: These lights are on...
      content:
        type: custom:auto-entities
        card:
          type: entities
        filter:
          template: |
            {% for light in states.light %}
              {% if light.state == "on" %}
                {{ light.entity_id}},
              {% endif %}
            {% endfor %}
          exclude:
            - entity_id: light.all_lights
            - entity_id: light.jp_pc_screen
            - entity_id: light.1st_floor_lights
            - entity_id: light.garage*
            - entity_id: light.front_porch_dimmer
            - entity_id: light.under_cabinet*
      card_mod:
        style:
          ha-dialog$: |
            div.mdc-dialog__container {
              --vertical-align-dialog: center !important;
            }
          .: |
            ha-dialog {
              --dialog-backdrop-filter: blur(0.8em); 
            }
cloud hatch
#

Note the difference between a Server call and Browser call, a Browser call being with fire-dom-event method. I have actually updated the documentation (beta 2.5.1 doc but still relevant for prior versions) to highlight the differences. Using a Server call with no Browser ID will send popup action to all registered browsers, whereas a Browser call with no Browser ID will action popup on the local Browser. So what are likely experiencing, is when using a Server call you are not seieng the popup on a Browser which is not registered.

GitHub

🔹 A Home Assistant integration to turn your browser into a controllable entity and media player - thomasloven/hass-browser_mod

#

Specifically this new added tip

TIP: If you wish to display a popup on a Browser using browser_mod.popup as a result of a user pressing a button, you will want to use a Browser call using action: fire-dom-event. This may be counterintuitive for a new Home Assistant dashboard creator and may seem more complex than it needs to be. This is due to standard implementation of Home Assistant actions being server based, and only custom integrations like Browser Mod allowing for Browser based actions. See popups.md for more information and examples.

hybrid tiger
#

thanks! my problem and solution were in fact much much dumber. I turned off auto-register browsers at some point 😅

#

but while i was in there i moved to a browser call so this doesn't pop up everywhere ```
tap_action:
action: fire-dom-event
browser_mod:
service: browser_mod.popup
data:
dismissable: true
autoclose: false
timeout: 10000
title: These lights are on...