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

I was pretty much just pulling words out of a sack and putting them together when writing that partā€¦ but maybe something likeā€¦

automation:
  - alias: No midnight snacks
    trigger:
      platform: state
      entitiy_id: light.kitchen
      state: "on"
    condition:
      condition: time
      before: "06:00:00"
    action:
      service: browser_mod.navigate
      data:
        deviceID:
          - kitchen_screen
        navigation_path: /lovelace/weight_tracking/

Hmmm, that will take my browsers current tab (non-HA) and automatically change the view over to the HA one? I just want to make sure I am reading this correctly.

EDIT: It changes the view/path of that tab, but the browser will not just switch to that tab. Just tested this. Would be pretty neat if you could. This way if you were working in another tab and an event you were interested in took place, the tab would switch to the HA one and youā€™d get instant view of what you wanted to see.

1 Like

I tried with this:

          - type: entity-button
            name: Turn Off Lights
            tap_action: 
              action: call-service
              service: system_log.write
              service_data:
                message: "{{ deviceID }}"
            entity: light.lampara_escritorio

But is not workingā€¦

image

No. That only works from the backend where data_template is supported. So youā€™d have to put that service call in a script and trigger that from the frontend, using deviceID: this.

Wow! I finally understand heheheā€¦ Now It is working. Thanks @thomasloven !!:smiley:

@thomasloven
Unfortunately I for some reason canā€™t get this to work for pulling up the calling deviceID. The script starts to run the close_popup and the window closes but the popup for the new window never runs. If I were to add the data_template and deviceID: ā€œ{{ deviceID }}ā€ to the close_popup it also doesnā€™t run. Any idea what I might be able to try to get this to work? Soon as that variable from ā€œ-thisā€ to deviceID ā€œ{{ deviceID }}ā€ is included it doesnā€™t seem to work.

scripts.yaml
set_alarm_time_popup:
  alias: Set Alarm Time Popup
  sequence:
    - service: browser_mod.close_popup
    - service: browser_mod.popup
      data_template:
        deviceID: "{{ deviceID }}"
        title: Alarm Set
        style:
          . . . . . . . 
        card:
          . . . . . . .

lovelace.yaml
- type: entity-button
  entity: script.set_alarm_time_popup
  name: Change Alarm Time
  icon: mdi:sleep
  tap_action:
    action: call-service
    service: script.set_alarm_time_popup
    service_data:
      deviceID: 
        - this

Maybe start with something simpler, like a call to browser_mod.debug just to get the deviceID part to work first.

Also make sure you are actually using the latest version of browser_mod and that youā€™ve cleared your browser cache after updating.

I believe thatā€™s a known bug. What version of Home Assistant are you running?

Hi @thomasloven, tested now also with 0.100, still the same behaviour.

Br,
Johannes

Is there a way to ignore or disable devices? For example, I have HA installed on my kidsā€™ iPhones for presence detection and so they they can get in the house when no one else is home. I donā€™t really need any of the browser_mod functions for their phones.

I have installed the browser_mod and I do see device ID of my laptop, but I also have fully kiosk run on tablet and I cannot see itā€™s device ID.

My question: Do I need to do anything special to get the device ID from the tablet?

(I am running HADASHBOARD on the tablet)

Thx

Browser_mod only works while you are displaying the normal Home Assistant interface.
It might work if you display hadashboard in a panel iframe, but Iā€™m not sureā€¦

With Lovelace I do get the ID.

Any plan to support HaDashboard in the future? Is it possible? If not, do you have any suggestion / idea how to get information from the tablet, such as the motion notification etc?

Thx!

No, no* and https://www.ozerov.de/fully-kiosk-browser/.

*ok, maybe, but I wonā€™t try to do it

Hi,
Really appreciate you making this, thank you.

Working great :stuck_out_tongue:

Was working perfectly on two wall tablet I have Samsung / nvidia shield, fully kiosk

This morning though sensors are unavailable until I woke them up, REST commands are still running as Iā€™m in process of changing over and they are pulling the correct battery reading throughout the night, I need the battery to read all the time as this determines the charger on status.

Are there any tips to keep the tablet alive for browser mod ? I have checked all settings for sleeping and keep wirless alive, turn off Doze etcā€¦

Hi Thomas,

Iā€™m trying to get my head around everything here and apologies if this has been answered above. I have successfully set up my phone as a device and I can send TTS from my computer to my phone. My question is, can the RPI hosting HA act as a device? If it can, where can I obtain the deviceID for the RPI please?

Anything with a (fairly modern) web browser can act as a browser_mod device.
But what youā€™re looking for is probably mpd or soā€¦

Hi Thomas,

Sorry I should have said Iā€™m running Hassio, so no browser available.

Canā€™t see how mpd will act as a device without browsing, am I missing something?

Is it possible to disable logging/tracking of motion by adding motion: false to the config? I have a tablet kiosk that is in a very high traffic area and I donā€™t really need browser_mod to track the motion. I just use the FK app itself to turn off the screen.

Canā€™t you just ignore it?