From 66b9e1ec0772820c77d286938524b739396fcea1 Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Wed, 19 May 2021 09:46:38 +0100 Subject: [PATCH] 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. --- zigbee2mqtt/z2m-hue-dimmer-switch-configurable.yaml | 2 +- zigbee2mqtt/z2m-hue-dimmer-switch-light.yaml | 2 +- zigbee2mqtt/z2m-ikea-onoff-switch.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/zigbee2mqtt/z2m-hue-dimmer-switch-configurable.yaml b/zigbee2mqtt/z2m-hue-dimmer-switch-configurable.yaml index b24cff7..fcd0c4f 100644 --- a/zigbee2mqtt/z2m-hue-dimmer-switch-configurable.yaml +++ b/zigbee2mqtt/z2m-hue-dimmer-switch-configurable.yaml @@ -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' }}" diff --git a/zigbee2mqtt/z2m-hue-dimmer-switch-light.yaml b/zigbee2mqtt/z2m-hue-dimmer-switch-light.yaml index 631ce78..b38a4c5 100644 --- a/zigbee2mqtt/z2m-hue-dimmer-switch-light.yaml +++ b/zigbee2mqtt/z2m-hue-dimmer-switch-light.yaml @@ -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' }}" diff --git a/zigbee2mqtt/z2m-ikea-onoff-switch.yaml b/zigbee2mqtt/z2m-ikea-onoff-switch.yaml index f207188..b25ea0b 100644 --- a/zigbee2mqtt/z2m-ikea-onoff-switch.yaml +++ b/zigbee2mqtt/z2m-ikea-onoff-switch.yaml @@ -46,7 +46,7 @@ trigger: attribute: action action: - variables: - command: "{{ trigger.to_state.state }}" + command: '{{ trigger.to_state.attributes.action }}' - choose: - conditions: - "{{ command == 'on' }}"