-
Notifications
You must be signed in to change notification settings - Fork 208
Action vs Service for popup actions ( 2.3.6)
Prior to v2.3.6, popup action needed to be defined using the service: property. Since v2.3.6, the newer action: property is also supported. This also allows for use of action fields in scripts/blueprints.
All styles below are valid since Version 2.3.6.
action: browser_mod.popup
data:
content: Popup Content
right_button: Toggle Light
right_button_action:
action: light.toggle
target:
entity_id: light.bed_lightaction: browser_mod.popup
data:
content: Popup Content
right_button: Wakeup
right_button_action:
- action: light.turn_off
target:
entity_id: light.bed_light
- action: cover.open_cover
target:
entity_id: cover.kitchen_coveraction: browser_mod.popup
data:
content: Popup Content
right_button: Toggle Light
right_button_action:
service: light.toggle
data:
entity_id: light.bed_lightIt is possible to allow for fields in scripts/blueprints to use the action: selector and then pass directly to any action parameter. NOTE: Only action: actions are supported by Browser Mod at this time, whereas the action: selector may return other automation building blocks. Use at your own risk checking for any action call errors in the local browser console while testing your installation. See below for a simple example.
alias: Example Browser Mod using Action field
description: ""
fields:
action:
selector:
action: {}
name: Action
required: true
sequence:
- action: browser_mod.popup
data:
content: Popup Content
right_button: Call Action
right_button_action: "{{ action }}"Yaml after testing up script in developer tools, using the action selector. You will note the actions are returned as a list which is supported.
action: script.example_browser_mod_using_action_field
data:
action:
- action: light.turn_off
metadata: {}
data: {}
target:
entity_id: light.bed_light
- action: cover.open_cover
metadata: {}
data: {}
target:
entity_id: cover.kitchen_cover