ZHA's strange automation behavior

in the ZHA integration I have added 1Button Tuya Scene Switch (TS0041) and LIDL (Livarno) LED Lamp (TS0502A)

for the switch I added zha quirk

zigbee info shows for the switch:

IEEE: a4:c1:38:79:c8:f8:20:81
Nwk: 0xd116
Device Type: EndDevice
LQI: 255
RSSI: -71
Last seen: 2024-01-24T10:41:53
Power source: Battery or Unknown
Quirk: ts0041.TuyaSmartRemote0041TOPlusA

And for the lamp:

IEEE: cc:86:ec:ff:fe:5b:8a:ec
Nwk: 0xa04f
Device Type: Router
LQI: 255
RSSI: -76
Last seen: 2024-01-24T11:54:17
Power source: Mains
Quirk: zhaquirks.lidl.cct.CCTLight

I made an automation based on such blueprint: ZHA - Tuya 4-button Scene Switch (TS0044) - #62 by Netpoet (with the difference that I deleted the 2nd, 3rd and 4th button).
For a single press I added light.toggle and pointed 2 lamps

and now to the core of the problem…
when I manually run the action on single press in the automation, it turns on/off both lamps correctly.
When I press the button, only one (right) lamp turns on, pressing again does nothing. When I turn on both lamps, pressing the button turns off one (right) lamp and pressing again gives nothing.
Event listener shows that the button has been pressed.
Additional observation: when I use the button to turn on a lamp, this change is not visible in HA - the lamp lights up, but in HA it shows as off.

Please help fix this.

Translated with DeepL Translate: The world's most accurate translator (free version)

Why do you think this is a problem with ZHA and not with the automation?

because, as I wrote, when I run the action, it works correctly


When you run an automation like that, it only runs the action section - trigger and conditions are ignored (which is where problems often are…). I believe the same is true for blueprints. Have you looked at the trace?

If the problem was with the trigger or conditions, no lamp would turn on.