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

Thanks for reply, i formatted my post.
I have read the documentation, the configuration seems to be correct but it does not work.
Maybe i canā€™t use the service in this way anymore (switch template)?

Your issue has nothing to do with it being in a switch.

I think there are still some lingering issues from the change to browser mod 2.0. There are a handful of things Iā€™ve come across that arenā€™t working exactly as documented.

I just checked my config, and all my browser_mod.navigate service calls happen to have a device_id and are working. I wasnā€™t able to get ithe navigate command to work without a device_id even though the docs suggest it should work (and affect all browsers)

Try constructing your service call using the service tool in Developer Tools. In there, you canā€™t even call the service without choosing a device to run it on.

This gives you the following in YAML, which absolutely works.

service: browser_mod.navigate
data:
  path: /hacs/entry
target:
  device_id: 844e8df7e589372a13ee7d6a638afb79
1 Like

Is there a section in this post where we can set the popupā€™s to not appear on certain devices if a user selects it on their device?

There is information here and here about what browsers a browser_mod service will happen on.

When called like this, the popup will only happen on the browser that initiated the action.

tap_action:
  action: fire-dom-event
  browser_mod:
    service: browser_mod.popup
    data:
      content: ...

So Iā€™m using the following code for my doorbell automation which works great. The only issue is that my Amazon Fire Tablet running WallPanel goes into clock screensaver mode after a minute and the browser_mod popup never wakes the screen to show the image. Any workarounds?

service: browser_mod.popup
data:
  content:
    type: picture-entity
    entity: camera.blueiris_pc_frontdoor
  timeout: 5000
  title: Front Door
  size: wide
target:
  device_id:
    - xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Is there any way to work around the need to touch the screen to enable browser_mod (the privacy icon)? Iā€™m only interested in using the window popup function so no need for TTS or camera.

Is it possible to add another brwoser (my wifeā€™s PC) if she doensā€™t have HA installed?

Hi. So Iā€™m running on a Home Assistant Blue(Odroid N2+)

Home Assistant 2022.10.5
Supervisor 2022.10.0
Operating System 9.3
Frontend 20221010.0 - latest
browser_mod 2.1.3
button_card 3.4.2

I installed browser mod on Sept 16th - Never used it before, so donā€™t think I have any migration issues. I just started setting up some configs and cannot seem to get any form of ā€˜fire-dom-eventā€™ to work.

Full Card Code
- type: 'custom:button-card'
  tap_action: 
    action: navigate
    navigation_path: "garage"
  template:
    - custom_card_room
    - grey_off
  name: Garage
  entity: light.garage_light
  icon: mdi:garage
  variables:
    ulm_icon_tap_action: 'none'
    room_card_area_name: 'Garage'    
    room_card_image_path: '/local/images/garage.jpg'
    entity_1:
      entity_id: binary_sensor.garage_camera_smart_motion_human
      templates:
        - grey_off
        - purple_on
      tap_action:
        action: toggle
    entity_2:
      entity_id: light.garage_light
      templates:
        - grey_off
        - yellow_on
      tap_action:
        action: toggle
    entity_4:
      entity_id: switch.garage_vacuum_plug_on_off
      templates:
        - grey_off
        - pink_on
      tap_action:
        action: toggle
    entity_5:
      entity_id: switch.garage_fan_single_car_on_off
      templates:
        - grey_off
        - blue_on
      tap_action:
        action: toggle
    entity_6:
      entity_id: switch.garage_fans
      templates:
        - grey_off
        - blue_on
      tap_action:
        action: toggle
    entity_7:
      entity_id: cover.single_car_garage_door
      templates:
        - green_closed
        - red_open
      tap_action:
        action: fire-dom-event
        browser_mod:
          service: browser_mod.popup
          large: true
          hide_header: true
          data:
            content: !include garage/garage_doors.yaml
    entity_8:
      entity_id: cover.two_car_garage_door
      templates:
        - green_closed
        - red_open
      tap_action:
        action: call-service
        service: browser_mod.popup
        service_data:
          content: !include garage/garage_doors.yaml
  label: >-
    [[[ 
      return '&nbsp;<ha-icon icon="mdi:thermometer" style="width: 16px; height: 16px;"></ha-icon>' + 
      states['sensor.garage_sensor_temperature'].state + 'Ā°F' +
      '<br><ha-icon icon="mdi:water-percent" style="width: 16px; height: 16px;"></ha-icon>' + 
      states['sensor.garage_sensor_humidity'].state + '%' +
      '<br>&nbsp;&nbsp;&nbsp;<ha-icon icon="mdi:snowflake-alert" style="width: 16px; height: 16px;"></ha-icon> ' +
      states['sensor.garage_frostrisk'].state
    ]]]
