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

I am new with Browser Mod and try to add a Button to PopUp but doesn’t work

action: browser_mod.popup
data:
  browser_id:
    - be0f884a9453ba6bf097ad840b66ab2c
  right_button: Licht
  content:
    type: entities
    entities:
      - light.wiz_rgbw_tunable_4051da
  right_button_action:
    action: light.turn_on
    data:
      entity_id: light.wiz_rgbw_tunable_4051da

The PopUp appears but the button does work.
What i am doing wrong?

Edit: Replaced action: light.turn on with service: light.turn_on and it works. So the former service calls are not adapted to action calls in Browser Mod?

Sweet, thanks for the info.

Just to let you know, I gave up on browser-mod and ended up using bubble card pop-up. Works like a charm.

My browser mod is still not working on desktop after the update? When I inspect the page it still says the below.

Uncaught (in promise) TypeError: document.createElement(...).getRoutes is not a function

I checked the file and its using _getRoutes?
image

I have cleared cache, restarted etc. It works on my phone fine, but not browser?

Hello,

I have 2 questions concerning browser_mod:

  • Is it possible to fallback to a default page after x min without activity on a specific device?
  • Is it possible to use a separate dashboard for each device ?

Thanks in advance for your help !

Did you clear cache AND scripts? In windows - chrome/edge this is done by pressing F12 (open developer tools) then right-click on refresh icon and select ā€œEmpty cache and hard restartā€. Just pressing ctrl+F5 usually doesn’t help, since this only clears cache, but not js files etc.

So I rolled back my install from 2025.1.1 after having some issues with browser_mod and a couple other integrations. I see there is a new update for Browser Mod, I’m still on 2.3.1, however I’m not seeing it on my update list. Do I need to install HA Core 2025.1 for it to appear?? Any thoughts?

Yes to both.
TBH, for the first one I don’t have the solution at hand so you’ll have to do some searching on how to determine when a device has no activity for x time.

For the second one: you don’t even need browser_mod for this.
In your profile settings (bottom of the side bar) you can define the default dashboard for that device which is stored in your browser session.

Thanks for your answer.
There are indeed functions call available to know when device become inactive:
I followed this post which seems to be working: Switch back to default dashboard after some time - #4 by Ldc2335
I’ll probably end up to make another one to dim/wake the screen based on movement as well.

Thanks for the second point ! I totally forgot that this was available.

has anyone seen issues with browser_mod not reconnecting to HA after an HA reboot? currently need to manually go and refresh the browser for it to reconnect.

Hello,

I’m trying to use a popup that activates when pressing a button. On my PC/tablet, it works perfectly and displays in three columns. However, on my phone, I want it to display as one column per card because three columns result in awkwardly sized cards. How can I make the popup responsive so it automatically shows three columns on PCs/tablets and one column on phones?
this is the code so far

type: custom:mushroom-entity-card
entity: sensor.brew_door_sensor_battery
grid_options:
  columns: 3
  rows: 1
primary_info: none
secondary_info: none
tap_action:
  action: fire-dom-event
  browser_mod:
    service: browser_mod.popup
    data:
      large: true
      title: CCTV
      size: wide
      auto_close: true
      timeout: 20000
      content:
        type: grid
        cards:
          - entities:
              - binary_sensor.brew_door_sensor_opening
              - entity: sensor.brew_door_sensor_battery
                positions:
                  icon: "off"
                  name: "off"
                entity_row: true
                type: custom:bar-card
              - entity: binary_sensor.brew_door_sensor_battery_plus_low
                name: Status
              - entity: sensor.brew_door_sensor_battery_last_replaced
                name: Last Replaced
              - entity: sensor.brew_door_sensor_battery_type
                name: Type
            title: Chalet Door Sensor Battery
            grid_options:
              rows: auto
              columns: 9
            type: entities
          - entities:
              - binary_sensor.brew_door_sensor_opening
              - entity: sensor.brew_door_sensor_battery
                positions:
                  icon: "off"
                  name: "off"
                entity_row: true
                type: custom:bar-card
              - entity: binary_sensor.brew_door_sensor_battery_plus_low
                name: Status
              - entity: sensor.brew_door_sensor_battery_last_replaced
                name: Last Replaced
              - entity: sensor.brew_door_sensor_battery_type
                name: Type
            title: Chalet Door Sensor Battery
            type: entities
