zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

Light entities seems to turn off, but in reality they stay on....

Open pauloon opened this issue 2 years ago β€’ 22 comments

What happened?

It's happening very frequently with my home system that you turn off some lights, either by doing it manually on a dashboard, or via a Node-Red automation, and everything shows as the command was accepted, the entity indicates it's off, the device on Z2M shows as off, but the light itself stays on.

This is happening randomly to many of my lights. I repair then and it seems to fix the issue, but after a while it starts again.

In the print below you can se the presence sensor detected the room was empty, and this sends a command to turn off the group with all the lights in this room:

image

The light shows up as off:

image

The Z2M shows the device as off:

image

And when you check the light, it is still on:

image

Then, if I resend the command to turn off the group lights, or only this light specifically, it works correctly (it turns off).

Can you, please, check?

What did you expect to happen?

The light should turn off correctly as per command.

How to reproduce it (minimal and precise)

I'm not able to reproduce it exactly. It looks random and it has happened to most of my lights, either the simple "switch" normal ones (that I convert to light using a helper), or the dimmable ones (that already show up as a light entity).

Zigbee2MQTT version

1.40.2-dev commit: c09aeec

Adapter firmware version

20240710

Adapter

SONOFF Zigbee 3.0 USB Dongle Plus-P

Setup

I use HAOS installed in a Intel NUC, and the Z2M standard add-on. Recently I was testing the EDGE to see if there was any solution.

Debug log

log.log log1.log log2.log

pauloon avatar Oct 25 '24 22:10 pauloon

Hi @Koenkk ... did you ever see this behaviour? Yesterday it happened again, to another light (dimmable switch). Thanks!

pauloon avatar Oct 29 '24 13:10 pauloon

All of these devices have optimistic mode active. I'm not sure if there is a bug or a problem with that...

pauloon avatar Oct 29 '24 13:10 pauloon

I'm seeing something similar, where after no motion is detected the lights do turn off, but home assistant and z2m keep showing that they are on. After motion is detected again, the light wont turn on since HA already thinks it is on.

Started happening after the latest z2m update, mostly with TS110E dimmers (_TZ3210_3mpwqzuu)

Duncank avatar Nov 02 '24 23:11 Duncank

I'm seeing something similar, where after no motion is detected the lights do turn off, but home assistant and z2m keep showing that they are on. After motion is detected again, the light wont turn on since HA already thinks it is on.

Started happening after the latest z2m update, mostly with TS110E dimmers (_TZ3210_3mpwqzuu)

Interesting. That happened to me too, but I didn't give much importance since 90% of times is the situation I described. Lights are commanded to be turned off, the entity shows it as off, but the light is actually still on. In my case here is happening to all kinds of light switches, normal and dimmable ones.

pauloon avatar Nov 03 '24 00:11 pauloon

I've reverted to 1.40.2-1 last night and so far this problem hasn't reappeared.

Duncank avatar Nov 05 '24 15:11 Duncank

This is happening for me as well, with both ZHA and z2m, on two different TS110E (_TZ3210_3mpwqzuu) devices.

I haven't been able to do much fault isolation yet, besides switching them from ZHA to z2m. I'm on z2m 1.41.0.

aaronbeekay avatar Nov 20 '24 02:11 aaronbeekay

This is happening for me as well, with both ZHA and z2m, on two different TS110E (_TZ3210_3mpwqzuu) devices.

I haven't been able to do much fault isolation yet, besides switching them from ZHA to z2m. I'm on z2m 1.41.0.

For me here it did not happen anymore. I'm not sure which updated seems to have "fixed" that.

pauloon avatar Nov 20 '24 14:11 pauloon

Now with the 2.0 update, this same problem started happening again. Anyone else here?

pauloon avatar Jan 22 '25 14:01 pauloon

I tried the upgrade again from 1.40.2-1 to the latest version 2.0, and this indeed is still not working correctly.

Using a simple light.turn_on action with a brightness or brightness_pct, the light does appear to turn on and go to the correct brightness in both home assistant and zigbee2mqtt, but the physical light itselfs just stays off.

Adapter: Sonoff Model: TS110E_2gang_2 Zigbee Model: TS110E Zigbee Manufacturer: _TZ3210_3mpwqzuu

State before:

