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

Thereā€™s one for each device that connects.

Great mod. I would like to know if it is possible to detect when a user close a popup. I want to include it as an automation, i.e. when a user close a popup it will write an entry to the database. Is it possible?

Tried messing around with popup-styling and if the resolution is below a certain amount it overrides the width parameter and shows a full width dialog. Is it possible to override this in browser_mod or is it a core function of Lovelace?

Made a git issue with examples:

Forgive the noob question but I was wanting to do a proper screen turn off with browser_mod, so I tried doing a light.7d8234b8_a8284fe5 light.turn_off service call and it doesnā€™t seem to have any effect. Should it? Otherwise I can just use the REST API.
Thanks!! :smiley:

For FKB it should do the same thing as the rest api call, provided youā€™ve enabled the right options.

Thatā€™s a feature of Lovelace itself.

Thereā€™s no way to see if a popup is open for now.

Am I correct that the popup only works on my computer is its on the home assistant browser page. Like I would want the popup to show if Im using my computer for other work?

Then youā€™d need some other piece of notification software, I guess.

would it be possible to have the current user displayed in the frontend without explicitly having to point to the sensors the browser-mod creates?

Iā€™d like something like

{{device_id.attributes.current_user}} to be able to do a simple thing like:

  - type: markdown
    content: >
      {%- set time = states('sensor.time') -%}
      ## {{time}} - Good
      {%- if '00:00' < time < '06:00' %} Night
      {%- elif '06:00' < time < '12:00' %} Morning
      {%- elif '12:00' < time < '18:00' %} Afternoon
      {%- else %} Evening
      {% endif %} {{device_id.attributes.current_user}}

I know this isnā€™t valid, but I hope it will convey what I am looking for.

I have set the names on the ids in the browser-mod devices, so have both the sensor for the name, as for the device-id, for the various logged in user/browser combination.

But this doesnā€™t really help. Would have hoped that since the browser knows its browser id (as displayed under the media_player, this (the sensor attributes listed here) could be used in the global HA instance.

thanks for having a look

You can with markdown-mod https://github.com/thomasloven/lovelace-markdown-mod, I think.
It says all functionality is built in to home assistant, but thatā€™s not entirely trueā€¦

I wonā€™t officially support that anymore, though.

aah ok, will have a look back to that. thanks.

so, just to be sure, we canā€™t pull these values with global HA templating (which of course is the basis for the same templating in Markdown)

if the answer is yes, we can not, would this be a viable feature request to add that functionality to browser-mod?

edit

installing markdown-mod wasnā€™t such a good idea so it seems, it kills all other markdown cardsā€¦
Schermafbeelding 2020-02-27 om 11.21.37

even the ones without any alterationā€¦

the feature request remains I fear

Iā€™ll see if it can be added to either browser_mod or card-mod.

2 Likes

yes!, thank you very much indeed sir. Much appreciated, this would open up a whole new world of nice templates. Imagine being able to notify with this. Cool!
Would need it to be browser-mod for that to happen I thinkā€¦

Hi Thomas,

Since upgrading to 106 I receive the following error when using browser_mod to open mini-graph-card via tap action.

I have some other popup cards defined in views and they work fine. I found mention of a preloader and implemented that but to no avail. Affected code below:

Thanks in advance and appreciate all of your hard work.

1 Like

Cool! :slightly_smiling_face: (sorry, but now i know iā€™m not alone)


The preloader was a temporay fix for a change in 0.106 beta. This PR was reverted until 0.107, so not needed until that.
1 Like

No worries lol. I had saw your issue on GH but I hadnā€™t seen that the PR relating to the preloader had been delayed so I shall remove that for now since it isnā€™t serving any purpose.

Since the update to 0.106.2 my pop_up service is not working anymore.

 Uncaught TypeError: Cannot assign to read only property 'deviceID' of object '#<Object>'

anyone a solution for that?

Is it possible to style the nested elements of the popup before the card thats being used in the popup? I am talking about the scrollable div and blank div.

Capture

I know you can style the popup div itself but cannot figure these out.

same error:
ERROR (MainThread) [frontend.js.latest.202002204] https://ha-s.duckdns.org/browser_mod.js:60:314 Uncaught TypeError: Cannot assign to read only property 'deviceID' of object '#<Object>'

"DeviceID": this does not work after update