An update to Browser_Mod made it so that in order to get a toast or popup on the current screen, you’d do something like this:
hold_action:
action: fire-dom-event
browser_mod:
command: popup
title: Set Favorite Sleep Numbers
card:
type: entities
entities:
- entity: input_number.sleepnumber_joe_favorite
name: Joe's Favorite
- entity: input_number.sleepnumber_dale_favorite
name: Dale's Favorite
Problem is that I have most things done via scripts, and calling the browser_mod.toast service only toasts on one device… and not necessarily the one I want. (See setup below)
service: browser_mod.toast
data:
message: Hello World
duration: 10000
How can I get a toast notification to show up on either:
- ALL dashboards on ALL devices from within a script?
- The last interacted with dashboard (i.e. the user taps the scene button on the downstairs tablet, so the script shows it there)
My full script code which doesn’t work is:
set_scene_bedroom:
alias: Set Scene Bedroom
fields:
scene_name:
description: The scene name without scene. or a room
example: bedroom_evening
sequence:
- choose:
- conditions:
- condition: template
value_template: "{{ scene_name == 'no_scene' }}"
sequence:
- service: light.turn_off
target:
entity_id: light.all_bedroom_lights
data:
transition: '{{ states("sensor.bedroom_light_fade_speed_seconds") }}'
- conditions:
- condition: template
value_template: "{{ scene_name != 'no_scene' }}"
sequence:
- service: scene.turn_on
target:
entity_id: scene.{{ scene_name }}
data:
transition: '{{ states("sensor.bedroom_light_fade_speed_seconds") }}'
- choose:
- conditions:
- condition: template
value_template:
"{{ states.sensor.bedroom_light_fade_speed_seconds.state|float
> 5.0 }}"
sequence:
- service: input_select.select_option
data:
entity_id: input_select.bedroom_light_fade_speed
option: Fast
- service: browser_mod.toast
data:
message: Scene {% set sceneEntity = "scene." ~ scene_name %}{% if state_attr(sceneEntity, "friendly_name")|string == "None" %}transition{% else %}{{ state_attr(sceneEntity, "friendly_name") }}{% endif %} complete.
duration: 20000
deviceId: this
mode: single