presence_simulation
presence_simulation copied to clipboard
Device goes on/off multiple times
When a device has to go on, it goes on/off multiple times: SK links turned off triggered by service Light: Turn off 2:54:59 PM - 2 minutes ago SK links turned on triggered by service Light: Turn on 2:54:58 PM - 2 minutes ago SK links turned off triggered by service Light: Turn off 2:54:58 PM - 2 minutes ago SK links turned on triggered by service Light: Turn on 2:54:57 PM - 2 minutes ago SK links turned off triggered by service Light: Turn off 2:54:54 PM - 2 minutes ago SK links turned on triggered by service Light: Turn on 2:54:53 PM - 2 minutes ago SK links turned off triggered by service Light: Turn off 2:54:53 PM - 2 minutes ago SK links turned on triggered by service Light: Turn on 2:54:52 PM - 2 minutes ago SK links turned off triggered by service Light: Turn off 2:54:42 PM - 2 minutes ago SK links turned on triggered by service Light: Turn on 2:54:41 PM - 2 minutes ago SK links turned off triggered by service Light: Turn off 2:54:41 PM - 2 minutes ago SK links turned on triggered by service Light: Turn on 2:54:40 PM - 2 minutes ago SK links turned off triggered by service Light: Turn off 2:54:40 PM - 2 minutes ago SK links turned on triggered by service Light: Turn on 2:54:39 PM - 2 minutes ago This happens with multiple lights. How can I avoid this behaviour?
Could you please active the debug mode, start the simulation, reproduce the issue and send me the log file?
This problem is not all the time. But this weekend we where not at home. I made a log at the moment it happened. How can I send it to you?
Can't you attach it here on the issue ?
Too big to be attached. This is a link to the file: https://drive.google.com/file/d/1uR-JOfawI_QgTKqLldjVjEA64JgHE7C-/view?usp=sharing
Hard to figure out what is the problem, I miss in the logs the start of the simulation. If I looked at the historic event considered by the simulation, I have 38 event for the light G1, and as far as I can see, it is 3 different events that appears several times in a random order... and all are 'off' state event (so it should have any impact). If I filter out those events and keep only what changes :
'linkquality': 57, 'last_changed': '2024-04-23T23:23:59.104192+00:00', 'last_updated': '2024-04-23T23:24:24.033013+00:00'
'linkquality': 57, 'last_changed': '2024-04-23T23:23:59.104192+00:00', 'last_updated': '2024-04-23T23:34:30.123371+00:00'
'linkquality': 60, 'last_changed': '2024-04-23T23:23:59.104192+00:00', 'last_updated': '2024-04-23T23:24:29.020669+00:00'
'linkquality': 60, 'last_changed': '2024-04-23T23:23:59.104192+00:00', 'last_updated': '2024-04-23T23:24:29.020669+00:00'
'linkquality': 57, 'last_changed': '2024-04-23T23:23:59.104192+00:00', 'last_updated': '2024-04-23T23:34:30.123371+00:00'
'linkquality': 57, 'last_changed': '2024-04-23T23:23:59.104192+00:00', 'last_updated': '2024-04-23T23:34:30.123371+00:00'
'linkquality': 57, 'last_changed': '2024-04-23T23:23:59.104192+00:00', 'last_updated': '2024-04-23T23:34:30.123371+00:00'
'linkquality': 60, 'last_changed': '2024-04-23T23:23:59.104192+00:00', 'last_updated': '2024-04-23T23:24:29.020669+00:00'
'linkquality': 57, 'last_changed': '2024-04-23T23:23:59.104192+00:00', 'last_updated': '2024-04-23T23:34:30.123371+00:00'
'linkquality': 57, 'last_changed': '2024-04-23T23:23:59.104192+00:00', 'last_updated': '2024-04-23T23:34:30.123371+00:00'
'linkquality': 57, 'last_changed': '2024-04-23T23:23:59.104192+00:00', 'last_updated': '2024-04-23T23:24:24.033013+00:00'
'linkquality': 57, 'last_changed': '2024-04-23T23:23:59.104192+00:00', 'last_updated': '2024-04-23T23:24:24.033013+00:00'
'linkquality': 57, 'last_changed': '2024-04-23T23:23:59.104192+00:00', 'last_updated': '2024-04-23T23:34:30.123371+00:00'
'linkquality': 60, 'last_changed': '2024-04-23T23:23:59.104192+00:00', 'last_updated': '2024-04-23T23:24:29.020669+00:00'
'linkquality': 60, 'last_changed': '2024-04-23T23:23:59.104192+00:00', 'last_updated': '2024-04-23T23:24:29.020669+00:00'
'linkquality': 57, 'last_changed': '2024-04-23T23:23:59.104192+00:00', 'last_updated': '2024-04-23T23:34:30.123371+00:00'
'linkquality': 57, 'last_changed': '2024-04-23T23:23:59.104192+00:00', 'last_updated': '2024-04-23T23:24:24.033013+00:00'
'linkquality': 57, 'last_changed': '2024-04-23T23:23:59.104192+00:00', 'last_updated': '2024-04-23T23:34:30.123371+00:00'
'linkquality': 57, 'last_changed': '2024-04-23T23:23:59.104192+00:00', 'last_updated': '2024-04-23T23:34:30.123371+00:00'
'linkquality': 57, 'last_changed': '2024-04-23T23:23:59.104192+00:00', 'last_updated': '2024-04-23T23:24:24.033013+00:00'
'linkquality': 60, 'last_changed': '2024-04-23T23:23:59.104192+00:00', 'last_updated': '2024-04-23T23:24:29.020669+00:00'
'linkquality': 60, 'last_changed': '2024-04-23T23:23:59.104192+00:00', 'last_updated': '2024-04-23T23:24:29.020669+00:00'
'linkquality': 57, 'last_changed': '2024-04-23T23:23:59.104192+00:00', 'last_updated': '2024-04-23T23:24:24.033013+00:00'
'linkquality': 60, 'last_changed': '2024-04-23T23:23:59.104192+00:00', 'last_updated': '2024-04-23T23:24:29.020669+00:00'
'linkquality': 60, 'last_changed': '2024-04-23T23:23:59.104192+00:00', 'last_updated': '2024-04-23T23:24:29.020669+00:00'
'linkquality': 57, 'last_changed': '2024-04-23T23:23:59.104192+00:00', 'last_updated': '2024-04-23T23:34:30.123371+00:00'
'linkquality': 57, 'last_changed': '2024-04-23T23:23:59.104192+00:00', 'last_updated': '2024-04-23T23:34:30.123371+00:00'
'linkquality': 60, 'last_changed': '2024-04-23T23:23:59.104192+00:00', 'last_updated': '2024-04-23T23:24:29.020669+00:00'
'linkquality': 57, 'last_changed': '2024-04-23T23:23:59.104192+00:00', 'last_updated': '2024-04-23T23:34:30.123371+00:00'
'linkquality': 57, 'last_changed': '2024-04-23T23:23:59.104192+00:00', 'last_updated': '2024-04-23T23:34:30.123371+00:00'
'linkquality': 60, 'last_changed': '2024-04-23T23:23:59.104192+00:00', 'last_updated': '2024-04-23T23:24:29.020669+00:00'
'linkquality': 57, 'last_changed': '2024-04-23T23:23:59.104192+00:00', 'last_updated': '2024-04-23T23:34:30.123371+00:00'
'linkquality': 57, 'last_changed': '2024-04-23T23:23:59.104192+00:00', 'last_updated': '2024-04-23T23:34:30.123371+00:00'
'linkquality': 60, 'last_changed': '2024-04-23T23:23:59.104192+00:00', 'last_updated': '2024-04-23T23:24:29.020669+00:00'
'linkquality': 60, 'last_changed': '2024-04-23T23:23:59.104192+00:00', 'last_updated': '2024-04-23T23:24:29.020669+00:00'
'linkquality': 57, 'last_changed': '2024-04-23T23:23:59.104192+00:00', 'last_updated': '2024-04-23T23:34:30.123371+00:00'
'linkquality': 57, 'last_changed': '2024-04-23T23:23:59.104192+00:00', 'last_updated': '2024-04-23T23:34:30.123371+00:00'
'linkquality': 57, 'last_changed': '2024-04-23T23:23:59.104192+00:00', 'last_updated': '2024-04-23T23:34:30.123371+00:00'
Could you please run the following query and send me the result ?
select s.state_id, s.state, from_unixtime(s.last_updated_ts), from_unixtime(s.last_reported_ts), a.shared_attrs
from states s
join states_meta m on m.metadata_id = s.metadata_id
join state_attributes a on a.attributes_id = s.attributes_id
where m.entity_id = 'light.g1'
order by s.last_reported_ts desc;
Sorry to ask, but how do I do that?
What DB are you using? sqlite? Mysql?
I don't know. I have only HA running on a SSD on a RPI4. How can I find out?
You probably run on sqlite then. You can check that in your configuration.yaml
under recorder:
. Is your db_url:
an sqlite protocol?
If that's the case, the query should be adapted:
SELECT s.state_id, s.state, datetime(s.last_updated_ts, 'unixepoch'), datetime(s.last_reported_ts, 'unixepoch'), a.shared_attrs
FROM states s
JOIN states_meta m ON m.metadata_id = s.metadata_id
JOIN state_attributes a ON a.attributes_id = s.attributes_id
WHERE m.entity_id = 'light.g1'
ORDER BY s.last_reported_ts DESC;
You have to install sqlite3, type in a command line
sqlite3 path_to_your_sqlite_database.db
And execute above query
There is no recorder: in my configuration.yaml
That was unexpected :-) What is your HA installation? HA OS, HA Core, HA Docker, HA Supervisor ?
Same problem here with external MariaDB (because I have a separate backup for the database)
sorry about late reply. Tested several weekends when away. Problem is there after 1 or 2 days running. It even gifs problems to z2m stop working. I now have the presense simulation on when dark and off when daytime when I am away. I will see how that is going and report after a few weeks testing.