Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IKEA Tradfri (LED2103G5) turns on when receiving off command if already off #22030

Closed
ianmtaylor1 opened this issue Apr 2, 2024 · 60 comments
Closed
Labels
problem Something isn't working

Comments

@ianmtaylor1
Copy link

ianmtaylor1 commented Apr 2, 2024

What happened?

Sorry for the grammatically confusing title, hopefully it will be clear below.

Sometimes I will send an "off" command to my bulb when the bulb is already off. This happens, for example, in home assistant scripts that turn off all the lights in a room when some lights are on but others are off, or if I press a smart button twice that turns off the light.

What did you expect to happen?

If the IKEA bulb is off, and I publish {"state": "OFF"} to zigbee2mqtt/My-Bulb-Name/set, the light will remain off.

How to reproduce it (minimal and precise)

  1. Add IKEA Tradfri bulb (LED2103G5) to Zigbee2MQTT.
  2. Update firmware to version 16777270 (Not sure if this is necessary or if this bug exists on old firmware.)
  3. Turn bulb on.
  4. Publish {"state": "OFF"} to zigbee2mqtt/My-Bulb-Name/set. Bulb turns off as expected.
  5. Repeat step 4, publish another off message while bulb is already off. Bulb does not remain off, instead, it turns on at very low brightness.

Zigbee2MQTT version

1.36.0 commit: 86ed71c

Adapter firmware version

20210708

Adapter

SONOFF Zigbee 3.0 USB Dongle Plus ZBDongle-P

Setup

Official docker image on Raspberry Pi 3B+

Debug log

No response

@ianmtaylor1 ianmtaylor1 added the problem Something isn't working label Apr 2, 2024
@efab2022
Copy link

efab2022 commented Apr 2, 2024

+1 I came to report the exact same behaviour for this other IKEA device LED2005R5_LED2106R3.

This issue also occurs when sending {"brightness": 0} repeatedly (the bulb toggles between off and on at low power).
This issue also occurs when sending {"brightness": 1} repeatedly (the bulb toggles between off and on at low power).
This issue does not occur for brightness 2 or greater (the bulb stays on)

In some circumstances, doing this repeatedly

tx ianmtaylor1

My setup

Zigbee2MQTT version

1.36.0-1

Adapter

ZigBee CC1352P-2

@ianmtaylor1
Copy link
Author

ianmtaylor1 commented Apr 2, 2024

I want to determine whether this is a bug with zigbee2mqtt or the IKEA devices themselves. I could pair the lightbulb with an IKEA hub coordinator, but I don't own one. I do have an IKEA somfrig button. Would binding those two devices bypass zigbee2mqtt and allow me to test whether the same problem exists when hitting the off button twice?

(Apologies if I'm using the terminology wrong, I'm new to zigbee)

@ianmtaylor1
Copy link
Author

ianmtaylor1 commented Apr 5, 2024

I have one non-update and one semi-update to this topic:

The non-update: I haven't had any luck binding my button to my bulb so I haven't been able to determine if the issue is with Zigbee2MQTT or with the bulb. I suspect if I had a Tradfri button instead of a Somrig button it would work better. If anyone else could test this kind of bulb outside of Zigbee2MQTT to see if the problem persists, that would be greatly appreciated.

The semi-update

While I haven't been able to resolve the issue, I have resolved an associated issue that has helped in my specific circumstances. In my case, these double-off messages were mostly occurring from an automation in Home Assistant triggered by my Somrig button, which for some reason was firing twice when pressed. I found out this was due to my having configured

advanced:
  output: 'attribute_and_json'

in Z2M's configuration.yaml. This was colliding device automations published to zigbee2mqtt/my-button/action with states, which, thanks to that configuration, were also being published to the same topic. I have set this option back to 'json' and my double-firing automation is fixed. I wish this conflict between attribute publishing and device_automations was better documented.

