Use attributes.action for command

Changes in Zigbee2MQTT 1.18.3 and HomeAssistant 2021.05.04 mean that the state value can be blank on trigger. As we trigger from the attribute action anyway, use that as the command value.
This commit is contained in:
2021-05-19 09:46:38 +01:00
parent 0ed7d094a5
commit 66b9e1ec07
3 changed files with 3 additions and 3 deletions

View File

@@ -69,7 +69,7 @@ trigger:
attribute: action
action:
- variables:
command: "{{ trigger.to_state.state }}"
command: '{{ trigger.to_state.attributes.action }}'
- choose:
- conditions:
- "{{ command == 'on-press' }}"

View File

@@ -49,7 +49,7 @@ trigger:
attribute: action
action:
- variables:
command: "{{ trigger.to_state.state }}"
command: '{{ trigger.to_state.attributes.action }}'
- choose:
- conditions:
- "{{ command == 'on-press' }}"

View File

@@ -46,7 +46,7 @@ trigger:
attribute: action
action:
- variables:
command: "{{ trigger.to_state.state }}"
command: '{{ trigger.to_state.attributes.action }}'
- choose:
- conditions:
- "{{ command == 'on' }}"