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

Check if you disabled it in the past perhaps?

EDIT: Disabled integration that is.

Hey much thanks to you! I have no idea when I disabled it, but that did it!!! Thanks!

1 Like

Make sure you get the latest version. Currently 2.4.4.

:mega: Browser Mod 2.5.0-beta.2 now available for testing :mega:

This version refactors how the popup dialogs show and now use the Home Assistant dialog manager. This means that z-index issues of any kind are a thing of the past as Home Assistant manages this, including more-info, form pickers etc.

But wait… there is more… introducting… multiple popups! :tada: A popup can be given a tag and popups of a different tag will not dismiss an existing popup of another tag. The dismiss icon can also be customised which means you can make your own popup stacks with UI to match (e.g. icon to be mdi:chevron-left).

We just like super charging Browser Mod so there is even more. A custom:popup-card is now super charged :rocket:

  1. custom:popup-card can now be a more-info replacement for multiple entities or entities of area(s), label(s) and/or devices(s).
  2. custom:popup-card can now have a popup id that can be used in browser_mod.popup as a card/template while still being able to have parameters override the template for specific cases.

And… if you ever tried to use the Browser path sensor… well it’s lacking :frowning_face: So… there is now the Panel sensor. This provides information on the panel (lovelace or other) showing on the Browser, including attributes of PanelTitle, PanelUrlPath, PanelComponentName, PanelIcon, ViewTitle, ViewUrlPath, FullUrlPath, PopupOpen.

A jammed packed 2.5.0 ready for testing and full release soon.

Note: 2.4.3/2.4.4 have a regression on Browser media player not always being available after refresh. This is fixed in this beta.

2.5.0-beta.2 release notes

8 Likes

It is so fantastic what you are fixing and extending. And esp. maintaining. Thanks so much.

3 Likes

I 1000 % agree!

8 Likes

Hey. I am trying to find a way to make my HA instance play a sound on my NSPanel Pro, and was led here. Unfortunately, it doesn’t work, at least not straight away.

I’m running HA as a ā€œwebshortcutā€ on the NSPanel (How to Use the New Web Shortcut Feature in NSPanel Pro V3.7.0?) - so no third-party custom firmware and/or apps. I have no idea what browser does it use. Is there any way to make this work?

Thanks!

Hi. Are you actually using Browser Mod? You said it doesn’t work, but then say at least not straight away. If you are using Browser Mod then keep in mind that interaction with the device is needed after each Browser load to be able to play sound (Browser requirement).

If you can share more details we might be able to help.

:mega: Browser Mod Version 2.5.0 now released :mega:

v2.5.0 Release Notes

7 Likes

Hi. Yes, I do actually use Browser Mod. My NSPanel instance is registered, receives popups and notifications, has a media_player entity in HA, is being interacted with - it just doesn’t play sounds. I use:

target:
  entity_id:
    - media_player.browser_mod_panel
    - media_player.browser_mod_rog
data:
  media_content_id: /local/sounds/ding-dong.mp3
  media_content_type: audio/mpeg
action: media_player.play_media

and the sound plays on my laptop (rog), but not on my panel. I have tried different mp3 and wav files with the same result.

By ā€œnot straight awayā€ I meant that I haven’t done any additional configurations or modifications apart from what the main Browser Mod 2 page says.

UPDATE: Solved! It turned out that tapping once to hide the little orange hand is not enough. I need to swipe/drag across the screen for this to work.

First check would be to go to panel and go to Browser Mod sidebar (as admin user) and time the panel browser and go to the media player. Browse for your sound and see if it plays manually. If not then go to Develper tools, states and fine the media player and look for its attributes bone will be the url of the media resource it was asked to play. If the URL looks different than what you are expecting you may need to check/update the URL of Home Assistant in network settings.

Saying all this, if you really want to get the most rom your panel, setting up Developer mode via ewLink is a sinch and while it.has a disclaimer about no updates etc., once you have developer access the main software you would be updating is Chrome/webView. And as far as I know a full reset will clear out this mode so you are back to out of the box.

I have a NS Panel to test Browser Mod with Companion App and it works well. I also test Fully Kiosk which you may want to look at if you want reliable sounds as you can set autoplay sound/videus which covers off the usual Browser restrictions.

Intresting. I was testing and could not get this to work either. I note that FKB does work without interaction if the auto play video and audio settings are set - paid version not required.

I will see if I can work out how to correctly check that interaction requirements have been met - its likely about having interacted directly with the hidden element that is trying to play audio as a test.

EDIT: Created issue to provide a more reliable way of the first interaction so you don’t have to do magic swipe. At the moment the sweet spot will be right in the middle of the interact icon. [Bug]: NS Panel Pro and Interaction Ā· Issue #989 Ā· thomasloven/hass-browser_mod Ā· GitHub

Hi,
I cant figure out can I pass the entity id for the button that has called popup to the controls located on that popup.

My idea is to make a template popup card with no entity explicitly defined. Than I want to reuse this popup card for different entities.

lets say when i press button with entity covers.my_cover1 it will open popup with various controls and all these controls will control covers.my_cover1
If i press button with entity covers.my_cover2 it will call same popup but child controls will have now entity covers.my_cover2

Can this be achived?