To be clear, though, the underlying problem with the bulb is still there. Following the steps outlined in this issue's first post will still result in the bulb turning back on at low brightness, contrary to expectation. I've just found a mitigation for my particular main use case.

@Furegato
Copy link

I'm having the same problem, but with IKEA's LED2111G6. (E14, RGB light bulb)
For the past month or so whenever I got back home I would found that the two LED2111G6 bulbs I have were turned on at 1% brightness.
It was hard to track what happened because it was showing that their state were off ... But after some digging I found out that my "Away from Home' automation was sending a "turn off" command which was triggering the problem you mention as well.
Basically, yes, if I send a "turn lights off" command while they are off, they will turn back on at 1% brightness.
One small finding... It will happen only once on a sequence of repeatedly "turn off" commands. For example: if I send another "turn off" while it is in this weird off-but-on state, it will turn it off and if I then send yet another "turn off" command, it will not present the same problem again. I know that sending 3 times a command to the light is not a viable workaround, but it might be a clue to what is happening.
I hope someone with the skills can figure it out.
It's really annoying not to be sure if you really turned off the lights. It kinda of defeats one of the most important features of a smart light.
Cheers.

@GoodnessJSON
Copy link

I have this EXACT issue and it's driving me nuts. I can repeatedly send a Turn off Service call and toggle the bulb between off and 1%.

These bulbs are unusable in a bedroom setting because of this issue.

@TEF2one
Copy link

TEF2one commented May 28, 2024

Same issue, was wondering why they would randomly turn on yet not show as turned on and finally noticed the relation with the off command waking them up... such a annoying issue after having replace all my light with these, I hope to find a solution.

@TEF2one
Copy link

TEF2one commented May 29, 2024 via email

@heyiswas
Copy link

Exact same issue with LED2201G8.

@TEF2one
Copy link

TEF2one commented Jun 15, 2024

FYI, I returned mine to IKEA, they are good with that...
Instead I baught back some LEDVANCE SMART+ Classic A60 E27 Tunable white

@Koenkk
Copy link
Owner

Koenkk commented Jun 15, 2024

@ianmtaylor1 could you provide the debug log of this with z2m 1.38.0?

See this on how to enable debug logging.

@ianmtaylor1
Copy link
Author

@Koenkk Thanks for your reply. I've attached a snip of the debug log file while experiencing the issue. Please let me know if I've omitted anything or if you need any other information.

Z2m Version: 1.38.0 commit fe048e6
Tradfri firmware version: 1.0.36, build date 20230918
Device name: Ian's Bedside Lamp

Logs start with a command to turn the light on (line 1, [2024-06-15 12:23:55]), followed by a command to turn the light off which works as expected (line 30, [2024-06-15 12:24:07]), then a second command to turn the light off which reproduces the issue (line 81, [2024-06-15 12:24:11]).

Hope this helps!

debug_log_snip.txt

@ianmtaylor1
Copy link
Author

One small finding... It will happen only once on a sequence of repeatedly "turn off" commands. For example: if I send another "turn off" while it is in this weird off-but-on state, it will turn it off and if I then send yet another "turn off" command, it will not present the same problem again.

This is interesting, and different from the behavior of my Tradfri bulb. If I send repeated off commands, the bulb will alternate off, 1%, off, 1%, ... etc. repeatedly.

@GoodnessJSON
Copy link

One small finding... It will happen only once on a sequence of repeatedly "turn off" commands. For example: if I send another "turn off" while it is in this weird off-but-on state, it will turn it off and if I then send yet another "turn off" command, it will not present the same problem again.

This is interesting, and different from the behavior of my Tradfri bulb. If I send repeated off commands, the bulb will alternate off, 1%, off, 1%, ... etc. repeatedly.

What you're describing is exactly what is described here - https://www.reddit.com/r/homeassistant/s/6eyx8rcTfA

The fix was to add an if check to detect if the bulb is ON, before sending a turn off command.

@Furegato
Copy link

