Light appears to be toggeling but this is not happening in reality

I have deconz running headless and connected to HA. In HA i have a very simple automation - turn on the lights at 9 PM and turn them off at 12 PM. This works as expected - the lights are on during the mentioned timeframe (i am physically in the room so i can check it). In HA though i get lots of events, coming from deconz which indicate that the lights are turning off every now and then. Initially i thought it was some HA bug but HA actually receives these events from deconz and only depicts them graphically and saves them in the log.

logs are from HA but the information should be relevant for deconz as the data comes from it: 2021-07-31 21:15:06 DEBUG (MainThread) [pydeconz.websocket] {"attr":{"id":"13"," - Pastebin.com

The light which is experiencing this behaviour is called Living Area - it’s actually a group consisting of 4 IKEA bulbs named Living Area I to Living Area IV

Expected (ON from 09:00:00 PM until 12:00:00PM); light actually stays on as i am in the room and experience no flicker or similar problems

History:
ON → 09:00:00 PM
OFF → 09:25:47 PM
ON → 09:28:46 PM
OFF → 09:31:27 PM
ON → 09:31:32 PM
OFF → 09:37:56 PM
ON → 09:38:09 PM
OFF → 09:43:22 PM
ON → 09:43:36 PM

These are just a few events but it goes on like this the entire evening.

Did you perhaps have groups/buttons assigned in PHoscon?

Also: Did you set up rules in the API? Perhaps using Hue Essentials app?

i have no buttons assigned to the group and not set up anything using any app.
how can i check for the API rules?

https://dresden-elektronik.github.io/deconz-rest-doc/endpoints/rules/#get-all-rules

i only have 6 rules related to a wireless IKEA dimmer switch

Is it connected with the light?

yes. the dimmer controls the 4 lights in the group.

So what if you disable these? Does it occur then?

In HA, i think it might be worth to see what automations are triggered.

i have a clean test-HA instance which contains just the deconz devices + the automation mentioned above. There is nothing else running. I jut tried with the dimmer removed from deconz - still the same behaviour.

Strange one.

Can you add some logs from deCONZ?

Also: The lights are not physically going on and off right? Just the status is ?

Yes, the lights work visually as expected, only their status is going crazy. I’ll produce some deconz logs and post them here.

@Robban Can you check in? I’m not sure how to debug this one.

From a moderator perspective, i’ll move this one to 3rd Party integrations for now.

This was originally reported on hass github. But since there are events received which signals the state change i asked for this to be reported to Deconz instead.

I just checked one of the 4 lights (Living Area II) based on the information on pastebin. First of all, the lights are switched individually and sequentially via unicasts. So this is no group from a zigbee perspective but presumably a means to replicate an identical command to numerous devices.

From what I can see, the light never changes its state after being powered on. Tbh, I don’t expect anything different from the others. Hence, deconz is doing just fine and not the reason for the jumpy state you describe. I don’t know how HA internals work with this however.

Hm, looks like I stand corrected. I’ve accidentally also spotted some lines where apparently a group is switched and the group reports its “any_on” value in line with your timebar.

Group switch:
2021-07-31 21:22:41 DEBUG (MainThread) [pydeconz.websocket] {"e":"changed","id":"2","r":"groups","state":{"all_on":false,"any_on":true},"t":"event"}

Group state change:
2021-07-31 21:31:27 DEBUG (MainThread) [pydeconz.websocket] {“e”:“changed”,“id”:“2”,“r”:“groups”,“state”:{“all_on”:false,“any_on”:false},“t”:“event”}
[…]
2021-07-31 21:31:32 DEBUG (MainThread) [pydeconz.websocket] {“e”:“changed”,“id”:“2”,“r”:“groups”,“state”:{“all_on”:false,“any_on”:true},“t”:“event”}

This raises a couple of questions:

  • Are the 4 lights in question part of the group?
  • Are maybe further devices part of the group?
  • If they are part of the group, why are they switched seperately?
  • Why is the deconz “any_on” value so jumpy if the light states are all steady throughout the time?

This is the device responsible for the state jumps

DEBUG (MainThread) [pydeconz.websocket] {"attr":{"id":"7","lastannounced":"2020-11-10T07:55:41Z","lastseen":"2021-07-31T18:43Z","manufacturername":"Unknown","modelid":"lumi.relay.c2acn01","name":"Living Area","swversion":"09-20-2018","type":"Dimmable light","uniqueid":"00:15:8d:00:04:5c:20:99-02"},"e":"changed","id":"7","r":"lights","t":"event","uniqueid":"00:15:8d:00:04:5c:20:99-02"}

Whenever its on/off state changes, the “any_on” value for Group 2 changes as well, which seemingly is the base of your time bar.

I have the 4 Ikea bulbs in a deconz group. The lights are electrically connected to an aqara relay (all home light fixtures are). So for the lights to go into the ON state i set the aqara relay in the ON state. The bulbs are further not controlled by HA or anyone else (at least for the test instance i have - otherwise the bulbs have their intensity controlled by an ikea wireless switch). If the aqara relay would physically toggle i’dd see it with my eyes as the light would deffinetly flicker or turn off when the OFF state lasts long enough.