{% set devices = integration_entities('browser_mod')|select('contains','browser_useragent')|list -%}
{% set ns= namespace(output = '') -%}
{% for dev in devices -%}
{% set out = dev.split('agent')[-2] -%}
{% if states(out) != 'unavailable' -%}
{% set ns.output = dev.split(".")[1].split("_browser")[-2] ~'/'~ states(out) ~ states[out].last_updated.strftime('(%d%b%H:%M)') ~ '; ' ~ ns.output -%}
{% endif -%}
{% endfor -%}
{{ ns.output|truncate }}
Itās not quite doing what you want, but you can adapt it. Iāve been fumbling my way towards logging how much time my HA is getting used and this was one (failed) step to recording the times currently logged-on users changed.
But can you be more precise as to what you mean by ānot workingā? That the popup doesnāt appear at all? How long does it work for after refreshing browser cache for example? If you use the browserās developerās tools, does it show any loading errors?
Maybe try removiing the custom:stack-in-card? Or trying a core card rather than custom:more-info-card? Then we can perhaps establish whether the problem is with the popup action itself, or just the way youāre configuring the content.
Not sure how to now use your code inside the javascript, since I donāt have access to integration_entitiesā¦but waitā¦now I know the browser_id, I should be able to poke at the states('sensor'+browser_id+'_useragent') or something like thatā¦
This gets you the user name using the same technique. But some bewares: more than one user might be logged on, hence the list output. Big problem is that it canāt always find a logged on user; when Iām playing around with template editor it gives a null after a while. Weird.
using: >
{% set devices = integration_entities('browser_mod')|select('contains','browser_useragent')|list -%}
{% set ns= namespace(output = '') -%}
{% for dev in devices -%}
{% set out = dev.split('agent')[-2] -%}
{% if states(out) != 'unavailable' -%}
{% set ns.output = dev.split(".")[1].split("_browser")[-2] ~'/'~ states(out) ~ states[out].last_updated.strftime('(%d%b%H:%M)') ~ '; ' ~ ns.output -%}
{% endif -%}
{% endfor -%}
{{ ns.output|truncate }}
What I really want to do is log to a csv file every time a user logs on or out (or times-out). I just canāt get any event to reliably trigger from a log on.
Hi
I am working on a dashboard that use floor3d-card.
In floor3d-card you can klick on a room that can fire a service like a script.
In that script i have used ābrowser_mod.popupā and this works great.
The problem is that this popup on all screens.
And the problem i also that i can not use something like fire-dom-event and deviceid: THIS inside floor3d-card.
So how can i get the browserid i klicked on so popup shows on correct screen.
Yes, the popup does not appear at all. I have no time. Sometimes it is working for days, sometimes only for hours after refreshing.
When I use the browsers developer tools there are a lot of errors. But I donāt know where they come from or if they are related to browser_mod.
There are a lot of:
connection.js:315 Uncaught (in promise)
connection.js:315 Uncaught (in promise) {code: ānot_foundā, message: āSubscription not found.ā}
home:1 Unchecked runtime.lastError: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received
card-mod.js:1 Card-mod warning
card-mod.js:1 You are using a custom card which relies on card-mod, and uses an outdated signature for applyToElement.
card-mod.js:1 The outdated signature will be removed at some point in the future. Hopefully the developer of your card will have updated their card by then.
card-mod.js:1 The card used card-mod to apply styles here: <browser-mod-popup class=ā"undefined">ā#shadow-root (open)ā
mushroom.js:298 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading āconfigā)
Iāve been trying to get help with the browser_mod integration for the past three days and have had no luck finding the answer online. I have browser_mod (v2) installed on my Home Assistant and have registered two clients. I can see these devices in the Browser Mod integration panel, and I can send popup messages to the clients (or to one of them) using actions.
However, Iām struggling to figure out how to retrieve the browser_id (or device_id) from the client currently accessing the server in a template. I need this information to apply conditional logic in a picture-elements card, to scale the font size depending on the device accessing the dashboard.
In the states panel, I can see various entities for my registered devices, such as media_player.DEVICE_ID, sensor.DEVICE_ID_browser_dark_mode, sensor.DEVICE_ID_browser_user, and more, but none of them seem to indicate the browser_id of the client in the current session.
According to instructions Iāve found online, this should be possible, but I must be missing something. Is there something else I need to configure, or should I use a script to detect the current user?
If anyone could help, I would really appreciate it.
@cloudbr34k thanks for the reminder, I meant to post this yesterday.
PSA
Upgrading to 2025.1.0 will cause the Browser_mod configuration page to not load when you click the side panel. This means that you can be stuck with whatever settings you had previously. Also if you did not have auto register browsers set to on that when your browser id changes popups will stop working.
The good news is that itās an easy fix that most people can do themselves by editing 3 lines in 2 files. Simply open custom_components/browser_mod/browser_mod.js and custom_components/browser_mod/browser_mod_panel.js then find getRoutes and replace it with _getRoutes. Thatās it, a silly little underscore in 3 places⦠1 in browser_mod.js and 2 in browser_mod_panel.js
You can find the issue linked in my previous post, the fix details here, and I created a quick PR for it here. Hopefully this just needs some quick attention from @thomasloven.
Anyone get browser mod to play the audio? I have used some old version HA 2022.7 and all was working. With the newest release 2024.7+ no luck. It looks like this wasnāt a popular function, but anyone have it working with the newest HA release?
EdiT; In my case the issue was with config/network settings. Iām using HA in kubernetes with LoadBalancer and I have to set local network manually in HA config/network⦠The same issue will be for any containerized deployment with overlay network (network not in a host mode).
Hi there! I have spent the past hours trying to animate my popup cards. I dont want them just to appear in the middle of the screen, but rather fill screen, slide in from the right and stop at about 20% from the left. I got it working quite easily using css animations⦠BUT. There is something wierd about the popup card. First I thought it was the animations, but now I can see the issue even with the most basic example. It ALWAYS work the first time I summon the popup. Then I close it, and summon it again, then there is a quick āflickerā in the middle of the screen. It is there even without animations, and it looks way worse with the animation enabled, because then the center of the screen is empty, and the popup card appears and disappears for like 0.1 second before it slides in as it should. I disabled the animations and it is the same.
Has anyone seen this? Is there a way to solve it? Here is the code I use, a most basic example. You have to tap the button a few times before it start acting wierd.