Furegato commented Jun 17, 2024 via email

@GoodnessJSON
Copy link

GoodnessJSON commented Jun 17, 2024

Unfortunately, your suggestion is not a real solution....

I completely agree and I'd like a full fix too. What you've described for non-status aware processes is something I've run into as well.

I'm just saying that it's related to sending two OFF commands consecutively to the globe.

It's a bug seemingly in the bulbs firmware, but I'm wondering if Z2M can somehow handle it.

@tungmeister
Copy link

also seeing this behavior, it's really annoying as I've 10 GU10 bulbs that come on differently depending on whats happening in the room so I'll often find half of them on at 1% when they're meant to be all off.

@legsim
Copy link

legsim commented Jun 20, 2024

Can confirm it happens with LED2111G6.

It seems that it only happens when a custom transition time is set in device settings.
Maybe some firmware issue when handling genLevelCtrl.moveToLevelWithOnOff?

@Koenkk
Copy link
Owner

Koenkk commented Jun 22, 2024

In your configuration.yaml (or devices.yaml if present), do you have a transition set for this device?

@GoodnessJSON
Copy link

GoodnessJSON commented Jun 22, 2024

In your configuration.yaml (or devices.yaml if present), do you have a transition set for this device?

I set mine to 0 seconds in Z2M UI Settings page since this apparently is meant to help, but it made no difference.

The only fix I've had for this issue is checking if the light is ON, before triggering an OFF. If I send a 'Turn Off' twice, then it will be stuck in a semi on state.

Here's an example image from Reddit that also shows it. It would be super appreciated if a fix could be put in for this. It's extremely annoying and breaks a lot of the ease of use of these lights in HA.

@Koenkk
Copy link
Owner

Koenkk commented Jun 22, 2024

Can you try to completely remove it? (stop z2m, remove transition from the configuration.yaml, start z2m)

@ianmtaylor1
Copy link
Author

In your configuration.yaml (or devices.yaml if present), do you have a transition set for this device?

Can you try to completely remove it? (stop z2m, remove transition from the configuration.yaml, start z2m)

I had transition: 0 set in my devices.yaml for this device. I removed it, following your instructions, and the problem is no longer there. Publishing {"state": "off"} twice in a row to zigbee2mqtt/Ian's Bedside Lamp/set leaves the light off as expected.

Just FYI, now the light transitions for ~1sec between the on and off states (default transition time?). This is very minor and acceptable to me because it fixes the other problem.

@Furegato
Copy link

Can you try to completely remove it? (stop z2m, remove transition from the configuration.yaml, start z2m)

That actually worked for me as well!
Thanks for the suggestion!
Just setting the transition to 0 was making it even worse, but by deleting it completely from z2mqtt devices.yaml worked like a charm!

@GoodnessJSON
Copy link

Can you try to completely remove it? (stop z2m, remove transition from the configuration.yaml, start z2m)

Can confirm, this worked for me too! No more 1%. Fantastic!

@heyiswas
Copy link

Can you try to completely remove it? (stop z2m, remove transition from the configuration.yaml, start z2m)

Works for LED2201G8. Thanks :)

@GoodnessJSON
Copy link

Can you try to completely remove it? (stop z2m, remove transition from the configuration.yaml, start z2m)

@Koenkk could we formally include this in a fix to Z2M? As it may not be immediately obvious that this is the solution to this problem.

Thanks for such a great suggestion, everything has been great since!

@tungmeister
Copy link

Unfortunately, this isn't a proper fix. I'm using the transition value within my groups.yaml, without defining it here groups hard cut on/off. Looking through the posts this appears to be affecting multiple ikea models and FW versions (I'm on 3.0.10 and I've seen mention of 1.0.36). I'm guessing this is down to the new variants that have been introduced over the last 6 months or so, I'm seeing this with LED2106R3 but not LED2005R5. I've had the latter for a couple of years now without issue, the problem is only present on LED2106R3, the new version of this bulb. @Koenkk could this be a converter issue?

