Hi there,
great work here! I am trying to play a sound to the current browser when hitting a button in floorplan. This code works for a static device name:
However, I want to play it not on a specific device, but on the current (this) device like this:
entity_id: media_player."{{deviceID}}"
or
entity_id: media_player."{{this}}"
Tried both, didnāt work. So, how could I get the current device id in this setup? Thanks!
Btw.: I would opt for a feature that avoids regenerating device IDs for the same browser of the same MAC device as turning on and off a device makes the naming option useless. Thanks.
In my setup I have a camera (or more) assigned to each room and tab for each room in HA. I am using stream to relay the live camera image and I have successfully got audio to cast to icecast 2 and then through to various deviceIDs using your wonderful browser_mod. Now I want to extend it to other IP cameras, so I have a separate icecast stream for each IP camera. However, If I start the audio stream and I then change tabs the audio continues to play. Is there a way of stopping the stream when thereās a tab change?
Hey Thomas,
thanks for your answer and I followed the example. Unfortunately, I still get on all connected devices a sound. Here is my implementation for the floorplan.yaml (think not interesting here):
- name: Show Life Support 2
entities:
- input_boolean.lifesupport
action:
domain: script
service: play_sound
And here is my scripts.yaml file:
play_sound:
sequence:
- data_template:
service: media_player.play_media
deviceID:
- this
media_content_id: http://192.168.178.2:8123/local/sounds/213.ogg
media_content_type: music
So, it should play only on the device that is triggering the state change, right? But, the sound plays on all devices. Thanks again for your help!
I think you misunderstand how this works.
The whole point of it existing is that the backend (i.e. the computer you run HA on, and where the script runs) canāt know from which device you clicked the thing to make the sound play.
The only thing that can know that is your browser. So browser_mod makes your browser replace deviceID: this with itās own device ID whenever it sees it.
Therefore, deviceID: this belongs in the frontend configuration (ui-lovelace.yaml) - where you configure what your browser displays and does.
Look at the example again, and youāll see itās a bit different from yours.
Ahh, I believe I understand you now. So, āthisā does not tell me from where a request was coming, but gives me information about the device on which it is applied right now. Then, it totally makes sense that the sound is played everywhere. Uhh, this makes the whole thing a bit trickyā¦ maybe I would need a different user per device and would need to send the current user to the play script and play it only for devices with the same user. Sounds a bit overkill, but maybe the only solution.
Hi
I have the same problem as @bishop? Did you solved it?
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.
Hello,
I havenāt spent much time looking into it so itās still not working for me. Iāll try with the built in functionality as advised when I have some time.
I have still problems with Fully Kiosk and use it as a media player. When I keep the agent to default the stream I send to it will stop after 30 seconds. When I change the agent to chrome or internet explorer (fake agent) then media player is working correct. But then when selecting tabs of HA it takes so long before they appearā¦ Moving back then its working again, but then the 30 seconds media player problem is back
Iām using this card for popups. The popup works fine, but on mobile when I press back button to close the popup it goes to the previous page instead of closing the popup. Home assistant Builtin popups work great, maybe this is something possible to fix?
Hi
Is it posible to get deviceID: āthisā to work in NodeRed.
I am trying to do some actionable notifications where the service should navigate to a lovelace tab on the device that are using the notification.
The feature works by replacing deviceID: this with deviceID: 12345678-90abcdef in anyservice call made from the frontend.
I donāt know what youāre trying to do or how NR works, but I assume NR is somehow listening for a service call, and in that case it should see deviceID: 12345678-90abcdef.
How do I delete device_id's that are no longer available if the browser_mod entities arenāt stored to core.entity_registry? I donāt have any entries in my SQL database after running the below sql either but the unavailable browser_mod entities continue to appear in the states developer tools.
SELECT * FROM states WHERE entity_id LIKE 'browser%';