šŸ”¹ Browser_mod - turn your browser into a controllable device, and a media_player

Just got the 1.3.0 update. I have a popup configured for a button card using the ā€œbutton-cardā€ repo (https://github.com/custom-cards/button-card). It worked before the update, and no longer does. The normal button card still works fine with popups. Is there something I can tweak on my end to make it work?

If itā€™s helpful, hereā€™s a snippet of my code.

type: 'custom:button-card'
style: |
  ha-card {
    height: 120px;
  }
color_type: card
label: |
...

tap_action:
  action: fire-dom-event
  browser_mod:
    command: call-service
    service: browser_mod.popup
    service_data:
      title: Alarm System

Hey Tony,

Even though Iā€™m pretty sure the code is wrong in your snippet, I canā€™t get it working either. According to the GitHub examples, it should be:

type: 'custom:button-card'
style: |
  ha-card {
    height: 120px;
  }
color_type: card
label: |
...

tap_action:
  action: fire-dom-event
  browser_mod:
    command: popup
    title: Alarm System

Unfortunately no luck on my side :smiley:

Ah, yeah youā€™re right. Thanks! I guess thatā€™s what I get for trying to get what I needed to out of the diff.

@M1ke @atonyshepherd
It actually seems like the old way with calling the browser_mod.popup-service still works, but if you include

deviceID:
  - this

it does not work anymore. This unfortunately means that the popup will appear on all devices.
I could not get the fire-dom-event for popup to work at all.

1.3.0 is a BREAKING release
Please read the release notes

1 Like

hey @thomasloven

i see indeed this new update in Hacs, but unable to update, when i click the update button, i see this error message:

2021-02-10 10:19:24 ERROR (MainThread) [custom_components.hacs] No content to download

edit : if i go to the intrgration list , then to browser_mod, the place where you can downgrade/upgrade versions, ā€¦ then its possible to update
seems the error only comes when updating from the community overview page

1 Like

Hi, before updating: does this also work with other cards that use action: call-service?

I see that the action has been changed to action: fire-dom-event. But for instance, I donā€™t see custom:button-card using that action.

Hi @RomRider, sorry for tagging out of the blue. But I think itā€™s good for all users to know this since your card and browser mod are two of the most used components of users.

Can you verify that the new action introduced by browser mod actually works with button card?

all my popup windows have stopped working after update, I have tried it with the new configuration of version 1.3.0, I was forced to go back to the previous version.
all my popups are called from custom button, could that be the cause?
someone else with this problem?
regards

None of the custom cards will work with that, wondering where that new format comes from. Any information that you can point to so that we can update the code of custom-cards? Has there been any formal announcement on the core side?

Itā€™s been in the core code for almost a year in preparation for future features.
But so far it has never been used.
Thatā€™s why itā€™s also undocumented.

I didnā€™t even think of custom cards when changing this. Sorry.
But as of now I see no other way to have this functionality without potentially breaking future Home Assistant versions or risk introducing security issues.

Thanks for the link, Iā€™ll look into that for my cards (cc @pollinolas) . But good luck to all the other devs with that change :slight_smile:

Suggestion @thomasloven, to add to the release notes that custom-cards will require to be updated for this to be supported.

6 Likes

I should have been more clear too.
You should only use action: fire-dom-event if you want the action to happen only on the current device.

If you want it on all devices, or a certain device with a given deviceID, you should use action: call-service as usual.

1 Like

If I understand the changes correct. I have to wait till all custom cards will use the fire-dom-event if I want to use the popup within a custom card?

The popup_card method should still work.
https://github.com/thomasloven/hass-browser_mod#replacing-more-info-dialogs

sorry. yes this is still working.
but if I use the service browser_mode.popup, then I have to wait or?

If you previously used

deviceID: this

or

deviceID:
  - this

Then yes.

thanks.
a different question.
would it be possible to adjust the header of the popup to the standard header of the more-info dialog?

header more-info
image

header popup
image

Hi @thomasloven,

i use scripts for complex popups to keep the yaml in lovelace small and I can also use variables to use a popup multiple times with different entities:


service: browser_mod.popup
data_template:
  deviceID: '{{ deviceID }}'
  title: Light
  hide_header: true
  large: false
  card:
    type: 'custom:layout-card'
    layout: auto
    cards:
      - type: 'custom:light-entity-card'
        header: Light
        entity: '{{ entityID }}'
...

Now that - DeviceID: this - no longer works, how can I use a script to only display the popup on the current device?

I would be very grateful for every tip, because currently not a single popup works anymore.

Thank you :slight_smile:
Chris

So for now, there is no way of using only the current device with popup?

This seems to work with the default cards:

type: button
icon: 'mdi:lightbulb'
show_icon: true
show_name: false
tap_action:
  action: fire-dom-event
  browser_mod:
    command: call-service
    service: script.popup_rgb
    service_data:
      deviceID:
        - this

And in the script:

service: browser_mod.popup
data_template:
  deviceID: '{{ deviceID }}'
  title: Light
  hide_header: true
  large: true

...
1 Like