To make this blueprint work on my HA 2022.12 setup, I had to change some code:
- Mode “parallel” instead of “restart”
- Delete the leading dash at line “platform:state”
- Delete the line “attribute: action”
- Additions to line “command:”
My source of inspiration was the blueprint Aqara Buttons All-In-One [Zigbee2MQTT] .
...
mode: parallel
max_exceeded: silent
trigger:
platform: state
entity_id: !input 'switch'
action:
- variables:
command: '{{ trigger.to_state.attributes.action if trigger.to_state.state == ""
else trigger.to_state.state }}'
...