My Home Assistant version: 2024.3.0
3rd party integration browser_mod.
I am trying to use the fire-dom-event
to navigate to a URL via a script, but the browser_id
isn’t getting passed to the script. I followed the instructions from the services page of browser_mod.
I have a custom button-card to call the script and the code is:
type: custom:button-card
styles:
card:
- height: 65px
- background-color: rgb(17,17,17)
entity: switch.bedroom_addressable_led_relay_switch
icon: mdi:lightbulb-outline
color: rgb(253,216,53)
show_name: false
tap_action:
action: fire-dom-event
browser_mod:
service: script.wled_decide_which_light_dashboard_to_show_on_or_off
data:
browser_id: THIS
I expect the browser_id
to be sent to the script, here’s the script:
alias: WLED Decide which Light Dashboard to Show - On or Off
sequence:
- choose:
- conditions:
- condition: device
type: is_off
device_id: 7bd6f7615b2147ae72dbea54a9fb19d2
entity_id: c4edd6415a85bc3ed222bfe7853dc8bd
domain: switch
sequence:
- service: browser_mod.navigate
data:
path: /lovelace-test1/lighting
browser_id: {{browser_id}}
- stop: Dashboard has been changed to off
- service: browser_mod.navigate
data:
path: /lovelace-test1/lighting-on
browser_id: {{browser_id}}
mode: single
However, when I save the script Home Assistant changes it to this:
alias: WLED Decide which Light Dashboard to Show - On or Off
sequence:
- choose:
- conditions:
- condition: device
type: is_off
device_id: 7bd6f7615b2147ae72dbea54a9fb19d2
entity_id: c4edd6415a85bc3ed222bfe7853dc8bd
domain: switch
sequence:
- service: browser_mod.navigate
data:
path: /lovelace-test1/lighting
browser_id:
"[object Object]": null
- stop: Dashboard has been changed to off
- service: browser_mod.navigate
data:
path: /lovelace-test1/lighting-on
browser_id:
"[object Object]": null
mode: single
And when I press the custom button to call the script nothing happens, the trace is as follows:
Result:
params:
domain: browser_mod
service: navigate
service_data:
path: /lovelace-test1/lighting
browser_id:
'[object Object]': null
target: {}
running_script: false
Thanks in advance!