Entity 7/8 garage_doors.yaml
  type: 'vertical-stack'
  cards:
    - type: custom:webrtc-camera
      url: >-
          rtsp://user:[email protected]:554/cam/realmonitor?channel=1&subtype=1
      intersection: 0.75  # auto pause stream when less than 75% of video element is in the screen, 50% by default
      muted: true  # disable sound, default true
      ui: true  # custom video controls, default false
      shortcuts: # custom shortcuts, default none
        top: 0 # top margin in pixels, default 0
        left: 0 # left margin in pixels, default 0
        orientation: vertical # orientation (horizontal or vertical), default horizontal
    - type: "custom:button-card"
      template: card_cover
      entity: cover.single_car_garage_door
      variables:
        ulm_card_cover_enable_controls: true
        ulm_card_cover_garage: true
    - type: "custom:button-card"
      template: card_cover
      entity: cover.two_car_garage_door
      variables:
        ulm_card_cover_enable_controls: true
        ulm_card_cover_garage: true

Entity 7 doesnā€™t work with ā€˜fire-dom-eventā€™, while entity 8 does with call service:

    entity_7:
      entity_id: cover.single_car_garage_door
      templates:
        - green_closed
        - red_open
      tap_action:
        action: fire-dom-event
        browser_mod:
          service: browser_mod.popup
          data:
            content: !include garage/garage_doors.yaml
    entity_8:
      entity_id: cover.two_car_garage_door
      templates:
        - green_closed
        - red_open
      tap_action:
        action: call-service
        service: browser_mod.popup
        service_data:
          content: !include garage/garage_doors.yaml

Below, the card - garage doors on the right are entity 7/8. Entity 8 opens the popup, but on all devices. Iā€™m sure this has been covered, but I have scrolled through this thread like mad, and used all examples of fire-dom-event, including what is documented. Can anyone help lead me down the right path to get fire-dom-event working? Or point me to the documentation or an example of fire-dom-events for Developer Tools ā†’ Events and which events to subscribe to figure out if they are even firing?

Thanks
image

:exclamation: Edit: Actually I figured it out. While the UI Minimalist Templates are using custom:button-card which supports browser_mod. The Entities within the templates are also using ā€˜custom:button-cardā€™ but the definitions limit them in returns.

Entity 8 for example in my template - Referencing ā€˜widget_icon_roomā€™

    i8:
      card:
        type: "custom:button-card"
        template: >
          [[[
            var templates = ['widget_icon_room'];
            if (variables?.entity_8?.templates?.length) {
              return ['widget_icon_room'].concat(variables.entity_8.templates);
            }
            return templates;
          ]]]
        variables: "[[[ return variables.entity_8; ]]]"
        entity: >
          [[[
            if (variables?.entity_8?.entity_id) {
              return variables.entity_8.entity_id;
            }
          ]]]
        state:
          - operator: "template"
            value: "[[[ return !variables.entity_8; ]]]"
            styles:
              card:
                - display: "none"  

widget_icon_room - I had to add the ā€˜browser_modā€™ line for tap_action, and hold_action.

widget_icon_room:
  variables:
    tap_action:
      action: "toggle"
    hold_action:
      action: "more-info"
  tap_action:
    action: >
      [[[ if (variables?.tap_action?.action) return variables.tap_action.action; else return 'none'; ]]]
    entity: "[[[ return variables.tap_action.entity; ]]]"
    navigation_path: "[[[ return variables.tap_action.navigation_path; ]]]"
    url_path: "[[[ return variables.tap_action.url_path; ]]]"
    service: "[[[ return variables.tap_action.service; ]]]"
    service_data: "[[[ return variables.tap_action.service_data; ]]]"
    browser_mod: "[[[ return variables.tap_action.browser_mod; ]]]"
  hold_action:
    action: >
      [[[ if (variables?.hold_action?.action) return variables.hold_action.action; else return 'none'; ]]]
    entity: "[[[ return variables.hold_action.entity; ]]]"
    navigation_path: "[[[ return variables.hold_action.navigation_path; ]]]"
    url_path: "[[[ return variables.hold_action.url_path; ]]]"
    service: "[[[ return variables.hold_action.service; ]]]"
    service_data: "[[[ return variables.hold_action.service_data; ]]]"
    browser_mod: "[[[ return variables.tap_action.browser_mod; ]]]"
  show_icon: true
  show_name: false
  styles:
    grid:
      - grid-template-areas: "'i'"
    card:
      - height: "100%"       
      - box-shadow: "none"
      - padding: "0px"    
      - border-radius: "50%"
    icon:
      - width: "50%"
      - height: "50%"
      - line-height: "0"
      - color: "rgba(var(--color-theme),0.2)"
    img_cell:
      - border-radius: "50%"
      - background-color: "rgba(var(--color-theme),0.05)"
  color: "var(--google-grey)"
  size: "15px"

