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

What’s interesting is that the sound events are never missed. My chime will always go off when my camera triggers, but the subsequent “touch” sound is like an “extra” that shouldn’t have been queued up. Definitely annoying since I’m considering the sound to mean “someone is outside” and if it happens when touching the tablet it defeats the purpose a bit

Agreed, same here - they’re always duplicates not delayed arrival.

I’m on mobile so can’t do it now but suggest we log as a bug here

Hey!
Is there anything I can do to prevent the pop up from taking up the entire screen of my phone? On the computer I get a smaller nicer pop up.

Referring to the ‘delayed’ or missing browser_mod.media_play, I just went through the same thing with my android tablet.
Thanks to all observations here, I got it working consistently enough for me now.
Just add a browser_mod.toast call of some text for 10ms before and after the browser_mod.media_play service call.
Good luck and happy holidays.

[update] Upon further testing, the work-around proposed is ‘voodoo’, still needs to click on any popup like more-info once to activate the playing of tts or media, until next app restart.

1 Like

So you’re using a toast call to sort of clear the queued/buffered media somehow?

Thanks for this idea. Trying it out and will report back if this solves the problem

No luck. Chime mp3 between toast calls and I still get the duplicated chime.

Guess that’s a different issue you have, mine was delayed/missing playback.

Just wondering if anyone else has had an issue calling a more-info dialogue from a script?

I have an action in my doorbell script to open a popup for the front door camera on a tablet we have in the living room, doesn’t seem to be working.

I have tried clearing the cache on the tablet with no luck, the strange thing is that if I call the pop up from the developer tools it works fine just won’t work from the script:

notify_porch:
  alias: 'NOTIFY: PORCH'
  sequence:
# close any open dialogs
  - service: browser_mod.close_popup
    data: {}
# send a photo to phone
  - data:
      data:
        photo:
          caption: Front Door
          url: http://192.168.0.90:8090/grab.jpg?oid=6&size=1920x1080
      message: Front Door
    service: notify.telegram_notify_s
# open dialog on living room tablet - not working
  - service: browser_mod.more_info
    entity_id: camera.porch_agent
    data:
      entity_id: camera.porch_agent
      deviceID:
      - browser_phone_console
      large: true
# take snapshots of all cameras
  - data: {}
    service: script.camera_snapshots
  - delay: '30'
# close all dialogs
  - service: browser_mod.close_popup
  mode: single
  icon: mdi:bell

The rest of the script works fine and the below works in the Developer Panel:

  - service: browser_mod.more_info
    entity_id: camera.porch_agent
    data:
      entity_id: camera.porch_agent
      deviceID:
      - browser_phone_console
      large: true

Does this have to be in a theme file with the precise name of “theme.yaml”? For example, the theme I’m using is in a file called ios-themes.yaml. Does this bit of yaml code need to be in my theme file (ios-themes.yaml) or do I need to make a file called theme.yaml? If it needs to be in my current theme file, do I need to indent it underneath the theme I’m using? I can’t seem to figure out how to make this work. Thanks!

Hello,

I’m using browser mod most of the times for popup cards but at some time my Spotify popup card doesn’t work anymore. I get a popup window but is is empty.
Can someone tell me whats wrong with the code?

aspect_ratio: 2/1
entity: media_player.spotify_dennis_bos
name: Spotify
tap_action:
  action: call-service
  service: browser_mod.popup
  service_data:
    card:
      cards:
        - entities:
            - entity: input_select.spotify_playlist
            - entity: input_select.spotify_speakers
          title: Spotify Test Card
          type: entities
        - aspect_ratio: 4/1
          entity: script.spotify
          icon: 'mdi:spotify'
          tap_action:
            action: call-service
            service: script.spotify
          type: 'custom:button-card'
        - card:
            artwork: full-cover
            entity: media_player.spotify_dennis_bos
            hide:
              controls: false
              power: false
              progress: false
              source: true
              volume: false
            info: scroll
            style: ''
            tap_action:
              action: more-info
            type: 'custom:mini-media-player'
          conditions:
            - entity: media_player.spotify_dennis_bos
              state_not: idle
          type: conditional
      type: 'custom:stack-in-card'
    deviceID:
      - this
      - dashboard
    title: Popup example
type: 'custom:button-card'

I want to play a notification sound on an Android tablet, running FKB, in case of an alarm.
Is there a way to stop the sound from the tablet? (other than muting the media volume on the tablet)

hy Thomas , thank for your component.
Is possible to set arbitrary the width of a POP_up ?
I try large: true but is not enougth.
I try CCS but seem dont work.

Thank for you eventualy reply.

On a pi desktop, yes i am a el cheapo, sound is a no go and a bitch to get rid of in logs.

Still a cool plug!

Hi, I would like to play a tts message based on the device (phone or tablet) from which I pressed the key. I would like to create code that controls which media player is active, and when I hit the button to activate the script, it plays the tts message on that device.
This is the script I created, but validating the code gives me an error:

'controllo_serramenti_google':
  alias: lo_stato_delle_finestre
  sequence:
  - service: tts.google_say
    entity_id: >
        {% if states.media_player.app_honor.state == 'idle' %}
        {% set dispositivo_attivo = "media_player.app_honor" %}
        {% elif states.media_player.tablet.state == 'idle' %}
        {% set dispositivo_attivo = "media_player.app_tablet" %}
        {% elif states.media_player.huaway_antonella.state == 'idle' %}
        {% set dispositivo_attivo = "media_player.huaway_antonella" %}
        {% else %} 
        {% set dispositivo_attivo = "media_player.salotto" %}
        {% dispositivo_attivo %}
        {% endif %}
    data:
      message: >-
         My message

This is in my configuration.yaml

browser_mod:
  devices:
    01625455-1a85xxxx:
      name: tablet
      camera: true
    a66ea53b-e455xxxx:
      name: app_honor
    e9fe1537_c43bxxxx:
      name: huaway_antonella

can you tell me what to correct?

Is it possible to Change an url in a Chromium Browser on an Raspberry pi when It runs in kiosk mode? With that?

I bet you are using a Fire Tablet?
This is the result of an outdated Webview component.
Android Webview supports queueMicrotask since v0.71. My Fire was running v0.70.

I did two things to solve the problem:

  • I updated Webview through Google Play Store. (I have manually installed Play Store on my Fire Tablet).
  • I updated Fire OS from v7.3.1.4 to the latest v7.3.1.6.

I now have Webview v0.75 and the problem is gone.

1 Like

Hi, its not related to Fire Tablets. I’m using Android (newest versions) and Windows chrome and have these Errors as well in a relative high frequency around 2000 per day

I did not say that it happens only with Fire tablets. But there must be some older browser in your network that is accessing your HA installation.
This is a browser JS error that is mirrored back into the HA log through browser_mod’s client-server communication. It clearly states that queueMicrotask is unknown to the browser. This is not possible with current Chrome browsers as they support that function.