You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have just re-paired all my zigbee devices via Z2M using a sonoff controller as they failed recently.
However, now that it almost all works, the double press doesn't.
I've been able to trace this back to a mismatch in the regex used in the calculation of the trigger_delta and the value stored in the last_action helper fields.
^\{((\"a\": \".*\"|\"t\": \d+\.\d+)(, )?){2}\}$
while the helper field doesn' t contain whitespace: {"a":"off_press_release","t":1699726460.746302}
A matching regex (for me) is as follows: ^\{((\"a\": \".*\"|\"t\":\d+\.\d+)(,)?){2}\}$
This regex removes the whitespace after the semicolon in the t part as well as after the separating comma in the center.
Automation YAML config
For use in Home Assistant's Developer tools:
{%set helper_last_controller_event = 'input_text.last_hue_dimmer_switch_action' %}{{states(helper_last_controller_event) | regex_match("^\{((\"a\": \".*\"|\"t\": \d+\.\d+)(, )?){2}\}$")}}{{states(helper_last_controller_event) | regex_match("^\{((\"a\":\".*\"|\"t\":\d+\.\d+)(,)?){2}\}$")}}
Blueprint name
EPMatt/awesome-ha-blueprints/blob/main/blueprints/controllers/philips_929002398602/philips_929002398602.yaml#L389
Home Assistant Core Version
2023.11.2
Home Assistant Installation Type
Home Assistant Operating System
Description
Hi there,
I have just re-paired all my zigbee devices via Z2M using a sonoff controller as they failed recently.
However, now that it almost all works, the double press doesn't.
I've been able to trace this back to a mismatch in the regex used in the calculation of the
trigger_delta
and the value stored in thelast_action
helper fields.The regex currently is as follows: Line 389
^\{((\"a\": \".*\"|\"t\": \d+\.\d+)(, )?){2}\}$
while the helper field doesn' t contain whitespace:
{"a":"off_press_release","t":1699726460.746302}
A matching regex (for me) is as follows:
^\{((\"a\": \".*\"|\"t\":\d+\.\d+)(,)?){2}\}$
This regex removes the whitespace after the semicolon in the
t
part as well as after the separating comma in the center.Automation YAML config
To Reproduce
For use in Home Assistant's Developer tools:
Expected behavior
The hue switch to emulate a double press event.
Actual Behaviour
Not triggering the double press path due to a mismatching Regex.
Additional Details
Screenshots
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: