Switch turns on by itself at nights!

Hi there!

From time to time I wake up in the middle of the night because my main light turns on, randomly. It happens once or twice a month.

This is what I see in the log:

Note: I did not press the button the first time (06:05:51). I pressed it 3 times later, because that switch turned itself on 3 times.

I’m using a led strip connected to a power strip socket. Light is controlled by a Xiaomi Aqara button (switch.toggle in the green mark on the pic).

I don’t know what’s making the switch turn on itself. However I can see that error on the log as the exact same time when the switch turns on.

Any ideas why these two events can be related?

Thanks

The WSDCGQ11LM device mentioned in the log is your Aqara button then?
Why would a simple button be expected to supply data like temperature, pressure and humidity? Maybe there is something wrong with the your entity definition. I’d say troubleshooting gets easier if you share it and the automations that rely on the button - it is quite hard to find the cause just from the log entry.

The WSDCGQ11LM is just a temperature sensor:

Aqara Sensor de Temperatura y Humedad  PcComponentes.com 2023-03-14 11-50-03

That’s the weirdest thing! It has nothing to do with the automation. But both event times do match…

This is the automation that relies on that button (using node-red):

Here’s the code, but I don’t see anything that can cause this issue :-/

[{"id":"13dc4da2d383c3af","type":"tab","label":"Dormitorio","disabled":false,"info":"","env":[]},{"id":"ef7716abd90cd11c","type":"switch","z":"13dc4da2d383c3af","name":"Botón dormitorio","property":"payload.event.click_type","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"double","vt":"str"},{"t":"eq","v":"long_click_press","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":530,"y":160,"wires":[["c8185a8e1d71bb71"],["ee854c38ceb74e83"],["d64a982ec286d98d","4b17a4c1f73dd7b9"]]},{"id":"335da355c1e4d6ba","type":"server-events","z":"13dc4da2d383c3af","name":"Todos los eventos","server":"30106ad9.c9b936","version":2,"eventType":"","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"waitForRunning":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"$outputData(\"eventData\").event_type","valueType":"jsonata"}],"x":110,"y":220,"wires":[["89c985ba377e2144"]]},{"id":"89c985ba377e2144","type":"switch","z":"13dc4da2d383c3af","name":"Xiaomi Buttons + Wall","property":"payload.entity_id","propertyType":"msg","rules":[{"t":"eq","v":"binary_sensor.switch_158d00019c8c8e","vt":"str"},{"t":"eq","v":"switch.wall_switch_double_lumi_158d000460c04e_ch0_lumi_158d000460c04e","vt":"str"},{"t":"eq","v":"binary_sensor.switch_158d00016bfb96","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":360,"y":220,"wires":[["ef7716abd90cd11c"],["c8185a8e1d71bb71"],["332debfec9cab31b"]]},{"id":"c8185a8e1d71bb71","type":"api-call-service","z":"13dc4da2d383c3af","name":"Lamparita de noche","server":"30106ad9.c9b936","version":5,"debugenabled":false,"domain":"switch","service":"toggle","areaId":[],"deviceId":[],"entityId":["switch.bedroom_power_strip_socket_1"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":780,"y":60,"wires":[[]]},{"id":"e23c529b43c33b8c","type":"api-call-service","z":"13dc4da2d383c3af","name":"Calefactor on/off","server":"30106ad9.c9b936","version":5,"debugenabled":false,"domain":"script","service":"broadlink_calefactor_on_off","areaId":[],"deviceId":[],"entityId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":770,"y":120,"wires":[[]]},{"id":"d64a982ec286d98d","type":"api-call-service","z":"13dc4da2d383c3af","name":"Apagar todas (light)","server":"30106ad9.c9b936","version":5,"debugenabled":false,"domain":"light","service":"turn_off","areaId":[],"deviceId":[],"entityId":["light.ceilc_cloud_355917","light.yeelight_color_0x35b7d24","light.ceilc_cloud_347429"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":790,"y":240,"wires":[[]]},{"id":"4b17a4c1f73dd7b9","type":"api-call-service","z":"13dc4da2d383c3af","name":"Apagar todas (switch)","server":"30106ad9.c9b936","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.bedroom_power_strip_socket_1","switch.wall_switch_double_lumi_158d000460c1a8_ch0_lumi_158d000460c1a8","switch.wall_switch_double_lumi_158d000460c1a8_ch1_lumi_158d000460c1a8"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":800,"y":300,"wires":[[]]},{"id":"4cd86905f3e3d932","type":"api-call-service","z":"13dc4da2d383c3af","name":"Cafetera","server":"30106ad9.c9b936","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":["1a49ede48ea2218f168327a71d292765"],"entityId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":760,"y":180,"wires":[[]]},{"id":"ee854c38ceb74e83","type":"api-call-service","z":"13dc4da2d383c3af","name":"Ventilador dormitorio on/off","server":"30106ad9.c9b936","version":5,"debugenabled":false,"domain":"script","service":"broadlink_ventilador_dormitorio","areaId":[],"deviceId":[],"entityId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":760,"y":380,"wires":[[]]},{"id":"6eccb52b0ceae738","type":"inject","z":"13dc4da2d383c3af","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":300,"y":460,"wires":[[]]},{"id":"332debfec9cab31b","type":"switch","z":"13dc4da2d383c3af","name":"Botón dormitorio pared","property":"payload.event.click_type","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"double","vt":"str"},{"t":"eq","v":"long_click_press","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":510,"y":300,"wires":[["c8185a8e1d71bb71"],[],["ee854c38ceb74e83"]]},{"id":"30106ad9.c9b936","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]

Thanks!

Hi, I don’t have an explanation right away but I’m also curious to why this happens with zigbee.
Is this light only controlled by that button, no motion or anything else?

I had a light in the kitchen that switched on sometimes over night.
Now, I have an automation that turns it off - when the house is in sleepmode - and the light is on for longer then 10 minutes.

I switched from deCONZ with a Conbee II to z2m with a sonoff P dongle and I don’t see this behavior anymore.
You could check if every time the light is on, there is some kind of action/log entry at the same time.
I wonder if some kind of interference (Wi-Fi, your zigbee coordinator) plays a part in this.

There’s actually another button controlling the light. Same type of button (Xiaomi zigbee). No motion control or anything else.

I was actually thinking of getting a Conbee II. If I don’t get this fixed… it would be a good time to get it.

What are you using now as a coordinator?

From what I have discovered, the Sonoff P dongle seems to be a more attractive option.
I bought the Conbee II when starting my zigbee adventure and although my network was working well enough, I wanted to switch to zigbee2mqtt because of it’s extended capabilities.

I’m using the Xiaomi Gateway.

Though not very likely, but could it just be pure coincidence that the two events happened at the same time? Have you checked if the error is logged every time when your light comes on or was this an observation you just made on the last occurrence?

No idea if this could cause it, but maybe a ZigBee group mapping?

I will try to check that out next time. It happened again a couple nights ago. But I went back to sleep and I forgot to check the log when I woke up… sigh

There’s no group for that switch. I’m getting it right. Thanks for trying to help, though!