@Koenkk
Copy link
Owner

Koenkk commented Jun 25, 2024

This is not a converter issue but a bug in the bulbs firmware, it seems to turn on when receiving a "move to brightness 0 twice"

@GoodnessJSON
Copy link

This is not a converter issue but a bug in the bulbs firmware, it seems to turn on when receiving a "move to brightness 0 twice"

Can I ask why removing the transition fields worked to fix the issue then? @Koenkk

@Koenkk
Copy link
Owner

Koenkk commented Jun 25, 2024

If you remove the transition, instead of a "move to brightness 0 with transition 0", it will send the native off command

@stevelee916a
Copy link

stevelee916a commented Aug 11, 2024

Seems like this has been a small but recurring issue for years? Skimming through the threads, it’s not clear to me whether this is a homebridge, ha, or z2mqtt issue

Homebridge bug thread (closed but not resolved): homebridge/homebridge#3073

homebridge-z2mqtt bug thread (also closed but not resolved): itavero/homebridge-z2m#383

zigbee2mqtt bug thread (closed but not resolved): #10409

home assistant thread:
home-assistant/core#104643

@GoodnessJSON
Copy link

Seems like this has been a small but recurring issue for years? Skimming through the threads, it’s not clear to me whether this is a homebridge, ha, or z2mqtt issue

I would say this is on the Z2M side, as I get the issue when managing the lights from Z2M directly, before they are even added to Homebridge.

This is without any involvement from HA, Homebridge or anything else. If you manage them directly from Z2M you get the issue when transition is set (even if 0).

@Koenkk
Copy link
Owner

Koenkk commented Aug 12, 2024

@GoodnessJSON

If you manage them directly from Z2M you get the issue when transition is set (even if 0).

You should not set any transition (with 0 you will get this issue)

@GoodnessJSON
Copy link

GoodnessJSON commented Aug 12, 2024

@GoodnessJSON

If you manage them directly from Z2M you get the issue when transition is set (even if 0).

You should not set any transition (with 0 you will get this issue)

Yes correct, and it now works for me. Thanks for pointing that out a few comments up.

In my opinion though the transition setting should be removed for 2201XX and 2203XX models as it's broken and potentially misleading.

It's not very evident that it's the source of the issue and therefore how to fix it.

If it can't be set at all without glitching the globes, it should be removed until the firmware is patched.

Koenkk added a commit to Koenkk/zigbee-herdsman-converters that referenced this issue Aug 13, 2024
@Koenkk
Copy link
Owner

Koenkk commented Aug 13, 2024

I've fixed the issue, the transition will now always be ignored for the following models: LED2103G5, LED1842G3 and LED2201G8 (let me know if this fix should be applied to more)

Changes will be available in the dev branch in a few hours from now.

@ipha
Copy link

ipha commented Aug 13, 2024

I've fixed the issue, the transition will now always be ignored for the following models: LED2103G5, LED1842G3 and LED2201G8 (let me know if this fix should be applied to more)

Changes will be available in the dev branch in a few hours from now.

LED2107C4 and LED1949C5 (on fw 1.1.20 but not 1.1.003.) have the same issue.

@GoodnessJSON
Copy link

I've fixed the issue, the transition will now always be ignored for the following models: LED2103G5, LED1842G3 and LED2201G8 (let me know if this fix should be applied to more)

Amazing, thanks for setting this. I also had the issue with LED1925G6 and confirmed the transition fix when manually removing it.

Appreciate you looking at this.

@Midifreakz
Copy link

Hi Koen,

The issue is also happening on the GU10 bulbs.
I can testify for the newer models

LED1923R5
LED2005R5/LED2106R3
LED2104R3

@Koenkk
Copy link
Owner

Koenkk commented Aug 15, 2024

Added!

Changes will be available in the dev branch in a few hours from now.

