Closed christianglodt closed 1 year ago
I noticed the same since updating to 2023.02.x release. Checked all my automations, nothing is turning it on. The only log I have related to this integration is below.
Logger: homeassistant.components.switch
Source: helpers/entity_platform.py:822
Integration: Switch (documentation, issues)
First occurred: 11:20:13 AM (1 occurrences)
Last logged: 11:20:13 AM
Updating presence_simulation switch took longer than the scheduled update interval 0:00:05
In logbook it simply shows up as
Turned on
11:19:48 AM - 39 minutes ago
I can confirm the problem with 2023.2.2 as well
Issue stopped for me randomly now just like it started after updating to 2023.2.2.
I'm in 2023.2.1 but I don't have the issue. Could maybe someone try to turn the simulation off, restart with the logger in debug and send me the log file? Thanks
As far as I've seen, it resolves that presence simulation was on before the shutdown. But I'me sure it wasn't. I can't try it again if you need it.
Would it be possible for you to run this query on the DB (assuming you have MySql ?):
select * from states, state_attributes where states.attributes_id = state_attributes.attributes_id and states.entity_id = 'switch.presence_simulation' order by states.last_updated desc limit 10;
I use sqlite instead of MySql, but the query runs on sqlite as well. Here's the resulting output: sqlite.txt
Ok I may have something. In your DB, the states.last_update
are all null. On mysql, apparently the result appear in the expected order, i.e. the earliest at the beginning, but in your sqlite result, that's the opposite, and the oldest is the first one. So it will always the oldest record, which has a 'on' state.
I see a new column in the State table, which is last_updated_ts
, I need to use that one instead of last_updated
.
This has been changed by this PR.
I'll try to adapt this asap.
Fixed in v2.3 Thanks all for your help
Tested v2.3 with 2023.2.2 and 2023.2.3 and the fix works with both. Thanks a lot for the quick fix @slashback100
Hello, I just installed and setup this integration (v2.4) , and noticed that after a restart of HA it turn's ON the presence_simulation switch, wondering if this bug been re-introduced ?
Please open a new issue and provide logs during the restart. Thanks
I've noticed in the last week or so that the presence simulation starts automatically when Home Assistant is started/restarted.
I'm on Home Assistant 2023.2.2.
This definitely didn't use to happen anymore (since #58 was fixed). And I don't have any automation that starts it.
I see the following error in the log that seems related to the presence_simulation_scene, maybe that's related: