This automation using Z2M for PTM215Z (EnOcean, RunLessWire Click for Philips Hue) works great in HAOS 2025.11 but stops working in 2025.12.
What was changed in the latest home assistant update that might have broken this automation? What changes are needed to the template?
blueprint:
name: Enocean PTM 215Z - Toggle + Dimming (with Combo)
author: Nick
description: >
Blueprint for EnOcean PTM 215Z switch that controls lights with a switch. Single or dual rocker
- Single click toggles the light on/off
- Hold dims brightness up or down until release
- Combo (1+3 / 2+4) controls both lights together (toggle or dim)
homeassistant:
min_version: 2024.6.0
domain: automation
input:
controller_MQTT:
name: Controller and MQTT information
input:
base_topic:
name: (Zigbee2MQTT) Base mqtt topic
default: zigbee2mqtt
controller:
name: Switch
selector:
device:
integration: mqtt
manufacturer: EnOcean
target_left:
name: Entity for left buttons
input:
left_target_light:
name: (Zigbee2MQTT) target name (for light)
selector:
device:
integration: mqtt
target_right:
name: Entity for right buttons
input:
right_target_light:
name: (Zigbee2MQTT) target name (for light)
selector:
device:
integration: mqtt
others:
name: Other variables
input:
hold_delay:
name: Hold delay
description: "Milliseconds after which a press is considered a hold"
default: 400
selector:
number:
min: 100
max: 1000
unit_of_measurement: milliseconds
dim_speed:
name: Dimming Speed
description: "Speed for dimming when holding button"
default: 60
selector:
number:
min: 1
max: 500
step: 1
triggers:
# Single button presses
- trigger: mqtt
topic: "{{ base_topic ~ '/' ~ device_name(controller) ~ '/action'}}"
payload: press_1
- trigger: mqtt
topic: "{{ base_topic ~ '/' ~ device_name(controller) ~ '/action'}}"
payload: press_2
- trigger: mqtt
topic: "{{ base_topic ~ '/' ~ device_name(controller) ~ '/action'}}"
payload: press_3
- trigger: mqtt
topic: "{{ base_topic ~ '/' ~ device_name(controller) ~ '/action'}}"
payload: press_4
# Combo presses (controls both lights)
- trigger: mqtt
topic: "{{ base_topic ~ '/' ~ device_name(controller) ~ '/action'}}"
payload: press_1_and_3
- trigger: mqtt
topic: "{{ base_topic ~ '/' ~ device_name(controller) ~ '/action'}}"
payload: press_2_and_4
conditions: []
actions:
- variables:
# The payload received (e.g., press_1, press_1_and_3)
btn: "{{ trigger.payload }}"
# Detect if this is a combo press (contains '_and_')
is_combo: "{{ '_and_' in btn }}"
# Compute the release payload to wait for
release: "{{ 'release_' ~ btn.split('press_')[1] }}"
# Single button number (1-4); 0 if combo (we handle combos differently)
button: >-
{% if not is_combo %}
{{ btn.split('_')[1] | int }}
{% else %}
0
{% endif %}
# Direction multiplier for dimming:
# Single: +1 or -1 depending on which side
# Combo: +1 for 1_and_3 (dim up), -1 for 2_and_4 (dim down)
invert: >-
{% if is_combo %}
{% if '1_and_3' in btn %} 1 {% else %} -1 {% endif %}
{% else %}
{{ 2*(button % 2) -1 }}
{% endif %}
# Determine which lights to control
# Single press: left or right light
# Combo press: both lights
targets: >-
{% if is_combo %}
[ "{{ device_name(left_target_light) }}", "{{ device_name(right_target_light) }}" ]
{% elif button in [1,2] %}
[ "{{ device_name(left_target_light) }}" ]
{% else %}
[ "{{ device_name(right_target_light) }}" ]
{% endif %}
# State to send on a short press toggle
on_off: >-
{% if is_combo %}
{% if '1_and_3' in btn %} on {% else %} off {% endif %}
{% else %}
{% if invert == 1 %} on {% else %} off {% endif %}
{% endif %}
# Wait to see if the button is held or released quickly
- wait_for_trigger:
- trigger: mqtt
topic: "{{ base_topic ~ '/' ~ device_name(controller) ~ '/action'}}"
payload: "{{ release }}"
timeout:
milliseconds: "{{ hold_delay }}"
continue_on_timeout: true
# Take action based on whether it was a hold or short press
- choose:
- conditions:
- condition: template
value_template: "{{ wait.trigger is none }}"
sequence:
- repeat:
for_each: "{{ targets }}"
sequence:
# Start dimming (up or down depending on invert)
- action: mqtt.publish
data:
topic: "{{ base_topic ~ '/' ~ repeat.item ~ '/set'}}"
payload: "{\"brightness_move_onoff\": {{ dim_speed * invert }} }"
# Wait for release to stop dimming
- wait_for_trigger:
- trigger: mqtt
topic: "{{ base_topic ~ '/' ~ device_name(controller) ~ '/action'}}"
payload: "{{ release }}"
timeout:
seconds: 5
- repeat:
for_each: "{{ targets }}"
sequence:
# Stop dimming when released
- action: mqtt.publish
data:
topic: "{{ base_topic ~ '/' ~ repeat.item ~ '/set'}}"
payload: "{\"brightness_move\": \"stop\"}"
default:
- repeat:
for_each: "{{ targets }}"
sequence:
- action: mqtt.publish
data:
topic: "{{ base_topic ~ '/' ~ repeat.item ~ '/set'}}"
payload: "{\"state\": \"{{ on_off }}\"}"
mode: single
trigger_variables:
base_topic: !input base_topic
controller: !input controller
variables:
left_target_light: !input left_target_light
right_target_light: !input right_target_light
hold_delay: !input hold_delay
dim_speed: !input dim_speed