TLDR; Card templates might be limiting you. :ok_hand:

@thomasloven it might be worth adding a note in the documentation about adding returning ā€˜browser_mod:ā€™ data to card templates if fire-dom-event is not working for a specific card.

Iā€™m playing with popup and i canā€™t find a way to change font sizeā€¦
How to increase fonts in popup card (words " Switch to NET radio?" and ā€œYESā€, ā€œNoā€) ? Iā€™ve tried a number of things, but nothing works.

type: custom:button-card
entity: script.onkyo_set_net
name: Radio
tap_action:
  action: fire-dom-event
  browser_mod:
    service: browser_mod.popup
    data:
      autoclose: false
      style: |
        --font-size: 30px !important;

        --popup-border-color: lime;
        --popup-border-width: 5px;
        --app-toolbar-font-size: 50px;
      content: Switch to NET radio?
      right_button: YES!
      left_button: No!
      right_button_action:
        service: script.onkyo_set_net
show_name: true
icon: mdi:radio
show_state: false
styles:
  card:
    - background: cyan
    - color: black
    - font-size: 30px
    - font-weight: bold
    - height: 80px
  icon:
    - color: red

Hi !
Is it normal when I turn off the screen in FKB, the motion binary_sensor becomes active ?

Hi, I am trying to turn off the screensaver in a particular browser/device that has both WallPanel and browser_mod installed but getting nowhere, Iā€™ve followed the instructions here but can get the screensaver to turn off only one device in particular when using an input_boolean?

https://github.com/j-a-n/lovelace-wallpanel/blob/main/README.md#integration-with-browser_mod

wallpanel:
  enabled: true
  image_order: random
  profiles:
    device_72429d4d-b7a9d750:
      image_url: https://source.unsplash.com/random/${1920}x${1080}?dogs
      screensaver_entity: input_boolean.screensaver
    device_b79de8c5-bc58aa78:
      image_url: https://source.unsplash.com/random/${1920}x${1080}?cats
      screensaver_entity: input_boolean.screensaver
  profile: device_${browser_id}
title: Home
views:
  - path: default_view
    title: Home
    visible:

Hey, thanks for an awesome project.

I found out that itā€™s not possible to play local media on the browsers that are connected over the internet and not via local network. It kinda makes sense given itā€™s local media, but does anyone knows if there is a way how to play a sound on media_player.some_player that is connected from outside via the internet?

this seems not to work anymore with 2011.11.x
any idea why?

Hi,

I try to open a more_info from an other entity as showing in the card. So I have create a template to get the sunset up and down from the sun entity. But if i tap at this chip cards I want to sho the more info from the entity sun.sun but nothing happens.

Here is my code:

type: custom:mushroom-chips-card
chips:
  - type: entity
    entity: sensor.tmp_sun_sonnenaufgang
    use_entity_picture: true
    icon_color: yellow
    tap_action:
      action: call-service
      service: browser_mod.more_info
      data:
        entity: sun.sun
        large: true

Thank you.

I tried doing a search on this however I didnā€™t really see a solution unfortunately. I added a new tablet and registered it, all the sensors seem to work and the screen switch also works however the media_player only shows as ā€œunavailableā€. Is there a solution to this? Will that only appear if I am using Fully Kiosk? Any way to make that available?

I pretty much gave up on browser mod. Itā€™s just too unreliableā€¦ available, not available, availableā€¦ i canā€™t be sure that anything, connected with browser mod will or wonā€™t work.
Author is being silent for quite a while now, so itā€™s not clear if he gave up on browser mod or is he sick or something (hopefully not).

