The phantom of Home Assistant.. help!

I’m getting a little desperate by random stuff happening in my HA setup.

The setup contains 13 Zigbee devices, using Zigbee2MQTT
There’s also two Sonoff devices and a Tuya 2 channel dimmer. These two are controlled through cloud services.
All automations are done in Node Red.

I started having phantom issues with two zigbee switches in the bathroom which make me suspect Node Red or may be the zigbee dongle.
First of all, I installed an extension cable to move the dongle away from my Rpi4. That didn’t change anything.
After that I started stripping automations away from Node Red and built them again in HA. No change.

The effect was always at night, at some point it was always during the next, two switches magically turned on and after about an hour they switched off. That kept repeating, but never during the day.

At some point… it just disappeared. All automations were moved to Node Red again and it stayed away.

Then one of the Sonoff devices just switched off randomly.

Now the same seems to happen with a LED strip in my bedroom. Only, it switches on randomly and switches off after a minute. This afternoon it just switched on.

The only automation which relates to this LED strip (controlled by a Aqara Zigbee switch) checks if someone is home (iPhone location services). If nobody is home, there should not be any message going to the switch. …but it does.

I’m lost… this phenomenon seems to move from one device to another. I can’t find anything in logs or in the logbook other than the device is switched on by HassIO. No more debug info to be found.

One thing which I also noticed: there are delays in the automations. More than I have seen when I was using an Aqara hub. (Push a button, wait for about a second and the light(s) switches on.)

Is there anyone who is seeing the same thing? Anyone who can explain where to find what is causing these triggers?

Sorry… lengthy post…

Did your phone go to sleep and ha believe you were out and then back home?

May be, but wouldn’t make sense because for instance this afternoon nobody was home when the LED strip turned on.

The NR automation looks like this:
Trigger at 22:00 > is anybody home? switch on led strip
Trigger at 01:00 > switch off led strip

Also, the iPhone detection should be visible in the logs, but that’s what does my head in… there’s hardly anything happening (certainly during the night state changes) but things magically turn on or off.

Any clues in the zigbee2mqtt logs?

Good point, I switched the log to error as I wasn’t able to find anything, but I’ll switch it to debug again to see if there’s anything visible when the phantom returns.

I can’t help with NodeRed since I don’t use it but if the automations were back in HA you could turn off all of the automations to ensure that you don’t have any “phantom” switching and then if you verified it’s from an automation you could turn them on one at a time to see if the “phantom” returns.

It’ll be a long process but I don’t know of any other way to do it.

Except…

you could add a “debug” message in your automations so that if an automation triggers it will write a message to the log or some other notifier that tells you which automation caused the light to operate.

Or you could check the time of “the event” and compare it against a card as described in : -

:smiley:

1 Like

That might be handy! Thank you for that, will add that!

Once you find the automation that triggers spuriously, we can look at the yaml and toughen it to be less flakey. Similar techniques can then be used on your other automations if they step out of line.