{
    "brightness": 25,
    "brightness_l1": 152,
    "brightness_l2": 255,
    "linkquality": 21,
    "max_brightness": 255,
    "max_brightness_l1": 61,
    "max_brightness_l2": 254,
    "min_brightness": 4,
    "min_brightness_l1": 1,
    "power_on_behavior": "previous",
    "power_on_behavior_l1": "previous",
    "power_on_behavior_l2": "previous",
    "state_l1": "OFF",
    "state_l2": "OFF",
    "switch_type_l1": "momentary",
    "switch_type_l2": "toggle"
}

State after turn_on command from home assistant:

{
    "brightness": 25,
    "brightness_l1": 152,
    "brightness_l2": 255,
    "linkquality": 21,
    "max_brightness": 255,
    "max_brightness_l1": 61,
    "max_brightness_l2": 254,
    "min_brightness": 4,
    "min_brightness_l1": 1,
    "power_on_behavior": "previous",
    "power_on_behavior_l1": "previous",
    "power_on_behavior_l2": "previous",
+    "state_l1": "ON",
    "state_l2": "OFF",
    "switch_type_l1": "momentary",
    "switch_type_l2": "toggle"
}

light remains off. I found this commit which seems to fix a similar problem for the 1 channel version of this dimmer. Maybe a similar thing is happening here?

I'm happy to provide more debug info.

Duncank avatar Jan 22 '25 18:01 Duncank

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

github-actions[bot] avatar Mar 24 '25 00:03 github-actions[bot]

This is still happening. (bump to remove the stale label)

Duncank avatar Mar 24 '25 08:03 Duncank

Hi, same kind of issue here. Device' Z2M state randomly switches to ON after some minutes or hours while in fact hardware is and stay OFF. No known external event triggers this state change. (Tuya TS110E, 1 or 2 gangs devices)

kozlowski-mathias avatar Apr 11 '25 11:04 kozlowski-mathias

All of you using Sonoff Dongle P (CC2652P) in this case?

bernardesarthur avatar May 05 '25 11:05 bernardesarthur

@bernardesarthur I’m using SMLIGHT SLZB-06M (Silicon Labs EFR32MG21 radio).

aaronbeekay avatar May 05 '25 11:05 aaronbeekay

All of you using Sonoff Dongle P (CC2652P) in this case?

I'm using Sonoff Dongle P.

Issue seemed to be fixed in past, but this week it started happening again after last update: 2.3.0 It doesn't look related to the device specifically, because it happens with different ones (different number of channels, dimmable and not dimmable), but yes, it seems to happen only to "light" devices (in my case here).

The most commom thing that happens here is that an automation sends a "turn off" command to the device, on HA it shows up as "off" correctly, but in reality the device is still on. Not sure if this is a bug related to the "optimistic" functionality.

pauloon avatar May 05 '25 12:05 pauloon

Which firmware are you using? I have a EFR32MG21 Sonoff Dongle E with Ember 7.4.5.0 and I don't have this problems.

bernardesarthur avatar May 05 '25 12:05 bernardesarthur

Which firmware are you using? I have a EFR32MG21 Sonoff Dongle E with Ember 7.4.5.0 and I don't have this problems.

My coordinator is running on 20250321

pauloon avatar May 05 '25 12:05 pauloon

Sonoff Dongle E, EmberZNet 7.4.3 [GA]

Le lun. 5 mai 2025 Γ  14:16, pauloon @.***> a Γ©crit :

pauloon left a comment (Koenkk/zigbee2mqtt#24486) https://github.com/Koenkk/zigbee2mqtt/issues/24486#issuecomment-2850806737

Which firmware are you using? I have a EFR32MG21 Sonoff Dongle E with Ember 7.4.5.0 and I don't have this problems.

My coordinator is running on 20250321

β€” Reply to this email directly, view it on GitHub https://github.com/Koenkk/zigbee2mqtt/issues/24486#issuecomment-2850806737, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHMDPJLHNU6CQWUYPINCL3245JAXAVCNFSM6AAAAABQUD33UCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQNJQHAYDMNZTG4 . You are receiving this because you commented.Message ID: @.***>

kozlowski-mathias avatar May 05 '25 12:05 kozlowski-mathias

Any of you are using a GLEDOPTO bulb? Exist a known related bug in that bulbs. Their crash your Zigbee network.

bernardesarthur avatar May 06 '25 11:05 bernardesarthur

Any of you are using a GLEDOPTO bulb? Exist a known related bug in that bulbs. Their crash your Zigbee network.

No Gledopto devices here. About my network crashing, it was fixed with a firmware upgrade to the coordinator, as instructed here: https://github.com/Koenkk/zigbee2mqtt/issues/26998

pauloon avatar May 06 '25 11:05 pauloon