Hi All,

After a restart of HA I see this error:

2022-11-08 12:58:24.642 ERROR (MainThread) [homeassistant.components.sensor] Platform browser_mod does not generate unique IDs. ID ae1b43e7-eb57c683-Browser_path already exists - ignoring sensor.tablet_browser_path

2022-11-08 12:58:24.650 ERROR (MainThread) [homeassistant.components.sensor] Platform browser_mod does not generate unique IDs. ID ae1b43e7-eb57c683-Browser_visibility already exists - ignoring sensor.tablet_browser_visibility

2022-11-08 12:58:24.652 ERROR (MainThread) [homeassistant.components.sensor] Platform browser_mod does not generate unique IDs. ID ae1b43e7-eb57c683-Browser_userAgent already exists - ignoring sensor.tablet_browser_useragent

2022-11-08 12:58:24.654 ERROR (MainThread) [homeassistant.components.sensor] Platform browser_mod does not generate unique IDs. ID ae1b43e7-eb57c683-Browser_user already exists - ignoring sensor.tablet_browser_user

2022-11-08 12:58:24.657 ERROR (MainThread) [homeassistant.components.sensor] Platform browser_mod does not generate unique IDs. ID ae1b43e7-eb57c683-Browser_width already exists - ignoring sensor.tablet_browser_width

2022-11-08 12:58:24.659 ERROR (MainThread) [homeassistant.components.sensor] Platform browser_mod does not generate unique IDs. ID ae1b43e7-eb57c683-Browser_height already exists - ignoring sensor.tablet_browser_height

2022-11-08 12:58:24.662 ERROR (MainThread) [homeassistant.components.binary_sensor] Platform browser_mod does not generate unique IDs. ID ae1b43e7-eb57c683-Browser_dark_mode already exists - ignoring binary_sensor.tablet_browser_dark_mode

2022-11-08 12:58:24.664 ERROR (MainThread) [homeassistant.components.binary_sensor] Platform browser_mod does not generate unique IDs. ID ae1b43e7-eb57c683-Browser_FullyKiosk already exists - ignoring binary_sensor.tablet_browser_fullykiosk

2022-11-08 12:58:24.666 ERROR (MainThread) [homeassistant.components.binary_sensor] Platform browser_mod does not generate unique IDs. ID ae1b43e7-eb57c683-activity already exists - ignoring binary_sensor.tablet

2022-11-08 12:58:24.669 ERROR (MainThread) [homeassistant.components.light] Platform browser_mod does not generate unique IDs. ID ae1b43e7-eb57c683-Screen already exists - ignoring light.tablet_screen

What can I do to resolve this?

Hey - @GGexe and @Olivier974 - wanted to share my ā€œfixā€ for this issue:

I experienced this issue as well and figured out how to resolve it by following the troubleshooting steps in the Lovelace Plugins Ā· thomasloven/hass-config Wiki Ā· GitHub guide, but I do think this may be a bug still.

When installed via HACS, this is added as a lovelace resource. I kept seeing this error described above:

Uncaught SyntaxError: Identifier 't' has already been declared (at browser_mod_panel.js:1:1)

In the troubleshooting steps, Thomas wrote:

Uncaught SyntaxError: Unexpected identifier
You may have specified the resource as type: js when itā€™s supposed to be type: module. Read the docs again to make sure.
Lovelace Plugins Ā· thomasloven/hass-config Wiki Ā· GitHub

So what I did to resolve this was in my configuration.yaml I added an extra_module_url to /browser_mod.js and then removed the resource link under dashboards. Once this was done and I restarted, I was able to view the browser_mod panel in my dashboard.

configuration.yaml example:

frontend:
  extra_module_url:
    - /browser_mod.js

Not sure if something needs to be changed with the install or with the instructions? But once I adjusted the above and restarted - boom, the panel loads fine now.

HTH!

2 Likes

hello @stratotally

i really appreciate your feedback! thanks

but unfortunately it doesnt work for me.

I redownload Browser_mod in hacs, then do integration part. Then add the config in configuration.yaml and then delete the module line in dashboard.

Browser_mod is on the left side but i still have a blank page when i click on itā€¦

Did you restart after adding in the extra_module_url to configuration.yaml?

Edit: AND force a refresh? (in chrome: view inspect, right click on refresh ā€œempty cache and hard reloadā€)

1 Like