hold_action:
  action: none
double_tap_action:
  action: none
fill_container: true

and this is the result:

John, there is an update of BM that seems to fix your issue.

v2.3.3 - Attempt to avoid caching problems after updates

Simple question apparently not with an easy answer… how do I style the title text of a popup? Literally I just want to change the color, but digging through the shadow DOM and so forth defies me. This is the closest that I’ve gotten, though it only styles the button text:

          card_mod:
            style: |
              ha-dialog {
                --mdc-theme-primary: red;
                --ha-dialog-header-color: red;
              }

How can I register a TLC Google TV in browser_mod? My goal is to use the Dashboard Screen Saver app (Google Play) to show a a Home Assistant Dashboard as a screensaver without needing to login.

I am trying to get a browser_mod.more_info to work only on the browser where I clicked. it currently pops up on all browsers in the house. I found browser_id: this and deviceID: this but they don’t do anything. Can somebody help me get this working?

type: entity
show_state: true
show_icon: true
entity: sensor.woonkamer_temperatuur
name: Woonkamer
state_content:
  - name
  - state
tap_action:
  action: perform-action
  perform_action: browser_mod.more_info
  target: {}
  data:
    large: false
    ignore_popup_card: false
    entity: climate.woonkamer_thermostaat_2
    deviceID: this
hold_action:
  action: more-info

Solved it myself :stuck_out_tongue_winking_eye:

type: heading
icon: mdi:sofa
heading_style: subtitle
heading: Begane grond
badges:
  - type: entity
    show_state: true
    show_icon: true
    entity: sensor.woonkamer_temperatuur
    name: Woonkamer
    state_content:
      - name
      - state
    tap_action:
      action: more-info
      entity: climate.woonkamer_thermostaat_2
      data:
        browser_id: this

I am running the latest 2.3.3 but no sensors are working.
Battery. charging etc.
It will only update battery sensors when the browser is started, but then failes to update over time…
The screen on/off and screen sensor seems to always work.
Am I missing something?

I wanted to share a quick CSS addition for browser_mod that I just implemented, which considerably improves the visual attractiveness of blacking out a browser screen.

  1. Create a .css file (I named it browser_mod_extra_css.css) and place this in it:
body > .browser-mod-blackout {
	transition: background .2s ease-in-out;
}
body > .browser-mod-blackout[dark] {
	transition: background 2s ease-in-out;
}
  1. Save it, and store it in your home assistant /www folder.
  2. Then add it as an extra Stylesheet resource (/local/browser_mod_extra_css.css).
  3. Refresh your browser mod device, and try turning off its screen.

Now, the black fades in smoothly instead of a ā€˜hard cut to black’, and when you ā€˜wake’ again, it fades out faster (.2s, or 200ms). You can change the durations to whatever you like! (and ofcourse, you can try setting other easing methods)

I tried playing TTS audio to the browser via the browser mod created media player, but there’s no output. When I use the ā€œBrowse Mediaā€ button on the media player popup and select a radio station for example it works, but if I try to play TTS (either via action or via the Browse Media popup) it just stays silent. I can play TTS on my google home speakers, it’s just the browser media player thats not working. Also no errors in HA logs or in the browser dev console. Am I missing something?

1 Like

I’m having some problems :slight_smile:
I have made a picture elements card, and some elements have an icon.
When i press the icon, i want it to toggle a script.
Turning the script on, should show a browser mod popup containing some info (for now a button)

However, i want it to popup where it was launched from… meaning one time from a tablet, the other time from al laptop.
So i think i need the device_id: THIS ?

I tried, but its not doing anything.
Heres my code:

sequence:
  - data:
      browser_id: THIS
      size: normal
      content:
        type: custom:button-card
        show-state: false
        show-name: false
        custom_fields: null
        icon: mdi:sofa
        show_icon: true
        name: Living
      card_mod:
        style:
          ha-dialog$: |
            div.mdc-dialog div.mdc-dialog__scrim {
              background: rgba(28, 28, 28, 0.9);
              secondary-background-color: rgba(0,0,0,0.5);
              ha-card-background: rgba(0,0,0,0.5);
            }  
    action: browser_mod.popup

Whats wrong?