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

I am creating a button-card in popup but the following command to display the brightness in the label is not displayed in browser_mod, while in lovelace it works regularly.
I can fix this?

        - type: custom:button-card
          icon: mdi:lightbulb
          entity: input_boolean.prova
          aspect_ratio: 1/1
          name: Test
          label: Ciao
          show_state: true
          show_label: true
          tap_action:
            action: fire-dom-event
            browser_mod:
              command: popup
              title: "Prova"
              card:
                type: custom:button-card
                icon: mdi:lightbulb
                entity: light.led_tv
                aspect_ratio: 1/1
                name: Test
                show_state: true
                show_label: true
                label: "[[[ if (typeof(entity) === 'undefined') return; if ('brightness' in entity.attributes) { if (entity.attributes && (entity.attributes.brightness <= 255)) { var bri = Math.round(entity.attributes.brightness / 2.55); return (bri ? bri : '0') + '%'; } } ]]]"

The Home Assistant has a trick, it is to take snapshots of the state and then you can return to the state as it was before. We are talking about scene.create service. Can this be applied to browser_mod.navigate navigation? For example, I had page 1 open, then after starting the trigger, I opened page 2, when the trigger is re-triggered, it should return to page 1. Thus, no matter which page was opened, the return will always be to the page that was opened before switching.

hello, you have found the solution to that error, Iā€™ve been seeing the same message in the log for a while

Logger: homeassistant
Source: helpers/entity.py:340
First occurred: 1:27:30 (1 occurrences)
Last logged: 1:27:30

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 340, in async_update_ha_state
    raise RuntimeError(f"Attribute hass is None for {self}")
RuntimeError: Attribute hass is None for <Entity None: 1>

Same here. The. combination of custom:button-card as container and popup-content custom:button-cardincluding Javascript causes display errors.

1 Like

hi, please could someone help me out - I am using custom-button-card - and wanted to combine it with browser-mod. What I want to achieve is popup just on the device where the custom-button was pressed.

This is my code so far - it does work, but popup shows on every device.

tap_action:
  action: call-service
  service: browser_mod.popup
  service_data:
    data_template: null
    title: Mistral Smart 400 + CleanR
    large: false
    card:
      type: custom:vertical-stack-in-card
      cards:
        - type: entities
          entities:
            - entity: switch.gosund_sp111_reku
              name: Rekuperator
              icon: hass:fan
        - type: gauge
          entity: sensor.gosund_sp111_reku_energy_power
          min: 0
          name: aktualne zuzycie
          max: 500
          severity:
            green: 0
            yellow: 200
            red: 250
        - type: glance
          entities:
            - entity: sensor.reku_daily_combined_cost
              name: Dzienny
              icon: hass:cash
            - entity: sensor.reku_monthly_combined_cost
              name: Miesieczny
              icon: hass:cash
            - entity: sensor.reku_yearly_combined_cost
              name: Roczny
              icon: hass:cash
          show_name: true
          show_icon: true
          show_state: true
          columns: 3

Use fire-dom-event:


tap_action:
  action: fire-dom-event
  browser_mod:
    command: popup
    large: false
    hide_header: false
    title:
    card:
      type: 

amazing - thank you!!!

i have browser mode on my tablet, after update it is gone
when i try " Browser mod: debug" doesnt show any more on that tablet, doesnt show device_id

tap_action:
  action: call-service
  service: browser_mod.popup
  service_data:
    title: Popup example
    card:
      type: entities
      entities:
        - camera.lenovostick_screen_0
    deviceID:
      - this
  target: {}
entity: sensor.time_since_most_recent
hold_action:
  action: none

instead of getting the camera entity popup for current running device only, i get the default tap action for the sensor.time_since_most_recent sensor (more info-esque dialog box). what am i doing wrong?

  - this

is deprecated. Use alias (if given) or the bare deviceID.

Oh really? Why did they take this function away? it was very useful. Is there any way to automatically include all devices?

1 Like

I just canā€™t get it to work. Could someone give me a hand? This was the code I had (I donā€™t want to specify any ID):

