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

I disabled a lot of lovelace templates, and now it is solved. I have to check it out. Iā€™m also thinking that custom mod cards, also use the browser_mod, like custom mod-card, etcā€¦

How does browser_mod work with Home Assistant Cast? I am able to cast to a Google Home Hub and I can see the browser on google home hub, but I do not get a new device created for the home hub. Can browser_mod work with google home hubs?

1 Like

Thanks, I did the same, and that solved the problem for me.

I cannot figure out why my popup is not working with the new fire-dom-event syntax. Iā€™ve verified that the js console shows the necessary versions of browser_mod and custom:button-card, and Iā€™ve cleared the cache. Help please!

type: 'custom:button-card'
icon: 'mdi:music'
name: Media Players
layout: icon_name
tap_action:
  action: fire-dom-event
  browser_mod:
    command: popup
    title: Sonos
    card:
      cards:
        - artwork: cover
          entity: media_player.dining_room
          hide:
            power: true
            source: false
          info: short
          speaker_group:
            entities:
              - entity_id: media_player.tv_room
                name: Living Room
              - entity_id: media_player.bedroom_2
                name: Office
              - entity_id: media_player.bedroom
                name: Master Bedroom
            expanded: false
            platform: sonos
            show_group_count: true
          type: 'custom:mini-media-player'
        - artwork: cover
          entity: media_player.tv_room
          hide:
            power: true
            source: false
          info: short
          speaker_group:
            entities:
              - entity_id: media_player.dining_room
                name: Dining Room
              - entity_id: media_player.bedroom_2
                name: Office
              - entity_id: media_player.bedroom
                name: Master Bedroom
            expanded: false
            platform: sonos
            show_group_count: true
          type: 'custom:mini-media-player'
        - artwork: cover
          entity: media_player.bedroom_2
          hide:
            power: true
            source: false
          info: short
          type: 'custom:mini-media-player'
        - type: 'custom:button-card'
          name: Pause after Next Track
          icon: 'mdi:music-off'
          color: var(--accent-color)
          color_type: card
          tap_action:
            action: call-service
            service: automation.turn_on
            service_data:
              entity_id: automation.stop_music_after_current_track
          layout: icon_name
      type: vertical-stack

You may need to add an entity to your button for this to work.

Thank you for the recommendations. Alas! It didnā€™t work for me. Iā€™m trying to sort out the problem by trying to get a more simple popup to work. This doesnā€™t work either:

type: button
icon: 'mdi:star'
entity: light.bedside_his
tap_action:
  action: fire-dom-event
  browser_mod:
    command: popup
    card:
      type: entities
      entities:
        - light.bedside_hers
        - light.bedside_his
1 Like

Sorry, I was wrong. The issue is not with the entity but some parameters, especially deviceID, was missing from your code.

This should work (even without an entity):

type: button
icon: 'mdi:star'
tap_action:
  action: fire-dom-event
  browser_mod:
    command: popup
    title: Bedside lights
    hide_header: false
    large: false
    deviceID:
      - this
      - dashboard    
    card:
      type: entities
      entities:
        - light.bedside_hers
        - light.bedside_his
1 Like

The same problem did you fix it?

Just upgraded, would someone please double check why the popup is not working as a script but fine as tap_action? The script popup setup used to work in version 1.2.3.

This tap_action works:
Lovelace.yaml


      - type: 'custom:paper-buttons-row'
        buttons:
        - icon: "mdi:shield-check-outline"
          tap_action:
            action: fire-dom-event
            browser_mod:
              command: popup
              title: Popup example
              card:
                type: entities
                entities:
                  - light.family
                  - light.kitchen_light
              deviceID:
                - this
            # action: call-service
            # service: script.security_control_menu

When the above uses call_service script.security_control_menu, nothing happened:
Script.yaml

security_control_menu:
  alias: security_control_menu
  sequence:
  - service: browser_mod.popup
    data:
      title: Popup example
      card:
        type: entities
        entities:
          - light.family
          - light.kitchen_light
      deviceID:
        - this

[Edit]: Found the reason, itā€™s not possible to resolve ā€˜thisā€™ in such (explained here).

Thank you so much! Based on the release notes I thought that we didnā€™t need deviceID but clearly I was wrong!

That code is working for a standard button card, but not the custom button card. Iā€™ll play around with it a bit more and if I donā€™t succeed Iā€™ll seek help in the custom button card thread. :slight_smile:

For the custom button card, you may need to add an entity.

You need to report this to the maintainer of the custom card.

Hmm. Alas! That does not work. Iā€™ll seek additional help in the custom button card thread given that this now works with a standard button card, thanks to you! Thank you!

What am I doing wrong?! The code below does not allow execute a popup when the image is clicked UNLESS I remove the deviceID parameter. However, when I do that the popup is executed across all three of my tablets in the house. I just want it to popup when clicked on the device that is in use. Help!!! TIA :slight_smile:

            tap_action:
              action: call-service
              service: browser_mod.popup
              service_data:
                auto_close: true
                card:
                  image: 'http://xxxxx.duckdns.org:8084/'
                  type: picture
                deviceID:
                  - this
                  - dashboard

First of all you should use the new way of calling:

          tap_action:
            action: fire-dom-event
            browser_mod:
              command: popup

Thanks for the replyā€¦I changed it to the following, but it still isnā€™t working?!

            tap_action:
              action: fire-dom-event
              browser_mod:
                command: popup
                deviceID:
                  - this
                  - dashboard
                service_data:
                  auto_close: true
                card:
                  image: 'http://xxxxxxxx.duckdns.org:8082/'
                  type: picture
            title: Driveway
            type: picture-glance

Try:
deviceID: this

But I removed it from all my actions and it works (window opens only on the device Iā€™m controling).

I really appreciate the help, but it still isnā€™t working?! Am I doing something wrong? I click on the image and nothing happens. No popup. Code below:

            tap_action:
              action: fire-dom-event
              browser_mod:
                command: popup
                deviceID: this
                service_data:
                  auto_close: true
                card:
                  image: 'http://xxxxxxx.duckdns.org:8082/'
                  type: picture
            title: Driveway
            type: picture-glance

Did you configure browser_mod in configuration.yaml?

can you try this?

as service data and deviceID are not required for tap_action

deviceID: this
service_data:
1 Like