From f0d2f23a5f60908d98d4055ee6409416ed1d568d Mon Sep 17 00:00:00 2001 From: Martin Balsvik Date: Mon, 13 Nov 2023 23:52:54 +0100 Subject: [PATCH] Update ikea_e1743.yaml Changes the trigger_delta and last_controller event code as per Rufu's suggestion: https://community.home-assistant.io/t/zha-deconz-zigbee2mqtt-ikea-e1743-on-off-switch-dimmer-universal-blueprint-all-actions-double-click-events-control-lights-media-players-and-more-with-hooks/277861/137 I've tried it locally, works perfect. --- blueprints/controllers/ikea_e1743/ikea_e1743.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blueprints/controllers/ikea_e1743/ikea_e1743.yaml b/blueprints/controllers/ikea_e1743/ikea_e1743.yaml index e631bd94..69b57093 100644 --- a/blueprints/controllers/ikea_e1743/ikea_e1743.yaml +++ b/blueprints/controllers/ikea_e1743/ikea_e1743.yaml @@ -277,8 +277,8 @@ action: {%- elif integration_id == "zha" -%} {{ trigger.event.data.command }}{{"_" if trigger.event.data.args|length > 0}}{{ trigger.event.data.args|join("_") }} {%- endif -%} - trigger_delta: '{{ (as_timestamp(now()) - ((states(helper_last_controller_event) | from_json).t if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{((\"a\": \".*\"|\"t\": \d+\.\d+)(, )?){2}\}$")) else as_timestamp("1970-01-01 00:00:00"))) * 1000 }}' - last_controller_event: '{{ (states(helper_last_controller_event) | from_json).a if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{((\"a\": \".*\"|\"t\": \d+\.\d+)(, )?){2}\}$")) else "" }}' + trigger_delta: '{{ (as_timestamp(now()) - ((states(helper_last_controller_event) | from_json).t if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{((\"a\":\".*\"|\"t\":\d+\.\d+)(,)?){2}\}$")) else as_timestamp("1970-01-01 00:00:00"))) * 1000 }}' + last_controller_event: '{{ (states(helper_last_controller_event) | from_json).a if helper_last_controller_event is not none and (states(helper_last_controller_event) | regex_match("^\{((\"a\":\".*\"|\"t\":\d+\.\d+)(,)?){2}\}$")) else "" }}' # update helper - service: input_text.set_value data: