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

browser_mod.popup is a service so unless run using fire-dom-event you need to provide a Browser ID as backend needs to know where to direct it.

Two options:

  1. Provide a browser_id for browser_mod.popup in data. Also you will need to provide Dashboard url as a prefix to popup_card_id.
  2. (What I think you want) Use fire-dom-event method to make it a Browser call to run locally. See below.
  - type: button
    show_icon: false
    name: Settings
    tap_action:
      action: fire-dom-event
      browser_mod: 
        service: browser_mod.popup
        data:
          popup_card_id: games-room-fan-settings

EDIT: Doco Link

ok thanks, yep, that works. Thank you!

It would seem that those docs dont align with these then… or does that example only apply when using a service call / action?

Hi, just noted this in your code. FYI: This is decluttering card variable format.

I remember when I started with HA and that Google (these days AI) would lead me down strange paths that just would not work. Usually it was following some example where context was not fully documented.

Quick rule of thumb I use (others may have more):

  1. {{ 'home assistant core jinja template' }} {# jinja #}
  2. [[[ return 'usually button-card template' || 'button-card derived like honeycomb-menu'; //javascript ]]]
  3. '[[ i_am_a_decluttering_card_variable ]]' #quoted if on single line in yaml
1 Like

Good feedback. Thanks I can see where the documentation can be improved. `popup_card_id’ is new feature and would lead you to think it would just work the way you expect. However there is the need to work with the way Home Assistant services work, and that Browser popup service can work both ways. The doco should have both methods in that section.

EDIT: Documentation improvement request

1 Like

Hello everyone, I’ve been sitting in front of my PC for hours now trying to get Browser_Mod to work in Home Assistant.
What I’ve managed to do:
I can easily display a pop-up with text.

alias: 1 Test Stream Haustür Kamera
description: ā€œā€
triggers:

  • trigger: state
    entity_id:
    • input_boolean.testschalter
      from: ā€œoffā€
      to: ā€œonā€
      conditions:
      actions:
  • action: browser_mod.popup
    metadata: {}
    data:
    dismissable: true
    autoclose: false
    title: Haustür
    size: normal
    timeout: 30000
    browser_id:
    - 7f8cef077f14d05e86ad643003a34618
    content: null
    type: picture-entity
    entities: camera.haustuer_cam_fliessend
    camera_view: live
    enabled: true
  • action: browser_mod.popup
    metadata: {}
    data:
    dismissable: true
    autoclose: false
    browser_id:
    - 7f8cef077f14d05e86ad643003a34618
    title: Haustür
    content: Test-Pop-up ist da!
    enabled: true
    mode: single

When streaming from a Reolink camera, no image appears, only the pop-up runs for 30 seconds. But no stream is displayed. The camera is integrated into Home Assistant and works.
Can anyone tell me what the problem is?
THX Reinhard

Hi. It’s likely a network/url issue of the media source stream, in that the resolved media url can’t be played by the Browser. If this is not working on your desktop, checking the browser console log will likely have an error to help you along. If it is a device that is not working, then you can try the Browser Mod media player for that device. If it fails, look at the media player device in states tab if Developer tools, look at the attributes to find the url that was attempted.

Usual issues here is that the Browser is using https to access Home Assistant, perhaps cloud, but the media is being streamed by http using local network URL. Another issue if both are http is that one is a named url and one an IP address, then being a CORS issue. All these sort of network issues can be first managed by checking your local and cloud URL in network settings. You can also set cors_allowed_origins under http in configuration.yaml if required.

I’m sorry, but I don’t understand. How can I narrow down the problem?

Read my post carefully. It describes steps to take to work out your issue.

Hi,

Thanks for your help and pointing me to the right direction. It took couple of days, to check and learn what you’ve suggested.

I revised my dashboards and now using button-card templates massively. thanks a lot!

1 Like

One question: i guess that media player (and with that the need for interaction) can’t be disabled (so that it’s not created at all) if it’s not in use? I only use fully’s media player, so if this interaction is only for media player it can be somewhat annoying, especially this new one where you HAVE to press on play icon exactly. I already got a call from my family member that ā€œthere’s a huge icon across the screen and i can’t do anything with HA no matter where i pressā€. So, i think that this precise clicking can be a problem with some people.

Ok, i guess that one option is just to hide interaction icon in settings…?

I had not expected this would be required for so many devices, as there have only been few issues related to audio not available for Browser Mod media player. It looks full interaction is needed more than I thought, but like you, Browser Mod media player is not used so never an issue. I will put full interaction behind a Frontend setting so as to keep the status quo for devices.

2 Likes

:mega: Browser Mod v2.5.2 Released :mega:

Version 2.5.2 Released. This makes the Full user interaction opt via a new Frontend settings which defauls to unset (off), bringing back the prior 2.5.1 experience.

1 Like

I’m testing V2.5.3 B1 and new service call ā€œbrowser_mod.change_browser_idā€.

Question: is current browser mandatory to select? I’d like to change ID of device where i trigger this new service call, so i guess i’d need something similar as ā€œbrowser: THISā€. Is that possible? Currently if i leave ā€œcurrent browser IDā€ blank nothing happens.

If that’s possible it would be a great way to change ID of device with non-admin call with button card click. Or, at least is there any command for retrieving current ID? (similar like "return localStorage[ā€œbrowser_mod-browser-idā€] " for custom-button-card)

Leave both current_browser_id and new_browser_id blank to get a interactive popup as per the documentation. If Browser call then this will show only on current Browser. If Server call will popup on all Browsers. It is not intended that you use the interactive method as a Server call, but at the same time is easily cancelled.

Changing Browser ID is not intended to be a non-admin operation, nor a non-interactive action. The way the new service is constructued is to make sure that an unintended Browser ID change is not actioned. If you are guiding a remote user on the update, then it would be to press the button you have set to do a Browser call, then select the Browser ID as instructed by yourself. I thought long about the best way to manage this, and any other method comes with various risks, all which may lead to support issues for admins or Browser Mod maintainers in allowing for an unintended Browser ID change.

If wishing to use an advanced solution, my suggestion would be either:

  1. To have a Device management dashboard/view of some kind, and have button-card buttons, perhaps conditionally shown by user, if using different HA users, that use templating to get the current Browser ID to pass to browser_mod.change_browser_id, along with the new (existing) Browser ID. FYI: The best way to get the current Browser ID in javascript is window.browser_mod.browserID.
  2. Use a Home Assistant script as your Browser call action where you can pass browser_id: THIS and new/existing Browser ID, then the script can send browser_mod.change_browser_id.

If using either of these methods you do so at your own risk of unintended Browser ID change.

1 Like

Thanks, i’ll try. It seems that i can’t find beta documentation you mention, though.
For now only thing it works is if i leve all blank - i do get popup window and i can change ID. However, what i must figure out is to change name with only one click (make button card with tap action). code below for example doesn’t work (yet):

type: custom:button-card
name: test
tap_action:
  action: fire-dom-event
  browser_mod:
    service: browser_mod.change_browser_id
    data:
      browser_id: THIS
      new_browser_id: new_device_id
      refresh: true
      register: true

If using either of these methods you do so at your own risk of unintended Browser ID change.

of course, i understand. But in my case i want user to intentional changes ID from random to pre-set one (in button card)

Beta documentation is in dev branch, use link from beta release notes. This is always the case for beta documentation.

browser_id is not a parameter of the service. It is current_browser_id and THIS is not and cannot be supported.

In button/card all action parameters are recursively employable, so you can template current_browser_id: ā€˜[[[ return window.browser_mod.browserID ]]]’

I can’t stress enough that while I can assist you with Browser Mod knowledge this custom method is not supported as it relies on you protecting that button in some way so it is not pressed on the wrong browser causing an unintended Browser ID change. This comment is as much for you as it is for others reading this, including AI :robot:

1 Like

Yep, i see what you mean - i just did that… :flushed: But, i’m on my ā€œtest PCā€, so it was intentional ( i hoped that i’ll do that).

Your template suggestion works, thanks a lot! I guess i’ll solve ā€œwrong browser clickā€ with a kind of current user condition or current device… i know i already tested that for a different purpose a while ago, so it is doable. I do have notes somewhere, i just have to find it among my saved ā€œtestsā€.

Thanks again!

1 Like

:mega: Browser Mod v2.5.3 Released :mega:

New features

  • Allow disable of screen ā€˜light’ to prevent any brightness changes to device when using Full Kisok. (Issue #1021)
  • New service browser_mod.change_browser_id. See SERVICES.md for more information.
  • Browser ID edit field on configuration page now a combo-box which includes existing known Browser IDs. This may be useful to reset a Browser ID that has been lost.

Fixes

  • Fix interact console error on touch devices. (Issue #1016)
  • When Save screen state Frontend setting is active, save screen state on state change. Beforehand screen state was only saved on disconnect from Home Assistant server.

Full Changelog: Comparing v2.5.2...v2.5.3 Ā· thomasloven/hass-browser_mod Ā· GitHub

1 Like

is it possible to set standard dashboard to ā€œfusionā€ dashboard?

Hello
when i open HA main url, i have to click twice to use the site. The first click is to disabled ā€œBrowser modā€ icon, i don’t know why?
I run with last version (this behavior occurs recently)