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

It seems for me it was related to WiFi issues.
My tablet uses a 2,4 Ghz connection, and my router was using a busy channel.
After changing the channel my connection is now way more stable.

I have removed this component, deleted the entry from configuration.yaml and restarted but getting these errors in my log, any idea how to stop them ?

Received invalid command: browser_mod/connect

Received invalid command: browser_mod/update

I think my problem must lie with the tablet itself because even after it is ā€˜unavailableā€™ to HA the REST sensor still works so it is definitely on the network.

As does ping although the first one seems to take a long time to respond

Reply from 192.168.1.223: bytes=32 time=1693ms TTL=64
Reply from 192.168.1.223: bytes=32 time=2ms TTL=64
Reply from 192.168.1.223: bytes=32 time=11ms TTL=64
Reply from 192.168.1.223: bytes=32 time=7ms TTL=64

Clear the cache in all your browsers https://github.com/thomasloven/hass-config/wiki/Lovelace-Plugins#clearing-cache

@thomasloven

- service: browser_mod.command
  data_template:
    command: popup
    deviceID: ["{{ ','.join(deviceID) }}"]

Wondering if you had any additional thoughts on why this isnā€™t working for me?

The only thing I can see immediately is that the popup command wonā€™t work if you donā€™t also specify card and title, but Iā€™m assuming you already have that and are just not showing it.

Thatā€™s correct I am not showing it because I have a lengthy style section however the close-popup part of it doesnā€™t have a title or card section would that matter?

Then I donā€™t know what the problem could be.

Iā€™m working on an update that should make this kind of thing easier, though.

The following (or something very similar) should work from version 12 (NOT RELEASED YET)

scripts.yaml

test_popup:
  sequence:
    - service: browser_mod.popup
      data_template:
        close_first: true
        deviceID: "{{ deviceID }}"
        card:
          type: entities
          entities:
            - light.bed_light

ui-lovelace.yaml

- type: entity-button
    entity: sun.sun
    tap_action:
      action: call-service
      service: script.test_popup
      service_data:
        deviceID: this

Looking forward to the new release and hoping it works.

That did it, thanks

Iā€™m not sure how to convert old popup_card into this browser_mod.

This is my old lovelace part:



- id: Trash
    title: Raccolta rifiuti
    icon: mdi:recycle
    popup_cards:
      sensor.giorno_raccolta_carta:
        title: Impostazioni - Raccolta carta
        large: true
        card:
          type: horizontal-stack
          cards:
            - type: entities
              entities:
                - input_boolean.raccolta_carta_lunedi
                - input_boolean.raccolta_carta_martedi
                - input_boolean.raccolta_carta_mercoledi
                - input_boolean.raccolta_carta_giovedi
            - type: entities
              entities:
                - input_boolean.raccolta_carta_venerdi
                - input_boolean.raccolta_carta_sabato
                - input_boolean.raccolta_carta_domenica
                - input_select.raccolta_carta_settimana
      # then the card where actually popup is called:
   cards:
      - type: entities
        title: Raccolta carta
        show_header_toggle: false
        entities:
          - sensor.giorno_raccolta_carta

Anyone can help me understand how to convert my code? Thanks

Itā€™ll be easier with version 12. Have patience. Iā€™m almost done.

2 Likes

Ok iā€™ll wait :slight_smile:

Hello,
First of all thanks for your custom component.

Iā€™ve tried to set up my camera with the latest version of browser_mod, but I cannot get it to work. I have a tablet under FullyKiosk (pro) and it appears fine in my sensors (I can control the screen and so on). I added the camera: true in my config restarted HA and clearer the cache of Fully Kiosk on my tablet but when the page reload I do not have a pop up to ask me to give permission to access the camera as your documentation said I should.
Iā€™m happy to test different things if I can help on this. I canā€™t see anything special in the logs. It says only as an info: Setting up camera.browser_mod.

Version 12 has been released!

There are a few simplifications to make service calls easier.
Thereā€™s also a new release of card-mod which will let you specify the tap_action of entities card rows.
Together, I believe this is a fully mature replacement for popup-card.

Oh. And you can now open popups from popups, or while popups are already open, or when youā€™re not actually viewing a lovelace page.

See the cookbook linked from the readme for examples.

3 Likes

Hello, thank you for your work, your cards are very useful for me.

I was wondering if there is a way to put the device_id in a sensor, in such a way that, for example, accessing with the cell phone, the sensor shows the deviceId of the cell phone and accesing with the laptop, the same sensor shows the deviceId of the latop.

Summarizing, I would like a sensor to shows the deviceId currentyly using, in order to use this sensor for other automations/scripts.
Could it be possible?

Thank you very much for your time.

That canā€™t be done with a sensor, becuase sensors are running in the backend. What would its value be e.g. if you had the interface open on both your computer and your phone at the same time?

If you just want to find the entityID of a device, you can either run the debug command, or use the browser-player card.
If you want to run a script that does different things depending on which device it was activated from (via a button in lovelace, for example), see the example in the cookbook linked from the readme.

This is the first time using the card, iā€™m not quite understand how to use it.

This the config that i made in configuration.yaml

browser_mod:

This is the config in lovelace:

              - type: horizontal-stack
                cards:
                  - type: 'custom:button-card'  
                    color: auto
                    size: 30%
                    icon: mdi:bulb
                    aspect_ratio: 1/1
                    show_state: true
                    name: test1
                    show_label: true
                    tap_action:
                      action: call-service
                      service: browser_mod.popup
                      service_data:
                        title: Popup example
                        card:
                          type: entities
                          entities:
                            - light.corner_living_room_lights
                            - light.corner_living_room_lights
                            - light.ceiling_fan
                        deviceID:
                          - this
                          - dashboard

When i click on the button from the computer itā€™s open correctly the pop up, please see pic below:


When i trying to open from my cellphone, this itā€™s open on the entire page and not as small pop up window. see pic below:

Any idea what i need to do?

thanks !

Thatā€™sā€¦ how it worksā€¦

1 Like

would it be possible for the people installing your custom cards by hand, to add a version number of sorts? Iā€™ve been over the complete GitHub repo and cant find itā€¦or am I missing it in the release listing https://github.com/thomasloven/lovelace-card-mod/releases. I know this is the 6th release, but need the version number for the line:

# https://github.com/thomasloven/lovelace-card-mod
- url: /local/lovelace/resources/card-mod.js?v=6
  type: js

or would that suffice?