Zigbee light turning on by itself

I’m on 2021.10.5, core install in a virtualenv, nginx reverse proxy with letsencrypt, and I’m using a HUSBZB-1 for zigbee. I’ve used this setup happily for several years.

I have a zigbee light that has suddenly started decided to turn on by itself, every morning and every evening around 6:00 (not exactly, it varies, but only in the morning and evening roughly 12h apart).

Here’s a few times that I’ve noticed it happening over the last few days; it’s happened more often than this (every day morning and evening), these are just the times that I thought to write it down:

Date Time notes
10/16/21 18:10:43
10/17/21 06:42:38
10/17/21 18:12:35
10/18/21 06:47:26
10/18/21 18:07:24
10/19/21 06:42:30
10/24/21 06:44:30
10/24/21 17:58:03 Sunset was 18:26 per Siri
10/25/21 06:40:50
10/26/21 06:50:37
10/26/21 17:58:45
10/27/21 06:44:44

As you can see if varies a bit but is pretty consistent, and it is not exactly at sunset.

I’ve read through a few other posts:

As well as some post I can’t find right now about a sunup / sundown service.

Since this happened, I have not made any changes to my config or set – no new automations, no new hardware, I’ve reviewed all my automations 3 or 4 times to make sure it’s not something I forgot about.

I don’t unusual logins or login attempts, I have 2FA enabled, I don’t see any unusual processes to suggest this is the result of tampering or hacking.

The logs say that it is me turning them on and off, so it’s not just someone turning the light on manually (in which case the log doesn’t specify that it was me, I checked). I attached a screenshot showing that there’s nothing else happening about the same time.

I don’t see other issues posted at GitHub, so I assume it’s nothing to do with 2021.10.5.

The zigbee stick and light are both in the same location they’ve been for 5 years (and never done this before), so I don’t see why it would suddenly be a weak signal problem.

Any ideas? Many thanks in advance!

Lots of things to check, other automations (unlikely cause), new CRON jobs, service restarts (on the system), new devices recently (phone/app updates tied to devices) but the skies the limit.

Sorry, I should have also mentioned that I’ve enabled debug logs, and I see lots of stuff but not anything that seems obviously out of line (though a lot I don’t understand).

No new cron jobs or systemd services.

Device is not restarting – examined router and systemd logs.

New iPhones, but no new automations / shortcuts. I’ll double check this though.

I’ll try removing and repairing the device and keep my fingers crossed.