@tungmeister
Copy link

tungmeister commented Aug 15, 2024

@Koenkk will this affect all versions of the LED2005R5/LED2106R3? I have no issues with the transition settings on the original version of these bulbs, it's broken on the newer revision.
Original model:
image
new version:
image

@tungmeister
Copy link

@Koenkk sorry to bump this but I want to make sure these changes won't break all the transition settings I've got on the older version of the bulb (I have a lot of them!) in the next release.

Koenkk added a commit to Koenkk/zigbee-herdsman-converters that referenced this issue Aug 31, 2024
@Koenkk
Copy link
Owner

Koenkk commented Aug 31, 2024

@tungmeister thanks for bringing this up. The off transition will now only be suppressed with firmware > 1.0.012

Changes will be available in the dev branch in a few hours from now.

@supaeasy
Copy link

supaeasy commented Sep 5, 2024

Hello @Koenkk please also add https://www.zigbee2mqtt.io/devices/LED2003G10.html#ikea-led2003g10

On another note, maybe this helps with the issue: it happens MUCH more with ember (multiple times a day) than it did with ezsp (a couple times per week)

@Koenkk
Copy link
Owner

Koenkk commented Sep 5, 2024

@supaeasy the fix is applied to all TRADFRI bulb with softwareBuildID > 1.0.012. I think this issue can be closed now.

@matnoublanche
Copy link

Hi,

Sorry to reopen this issue.

