Attempt fix to ignore constant null action traffic for H2 EU dimmer

This commit is contained in:
mg committed 2026-09-27 21:45:06 +01:00
1 parent 87c2f61dad
commit 746a048251
1 file changed
+11 -1
+11 -1
View File
@@ -111,6 +111,14 @@ max: 15
trigger: trigger:
- platform: mqtt - platform: mqtt
topic: !input mqtt_topic topic: !input mqtt_topic
payload: "action"
value_template: >
{{ 'action'
if value_json is defined
and value_json.action is defined
and value_json.action is not none
and (value_json.action | string | length > 0)
else 'ignore' }}
action: action:
- variables: - variables:
@@ -121,6 +129,8 @@ action:
# Time since the previous MQTT event triggered this automation. # Time since the previous MQTT event triggered this automation.
# Genuine stop_rotating events immediately follow rotation events. # Genuine stop_rotating events immediately follow rotation events.
# The H2 bug emits a stray stop_rotating after the device has been idle. # The H2 bug emits a stray stop_rotating after the device has been idle.
# Null/missing action packets are filtered at the MQTT trigger above,
# so only genuine action events affect this timer.
idle_seconds: > idle_seconds: >
{{ as_timestamp(now()) - {{ as_timestamp(now()) -
as_timestamp( as_timestamp(
@@ -210,4 +220,4 @@ action:
target: !input target_light target: !input target_light
data: data:
brightness_step_pct: "{{ scaled_step }}" brightness_step_pct: "{{ scaled_step }}"
transition: !input dim_transition transition: !input dim_transition