Skip to content

Commit

Permalink
Update ZHA event data to what ZHA provides in HA 2024.03.01
Browse files Browse the repository at this point in the history
  • Loading branch information
ogajduse committed Mar 27, 2024
1 parent 9ee5920 commit cb601c8
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions blueprints/controllers/ikea_e1744/ikea_e1744.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ blueprint:
🚀 This blueprint is part of the **[Awesome HA Blueprints](https://epmatt.github.io/awesome-ha-blueprints) project**.
ℹ️ Version 2022.08.08
ℹ️ Version 2024.03.01
source_url: https://github.com/EPMatt/awesome-ha-blueprints/blob/main/blueprints/controllers/ikea_e1744/ikea_e1744.yaml
domain: automation
input:
Expand Down Expand Up @@ -164,12 +164,12 @@ variables:
click_double: ['1004']
click_triple: ['1005']
zha:
rotate_left: [move_1_195]
rotate_stop: [stop]
rotate_right: [move_0_195]
rotate_left: [move_MoveMode.Down_195_0_0]
rotate_stop: [stop_0_0]
rotate_right: [move_MoveMode.Up_195_0_0]
click_short: [toggle]
click_double: [step_0_1_0]
click_triple: [step_1_1_0]
click_double: [step_StepMode.Up_1_0_0_0]
click_triple: [step_StepMode.Down_1_0_0_0]
zigbee2mqtt:
rotate_left: [brightness_move_down]
rotate_stop: [brightness_stop]
Expand Down Expand Up @@ -239,8 +239,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("^\{\s*((\"a\":\s*\".*\"|\"t\":\s*\d+\.\d+)(,\s*)?){2}\s*\}$")) 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("^\{\s*((\"a\":\s*\".*\"|\"t\":\s*\d+\.\d+)(,\s*)?){2}\s*\}$")) else "" }}'
# update helper
- service: input_text.set_value
data:
Expand Down

0 comments on commit cb601c8

Please sign in to comment.