đŸ”č Browser_mod - turn your browser into a controllable device, and a media_player

I don’t use browser_mod myself, and haven’t actually tested it for a very long time.
It’s quite possible that something has broken about the hack that makes - this work.

You could try deviceID: this instead, until I have time to fix it. That’s a bit more stable.

Can someone who is using fully kiosk browser try something for me?

I’m solving for a discrepancy between the deviceID shown within fully kiosk browser and what is shown in my Home Assistant configuration.

When I clear cache on my fully kiosk browser the device id changes in Home Assistant. It remains the same in fully kiosk browser.

This is a problem as I have to restart Home Assistant to capture the new device alias whenever I clear cache on the device.

I can duplicate this personally on amazon FireOS, LineageOS both with fully kiosk browser installed.

The deviceID is shown in fully kiosk browser here
Settings / Other Settings / Device ID

thank you

One of the android app on a tablet doesn’t seem to be working. When I do browser_mod.debug from the developer tools from my PC browser, my PC browser and mobile phone (android app) will get a popup with the device ID.However on the tablet (android app) nothing is popping up. When I go into the developer tool on the tablet (Android App), and do browser_mod.debug it will cause the popup to showup on every other device except for the tablet. I’ve tried reinstalling the app, clearing the cache and data but nothing seems to be working.

The only working thing is that if I use a browser(firefox) on the tablet will I see a popup.

Other notes: Android app is using the most up to date app, Tablet android OS: Android 7.1.1

Does anyone have any solution to the problem of the android app not showing a device id popup when I do browser_mod.debug ?

Thanks!

This tablet did not have chrome browser installed, which made the app not work with browser_mod. After enabling it I can see the deviceID now.

Does anyone know how you first CHECK the current path before ‘navigating’ ? I know how to read the path

{{ state_attr('sensor.7d8111b8_a8211111', 'path') }}

but I don’t know how to assess/compare in a template/condition

thanks!

https://jinja.palletsprojects.com/en/2.11.x/templates/#if

Sorted - thanks

{{ is_state_attr('sensor.7d8111b8_a8211111', 'path', '/lovelace/6') }}

I am still struggling with the device id displayed in fully kiosk browser being different to the device id for it shown in Home Assistant. When I clear the cache on fully kiosk browser the device id changes within Home Assistant. Does anyone else have this problem?

1 Like

Is there a way to have a popup card close automatically after seconds of no activity.

Use case is I’m using popup-light-card to dim lights, if the popup is left open and there’s been no activity on the popup I’d like to automatically close it.

Thanks!

Sure, check the documentation about popups: :slight_smile:

Thanks, I read the docs, but no. The time parameter pops up a card after a set time, which is cool, but not what I’m trying to do. I’m trying to close a popped up card after seconds of no mouse/tap activity. Here’s the config I tried:

                        action: call-service
                        service: browser_mod.popup
                        service_data:
                          title: Popup
                          deviceID: this
                          auto_close: true
                          time: 1

Also, using auto_close is the opposite of what I’m trying to achieve.

There’s no way of acomplishing this with browser_mod alone. You can send a browser_mod.close_popup command from the backend after a set time, and keep track of interactions some other way.

I working on a PR right now. Something such as autoclose_popup_card: <time>. Doesn’t seem too hard
 but I’m less experienced at JS.

this is a great mod! at least I can see the potential for my use case.

I’d like to play a sound on all the clients that are connected to HA lovelace (with browser_mod running) using the HA REST API

At the moment I have:
curl -X POST -H “Authorization: Bearer xxxxx” -H “Content-Type: application/json” -d “{“entity_id”: “media_player.xxxxxxxxxxxxxx”}” http://xxx.xxx.xxx.xxx:8123/api/services/media_player/media_play

which works great for 1 single connected client.

How can I, with a single http request, play a sound on all clients that are connected?

To target all media players, use all .

Hello, thank you again for this amazing component.

Recently, after upgrading from 109 to 112, my Chrome browser on Mac (I’ve tested this with firefox as well) has to be refreshed manually every time HA is restarted in order for the browser_mod entities to show up. This issue doesn’t occur on my 2 fire tablets running Fully Kiosk browser - the browser_mod entities are there after HA restart, without issue.

Any ideas why the refresh is suddenly required?

Browser_mod was PERFECTLY before the upgrade (and still is other than that 1 issue)

Thanks!

Has something changed because now I am getting no radius on the top part.

image

tap_action:
  action: call-service
  service: browser_mod.popup
  service_data:
    title: >
      [[[
        var entity_id = 'input_text.irrigation_cycle{{ cycle }}_name';
        return states[entity_id].state.toUpperCase() + ' SCHEDULE';
      ]]]
    card:
      type: custom:time-picker-card
      entity: input_datetime.irrigation_cycle{{ cycle }}_start_time
      name: Start Time
      layout:
        name: inside
      style: >
        ha-card {
          border-radius: 0em 0em 1em 1em
        }
    deviceID:
      - this
    style:
      font-family: >
        [[[
          return states['input_text.irrigation_ui_font_family'].state
        ]]]
      box-shadow: 0em 0em 0.5em
      border-radius: 1em
      opacity: 0.9

Try adding overflow: hidden

Thanks, that did it.

EDIT Ignore this. Obviously this can be achieved with hui-element and conditional cards.
:blush:


Another question but I might have reached the limits of what is possible?
(And also this might actually be a lovelace_gen issue?)

I have a popup with an input_select.

I want to display different entities in the popup based on the state of the input select.

I can do that and it works well but I really need to also base those entities on a passed variable. That is the part I cannot get working.

Everything displays correctly until I use a passed variable then the popup doesn’t change what is shown when I change the selection in the input select. If I hard code the variable, it works.

(And obviously next time I open the popup it is correct, it is just not dynamic).

Is this possible to achieve?

Thanks


Here is the relevant code:

- entity: input_number.irrigation_cycle{{ cycle }}_start_time_sunrise_offset
  name: Offset in minutes
  style: >
    :host {
      {% raw %}
      {% set cycle = {% endraw %} {{ cycle }} {% raw %} %}
      {% set type = states('input_select.irrigation_cycle' ~ cycle ~ '_start_time_type') %}
      {% if type != 'Sunrise Offset' %}
        display: none;
      {% endif %}
      {% endraw %}
    }

For reference here is the code that works:

- entity: input_number.irrigation_cycle1_start_time_sunrise_offset
  name: Offset in minutes
  style: >
    :host {
      {% raw %}
      {% set type = states('input_select.irrigation_cycle1_start_time_type') %}
      {% if type != 'Sunrise Offset' %}
        display: none;
      {% endif %}
      {% endraw %}
    }

Hi, I think this may have been addressed in the past, but, I was unable to find a solution. Trying to trigger a markdown card in an automation as follows – it pulls up, but I get a red card with error “Custom element doesn’t exist: hui-markdown-card”

I’m on HA 0.112.4, Browser_mod: release 29. Trying to pull up on recent android tablet and I have deleted my cache.

    - service: browser_mod.popup
        data:
          title: Weather Alert
          large: true
          card:
            type: markdown
            content: >
              **Severity:** {{ state_attr('sensor.nws_alert_event','features')[0]['properties'].severity }}
              **Expires:** {{ as_timestamp(state_attr('sensor.nws_alert_event','features')[0].properties.expires)| timestamp_custom('%-I:%M %p on %-m/%-d/%Y') }}
              
              {{ state_attr('sensor.nws_alert_event','features')[0]['properties'].description }}
          deviceID:
            - XXXX

Any help much appreciated, thanks

1 Like