name: RƔdio
entity: input_boolean.radio_da_suite
show_entity_picture: true
size: 10%
styles:
  card:
    - height: 7em
state:
  - entity_picture: /local/img/icones/radio-on.gif
    value: 'on'
  - entity_picture: /local/img/icones/radio-off.png
    value: 'off'
tap_action:
  haptic: light
  action: call-service
  service: script.radio_suite_toggle
hold_action:
  action: call-service
  service: browser_mod.popup
  service_data:
    card:
      cards:
        - cards:
            - color: red
              color_type: card
              icon: mdi:power
              name: Ligar/Desligar
              styles:
                name:
                  - font-weight: bold
              tap_action:
                action: call-service
                service: script.radio_suite_toggle
              type: custom:button-card
          type: horizontal-stack
        - cards:
            - color_type: blank-card
              styles:
                card:
                  - height: 1em
              type: custom:button-card
          type: horizontal-stack
      type: vertical-stack
    deviceID:
      - this
      - dashboard
    title: RƔdio da Suƭte
type: custom:button-card

So i tried:

name: RƔdio
entity: input_boolean.radio_da_suite
show_entity_picture: true
size: 10%
styles:
  card:
    - height: 7em
state:
  - entity_picture: /local/img/icones/radio-on.gif
    value: 'on'
  - entity_picture: /local/img/icones/radio-off.png
    value: 'off'
tap_action:
  action: fire-dom-event
  browser_mod:
    command: popup
    large: false
    hide_header: false
    title: RƔdio da Suƭte
    card:
      cards:
        - cards:
            - color: red
              color_type: card
              icon: mdi:power
              name: Ligar/Desligar
              styles:
                name:
                  - font-weight: bold
              tap_action:
                action: call-service
                service: script.radio_suite_toggle
              type: custom:button-card
          type: horizontal-stack
        - cards:
            - color_type: blank-card
              styles:
                card:
                  - height: 1em
              type: custom:button-card
          type: horizontal-stack
      type: vertical-stack
type: custom:button-card

But didnt work either.

My working conifg looks something like this.

    tap_action:
      action: fire-dom-event
      browser_mod:
        command: popup
        title:  []
        card:
          type: "custom:vertical-stack-in-card"
          cards:
            - type: thermostat

Safe to assume you cleared your cache? Most of my issues with Browser_mod are solved this way.

Try working with only one card to prove it works before stacking in other cards.

Yes, I did. I tested your code and it worked so I think the problem now is with the custom:button-card component that doesnā€™t accept fire-dom-event as action.

Edit: My mistakeā€¦ i ll try to update the custom:button-card


3.4.2 (2021-02-17)
Bug Fixes
Support for fire-dom-event (f4fcbfe), closes #429

Edit 2: All good now! Ty!!

1 Like

Hi, seems like Browser Mod is quite ā€œtalkativeā€ :smiley:
My database is growing fast, and I am aware of the option to filter out sensors, but nevertheless, I guess it still generates a lot of traffic. Any way of reducing the frequency of reporting the sensor value? My three Browser Mod sensors have by far the most number of entries in my DB.

I canā€™t get the media player to work on anything but the local host where HA resides. Iā€™m using cloud and wanted to send tts ( cloud.google_say) to remote browsers( chrome and Safari on macs) but have no success. Iā€™ve set up the proper device IDā€™s ( they are reported available) , get no error messages but there is no playback. Audio playback is fine when I try to manually play a media file from within the HA browser. Any ideas?

Really very often the message ā€œcustom browser player cannot read property player of undefinedā€ is displayed instead of the browser_mod card:
- type: 'custom:browser-player'
Any hints about what to do to avoid it?

browser_mod

Hi,
do you have a new install of home-assistant?

I just yesterday noticed that my tts.cloud_say and also other media stopped working on browser_mod media-players. I cannot send any media or tts to any browser-mod media playersā€¦

Before 2021.06 it worked because I have tested it, but just yeterday wanted to test something else and it did not work. I tested a little bit more, but was not able to get it to workā€¦ Good to hear that Im not the only one!

Mine button says cant find service when i press it