(For future readers, I had to find the IEEE - it was under ConfigurationDevices → my light.

I have had about 10 devices fail (z-wave) in 7 years mostly 1st gen Jasco. Could be a bad device.

I’m thinking the same. I have a similar issue with a Sengled bulb. I have a Sengled LED strip next to it that’s been troublesome. Unplug the strip, bulb behaves.

I have had devices flash on and off, devices quit working, random automation lock-ups and the whole network get jammed up, etc. This is no limit to the chaos that a bad z-wave device (or zigbee) can do to you network.

1 Like

Behavior persisted this morning after removal and re-adding.

I’m thinking bad device seems less likely since HomeAssistant specifically notes that I am turning the device on and off; as I noted above, when I toggle the device manually, it doesn’t specify that anyone is doing it. Also doesn’t it seem odd that it’s almost exactly 12 hours apart, 0600 and 1800? Does the device have a clock built in?

Example debug logs from the event at 10/27/21 06:44:44 that I noted above.

Oct 27 06:44:43  python[4684]: 2021-10-27 06:44:43 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=light, service=turn_on, service_data=entity_id=light.kitchen_light>
Oct 27 06:44:44  python[4684]: 2021-10-27 06:44:44 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=light.kitchen_light, old_state=<state light.kitchen_light=off; supported_color_modes=['brightness'], off_brightness=None, friendly_name=kitchen light, supported_features=41 @ 2021-10-26T18:21:06.980303-06:00>, new_state=<state light.kitchen_light=on; supported_color_modes=['brightness'], color_mode=brightness, brightness=254, off_brightness=None, friendly_name=kitchen light, supported_features=41 @ 2021-10-27T06:44:44.040629-06:00>>
Oct 27 06:44:44  python[4684]: 2021-10-27 06:44:44 DEBUG (MainThread) [homeassistant.components.homekit.accessories] New_state: <state light.kitchen_light=on; supported_color_modes=['brightness'], color_mode=brightness, brightness=254, off_brightness=None, friendly_name=kitchen light, supported_features=41 @ 2021-10-27T06:44:44.040629-06:00>
Oct 27 06:44:44  python[4684]: 2021-10-27 06:44:44 DEBUG (MainThread) [homeassistant.components.zha.entity] light.kitchen_light: turned on: {'on_off': [1, <Status.SUCCESS: 0>]}

Home assistant is turning it on. Check your automations. Home assistant only turns things on via automations, scripts, template entities. It’s somewhere in your config. Look at all your actions that are turning on that light and find out which automation is causing it.

Yes, I agree! But there haven’t been any relevant config changes. Looking at git log --since="1 month ago" --patch -- ./config – this has been going on for 2 weeks or so; the only changes to my config during that time have been updating hass and adding an automation for a different entity (which I initially misnamed light.halloween_lights and subsequently fixed → switch.halloween_lights, an, esphome wifi switch).

I have minimal automations that involve lights – one for my porch light (a zwave device), and none of those have changed. The remainder of results are for blueprints (which I haven’t used yet) or for the UI.

$ grep -n -r -i '\blight\..*' -- ./config/**/*.yaml
config/automations.yaml:36:    service: light.turn_on
config/automations.yaml:37:    entity_id: light.porch_light
config/automations.yaml:45:    service: light.turn_off
config/automations.yaml:46:    entity_id: light.porch_light
config/blueprints/automation/homeassistant/motion_light.yaml:41:  - service: light.turn_on
config/blueprints/automation/homeassistant/motion_light.yaml:49:  - service: light.turn_off
config/lovelace-ui.yaml:53:          - entity: light.porch_light
config/lovelace-ui.yaml:54:          - entity: light.kitchen_light
config/lovelace-ui.yaml:116:      - entity: light.air_conditioner_blue_led
config/lovelace-ui.yaml:118:      - entity: light.air_conditioner_red_led
config/zwave_device_config.yaml:1:light.porch_light:
config/zwave_device_config.yaml:4:light.linear_unknown_type_4754_id_3038_level:

EDIT:

Nothing referring specifically to this entity other than the UI:

$ grep -a -n -r -i '\bkitchen_light\b' -- ./config/**/*.yaml
./config/lovelace-ui.yaml:54:          - entity: light.kitchen_light

You don’t have any scripts with variables? No home_assistant.turn_ons?

Actually, your image shows that it was turned on by the Nathan Henrie, i.e. someone logged into HA, i.e. a UI dashboard.

Nope, only lights and switches:

$ grep -rho '\S*\.turn_on\b' -- ./config/**/*.yaml | sort -u
light.turn_on
switch.turn_on

That’s me. I have 2FA enabled, a long complex randomly generated password. I don’t see anything obviously out of line in /var/log/nginx/{access,error}.log; a few calls to webhooks that I’ve been able to trace back to my iPhone and the iOS app. I have ip bans enabled for failed logins and nothing new there.

That’s my point, it’s one of your UI logins. It’s coming from your user. Not an automation, not a script. You or someone pressing the button. I’d start by looking at your devices. Possibly create new logins for each device to narrow down which one it is.

Right, I was trying to determine if someone else could be logging in (i.e. a security breach).

I don’t see how that’s possible. It’s often happening before I’m awake in the morning. My devices all have fingerprint or face authentication; only people in the house are my wife (not a big tech user) and young children, who are also asleep when this happens.

Could this be something working by a long-lived access token? Or would that show up differently?

let say it was, it would still have to be something pressing it around the same time every day. Seems… automated. Do you have alexa? Google Home? Anything outside HA connected using your loging?

I agree! Seems very odd to be the same time of day!

Yes, I have Alexa, Homekit, and fauxmo, and I’ve checked all three – no relevant Alexa routines or HomeKit automations on both mine and my wife’s devices, nothing in the fauxmo config or logs. ¯\(ツ)

Well I don’t think it would be homekit. If fauxmo doesn’t use auth to ‘log into’ home assistant, then that’s not it. And alexa does use auth. Did you use your login for alexa or did you create a separate alexa login? I’d recommend doing that. Then actions will show up in the logs as her doing things instead of you.

image

1 Like

No, I’m pretty sure I wasn’t comfortable leaving my Amazon password sitting around (and they don’t support app-specific passwords AFAIK), so all my Alexa → Hass integrations go through Fauxmo, which uses a long-lived token with urllib.request and a Authorization: Bearer header under the hood. And I don’t have Fauxmo configured to use this device at all, and nothing in the logs about any devices being toggled at this time.

Truly a mystery!

Uh, that’s not how the alexa app connects to home assistant… Not sure where you got that impression from. When you connect alexa to HA, you use the home assistant app inside alexa’s skills and the auth uses your HA login or a separate login that you create specific to alexa.

Oh, sorry – I had it confused with https://github.com/custom-components/alexa_media_player, which I had looked into for TTS. (Fauxmo does simple belkin emulation which it sufficient for toggling of switches via voice and good enough for my purposes, I don’t have any other Alexa integration so I think I can rule that one out).

I’ve removed, re-added, and reconfigured the device again, we’ll see if it switches on again this evening.

EDIT: Also, thanks a ton for your time and responses. I’ve been using hass for a long time but this one really has me scratching my head.