Every light in my house is turning on randomly

Recently – as in, within the last couple days, roughly correlating with when I updated to 0.39.2 – every light in my house has started to turn on randomly.

And I mean every. Single. Light. To 100% brightness, no less.

It just happened now while we were sitting down at dinner. It happened last night at about 12:45am and woke up my wife. It happened late yesterday afternoon.

I can’t find anything in the logbook that indicates what is triggering this – no scene triggers or automation triggers or anything. I don’t even know what could be getting triggered – I don’t have any scenes that match this. Even in scenes I have that turn a lot of lights on, not all of them are at 100%, which is what is happening here.

I see a bunch of errors about connecting to my Chromecasts in the log, and one odd error about invalid service data for light.turn_off:

17-03-03 23:47:59 ERROR (MainThread) [homeassistant.core] Invalid service data for light.turn_off: extra keys not allowed @ data['brightness']. Got 0

But nothing that would seem to be relevant for this. Not sure that it matters, but all my devices are MQTT to Home Assistant.

I haven’t changed any of my automation rules since this started happening. How would you go about troubleshooting?

Hey there,

Well, I’d say first thing to do is change all passwords. Router, HA server, everything… No kidding … Had some similar issue, after some reinstalls and lot of frustrating moments I found some uninvited guests in mi network … :frowning:

Are you using public or private MQTT?

To start with I would enable logging on the broker so I can see who/what is connecting and what is sending commands, if possible. If that is not possible, run a client continuously subscribed to all topics, to at least see if the problem is caused by MQTT commands. It could be the result of a power glitch or something like that.

Good call. Changed passwords on my server, router, HA instance. I’m using a private MQTT, running Mosquitto on the same server as HA.

Upon digging into this, I remembered that I don’t have a password on my MQTT broker (Mosquitto) – because it never works. I spent another 3 hours today trying to enable authentication on Mosquitto, and while it works fine from the command line (with mosquitto_sub and mosquitto_pub), no clients can ever connect to it when I have password_file enabled and allow_anonymous set to false. I’ve gotten nowhere troubleshooting what I’ve found in Mosquitto’s logs. So for now I’ve had to allow anonymous connects to it – again – just so my whole setup will work.

But I do want to lock that down, because based on the symptoms and the fact it’s unsecured, it’s a possible attack vector for what’s going on in my house. Annnnd…while changing the password on my router, I noticed that I had a NAT rule enabled for my MQTT server back from when I was doing some development/experimenting. Which means I’ve had a MQTT broker running fully exposed, without a password, NATted to the outside world. :scream:

Still don’t know for sure that’s what caused my issue, but…wow. It sure could have. I’ll be digging through the MQTT logs if it happens again.

1 Like

Did you ever figure this out? All my lights are turning on at night. If I turn them off they will come back on. I cannot imagine someone is just turning on my lights. My system is pretty much public.

I’m sorry to barge into the conversation like that; but i’m don’t it is related to a password settings. I’ve been seeing that too. Started last weekend i’ve started switching all IoT devices to a seperate VLAN by the themselves. Im not saying that would be the solution, but that is a starting point for me to pin down the issue.

If your system is publically accessible and not behind some kind of password auth, then its very likely someone (or a bot) is turning lights on and off.

If it’s behind authentication then that’s significantly less likely. Are they zwave switches or something else? Zwave switches can get associations set up directly between devices so a motion sensor could turn on a switch even if the hub is down.

1 Like

Yes mostly zwave and a couple wemo. I only have one motion sensor set up for 1 light. Maybe I will disconnect the motion sensor and see what happens. I will also try to make it not publicly accessible.

This might not be related but if you have zwave sensors try removing the power source from them and see if the problem still persists. I’ve had several zwave sensors start acting up and whenever they sense motion all zwave devices would change state. I tried removing the sensor, pulling the entire Home Assistant folder from an older back and the problem persisted.

@brettj Unless you really understand Internet security, please take your publicly available installation offline.