@Koenkk : I also have the same problem with this Ikea bulb : LED2109G6 (https://www.zigbee2mqtt.io/devices/LED2109G6.html#ikea-led2109g6)

Could you add it please ?

Thank's !

Mathieu

@Koenkk
Copy link
Owner

Koenkk commented Nov 17, 2024

@matnoublanche if it does not work with z2m 1.41.0, can you provide the data/database.db entry?

@eirikc
Copy link

eirikc commented Nov 19, 2024

@Koenkk I'm having this issue on z2m 1.41.0 with LED1937T5 on fw 1.0.012, The issue is resolved by removing the transition I set under global device_options in the config file. If 1.41.0 is supposed use noOffTransition=true for LED1937T5, then maybe the db entries are helpful:

{"id":9,"type":"Router","ieeeAddr":"0x842e14fffe4852e3","nwkAddr":14120,"manufId":4476,"manufName":"IKEA of Sweden","powerSource":"Mains (single phase)","modelId":"TRADFRIbulbT120E27WSopal470lm","epList":[1,242],"endpoints":{"1":{"profId":260,"epId":1,"devId":268,"inClusterList":[0,3,4,5,6,8,768,4096,64599],"outClusterList":[25],"clusters":{"genBasic":{"attributes":{"modelId":"TRADFRIbulbT120E27WSopal470lm","manufacturerName":"IKEA of Sweden","powerSource":1,"zclVersion":3,"appVersion":16,"stackVersion":103,"hwVersion":1,"dateCode":"20201111","swBuildId":"1.0.012"}},"lightingColorCtrl":{"attributes":{"colorCapabilities":16,"colorTempPhysicalMin":250,"colorTempPhysicalMax":454,"colorMode":2,"colorTemperature":350,"startUpColorTemperature":65535,"currentX":33107,"currentY":27211}},"genOnOff":{"attributes":{"onOff":0}},"genLevelCtrl":{"attributes":{"currentLevel":1}}},"binds":[{"cluster":6,"type":"endpoint","deviceIeeeAddress":"0x00124b0026b78e4c","endpointID":1},{"cluster":8,"type":"endpoint","deviceIeeeAddress":"0x00124b0026b78e4c","endpointID":1},{"cluster":768,"type":"endpoint","deviceIeeeAddress":"0x00124b0026b78e4c","endpointID":1}],"configuredReportings":[{"cluster":8,"attrId":0,"minRepIntval":5,"maxRepIntval":3600,"repChange":1},{"cluster":6,"attrId":0,"minRepIntval":0,"maxRepIntval":3600,"repChange":0},{"cluster":768,"attrId":7,"minRepIntval":5,"maxRepIntval":3600,"repChange":1}],"meta":{}},"242":{"profId":41440,"epId":242,"devId":97,"inClusterList":[33],"outClusterList":[33],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":16,"stackVersion":103,"hwVersion":1,"dateCode":"20201111","swBuildId":"1.0.012","zclVersion":3,"interviewCompleted":true,"meta":{"configured":332242049},"lastSeen":1732056686990}
{"id":10,"type":"Router","ieeeAddr":"0x842e14fffe4f7850","nwkAddr":5420,"manufId":4476,"manufName":"IKEA of Sweden","powerSource":"Mains (single phase)","modelId":"TRADFRIbulbT120E27WSopal470lm","epList":[1,242],"endpoints":{"1":{"profId":260,"epId":1,"devId":268,"inClusterList":[0,3,4,5,6,8,768,4096,64599],"outClusterList":[25],"clusters":{"genBasic":{"attributes":{"modelId":"TRADFRIbulbT120E27WSopal470lm","manufacturerName":"IKEA of Sweden","powerSource":1,"zclVersion":3,"appVersion":16,"stackVersion":103,"hwVersion":1,"dateCode":"20201111","swBuildId":"1.0.012"}},"lightingColorCtrl":{"attributes":{"colorCapabilities":16,"colorTempPhysicalMin":250,"colorTempPhysicalMax":454,"colorMode":2,"colorTemperature":454,"startUpColorTemperature":65535,"currentX":30015,"currentY":26870}},"genOnOff":{"attributes":{"onOff":0,"startUpOnOff":1}},"genLevelCtrl":{"attributes":{"currentLevel":3}}},"binds":[{"cluster":6,"type":"endpoint","deviceIeeeAddress":"0x00124b0026b78e4c","endpointID":1},{"cluster":8,"type":"endpoint","deviceIeeeAddress":"0x00124b0026b78e4c","endpointID":1},{"cluster":768,"type":"endpoint","deviceIeeeAddress":"0x00124b0026b78e4c","endpointID":1}],"configuredReportings":[{"cluster":6,"attrId":0,"minRepIntval":0,"maxRepIntval":3600,"repChange":0,"manufacturerCode":null},{"cluster":8,"attrId":0,"minRepIntval":5,"maxRepIntval":3600,"repChange":1,"manufacturerCode":null},{"cluster":768,"attrId":7,"minRepIntval":5,"maxRepIntval":3600,"repChange":1,"manufacturerCode":null},{"cluster":6,"attrId":0,"minRepIntval":0,"maxRepIntval":3600,"repChange":0},{"cluster":8,"attrId":0,"minRepIntval":5,"maxRepIntval":3600,"repChange":1},{"cluster":768,"attrId":7,"minRepIntval":5,"maxRepIntval":3600,"repChange":1}],"meta":{}},"242":{"profId":41440,"epId":242,"devId":97,"inClusterList":[33],"outClusterList":[33],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":16,"stackVersion":103,"hwVersion":1,"dateCode":"20201111","swBuildId":"1.0.012","zclVersion":3,"interviewCompleted":true,"meta":{"configured":1324213189},"lastSeen":1732056830374}

Thanks for your kick ass work!

@matnoublanche
Copy link

@matnoublanche if it does not work with z2m 1.41.0, can you provide the data/database.db entry?

By bad, I was on version edge 1.36.0. I was supposing that edge version upgrades are done automatically.

I've upgraded to the last version, will see if all is ok for now.

Thank you

@Koenkk
Copy link
Owner

Koenkk commented Nov 21, 2024

@eirikc in this case transitions should be supported as it's running 1.0.012, at least this is the feedback I got from #22030 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
problem Something isn't working
Projects
None yet
Development

No branches or pull requests