hass-browser_mod icon indicating copy to clipboard operation
hass-browser_mod copied to clipboard

What is the browserID of my current device?

Open woobenjamin opened this issue 1 year ago • 2 comments

Hi all and thanks in advance for any advice:

I want to grab the browserID of my current computer. The idea is to use this as an input for figuring out what adjustments I need to make for a picture-elements panel card. I know there are probably other ways to deal with the picture-elements card, but I thought this might be the simplest.

Thanks.

ben

woobenjamin avatar Aug 25 '23 13:08 woobenjamin

Following code works for me

- service: media_player.play_media
  data:
    entity_id: |
      [[[
        return 'media_player.' + (window.browser_mod.browserID).replaceAll('-','_');
      ]]]
    media_content_id: https://stream.qmusic.nl/qmusic/aachigh
    media_content_type: url

benjamin-dcs avatar Nov 03 '23 06:11 benjamin-dcs

Hi all, I'm probably doing something wrong, but the above code doesn't seem to work here. I don't get any value out of window.browser_mod.browserID. I doublechecked it in a mushroom-template card to see what the string would be. But it remains empty. Any idea what I am overlooking?

For this issue/feature request, I vote for a seperate device: media_player.this_browser that is always pointing at the browser the dashboard is running on. This makes it much easier for users.

brjhaverkamp avatar Jan 27 '24 06:01 brjhaverkamp