You should be able to do with custom::button-card and templates.

1 Like

Thank you for your reply.
I“m not very familiar with HA, programming and templating. could you please provide details

What i do is:
create a reusable card on one of the views.

type: custom:popup-card
card:
  type: vertical-stack
  cards:
    - type: custom:mushroom-cover-card
      entity: '[[entity]]''
      layout: vertical
popup_card_all_views: true
popup_card_id: test-popup2

Then i create a button:

type: custom:mushroom-entity-card
entity: cover.kitchen_shutters
tap_action:
  action: perform-action
  perform_action: browser_mod.popup
  target: {}
  data:
    popup_card_id: test-popup2

when i press it, calls popup but the entity is not passed to popup. obviously iĀ“m doing something wrong. But can’t understand what.

Generally this will not work the way you are thinking. What you still need to do is generate different popups for the different entities. Templating (which may mean many things) can help you here. E.g. button card allows you to have configuration templates so you can define many of the same buttons, but with different entity, without too much hassle. There is also decluttering card which also has its own templating.

In summary, Browser Mod itself does not support setting data to cards on popups, and it would be very difficult to do so without some standard that other custom cards agree on. However you should be able to achieve minimal code by selecting and using a custom card that matches your templating need.

thank you.

So did i understand correctly, there is no way to re-use same popup for different child entities and i have to make individual popup for each set of child entities?

Correct, on a simple level, no way to send data to a popup.

EDIT: How much yaml code you have to duplicate comes down to how you may use different templating options of other custom cards. Why I went down the path of suggesting it is possible is that my approach would be to use button card for the popup launcher and popup code as a single button-card template. But that is diverging from the discussion, and if I posted a solution it would be pretty much off topic.

FOLLOW UP: I have some time to provide for an example of how you can template using button-card. This flips the approach in that it is using the source card to define all the yaml code, rather than using custom:popup-card defined elsewehere, but then allows to store as a button-card template to reuse with just 3 lines of yaml. I have shown using state_display of button-card to get the current_position of the cover using a nested button-card javascript template.

Depending on what you need to do, you could host any other card in the button-card using custom fields, including perhaps a mushroom card. I have not shown this as I wanted to keep this to first showing how button-card can allow for code minimisation in the manner you are seeking. Should you wish to get further ideas, start a Q&A discussion in the button-card GitHub repo and I will follow up there.

button-card standalone
type: custom:button-card
entity: cover.kitchen_cover
section_mode: true
grid_options:
  rows: 2
  columns: 6
tap_action:
  action: perform-action
  perform_action: browser_mod.popup
  data:
    title: Cover Test
    content:
      type: custom:button-card
      show_state: true
      entity: |
        [[[
          // this executes in main button-card
          // provides entity to button-card in popup
          return entity.entity_id
        ]]]
      state_display: |
        [[[[
          // this executes in the button-card in popup
          // note the extra '[]' which is supported in 
          // button-card 4.2.0
          return `${states[entity.entity_id].state.toUpperCase()} - ${states[entity.entity_id].attributes.current_position}%`
        ]]]]
      show_label: true
button-card using configuration template

Configuration template goes in dashboard yaml via raw configuration editor

button_card_templates:
  cover_template:
    section_mode: true
    grid_options:
      rows: 2
      columns: 6
    tap_action:
      action: perform-action
      perform_action: browser_mod.popup
      data:
        title: Cover Test
        content:
          type: horizontal-stack
          cards:
            - type: custom:button-card
              show_state: true
              entity: |
                [[[
                  // this executes in main button-card
                  // provides entity to button-card in popup
                  return entity.entity_id
                ]]]
              state_display: |
                [[[[
                  // this executes in the button-card in popup
                  // note the extra '[]' which is supported in 
                  // button-card 4.2.0
                  return `${states[entity.entity_id].state.toUpperCase()} - ${states[entity.entity_id].attributes.current_position}%`
                ]]]]
              show_label: true

Dashboard yaml

type: custom:button-card
template: cover_template
entity: cover.kitchen_cover
1 Like

I’m trying to get the popup card to work using a popup_card_id but it isn’t popping up when I hit the button card…

My ā€˜main’ card is:

type: custom:stack-in-card
cards:
  - type: custom:fan-percent-button-row
    entity: fan.games_room_fan
    lowPercentage: 33
    medPercentage: 66
    highPercentage: 100
  - type: button
    show_icon: false
    name: Settings
    tap_action:
      action: perform-action
      perform_action: browser_mod.popup
      data:
        popup_card_id: games-room-fan-settings

The popup card is:

type: custom:popup-card
dismissable: true
card:
  type: custom:stack-in-card
  cards:
    - type: entities
      entities:
        - entity: automation.games_room_fan_on_on_hot_day
        - entity: input_number.games_room_fan_auto_off_temp
          name: Auto OFF Temperature
        - entity: input_number.games_room_fan_auto_on_temp_low
          name: Auto ON Low Temp
        - entity: input_number.games_room_fan_auto_on_temp_med
          name: Auto ON Med Temp
        - entity: input_number.games_room_fan_auto_on_temp_high
          name: Auto ON High Temp
title: Games Room Fan Settings
size: normal
popup_card_id: games-room-fan-settings

Any ideas?