Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Device goes on/off multiple times #125

Open
Peterpc58 opened this issue Apr 17, 2024 · 13 comments
Open

Device goes on/off multiple times #125

Peterpc58 opened this issue Apr 17, 2024 · 13 comments

Comments

@Peterpc58
Copy link

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?

@slashback100
Copy link
Owner

Could you please active the debug mode, start the simulation, reproduce the issue and send me the log file?

@Peterpc58
Copy link
Author

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?

@slashback100
Copy link
Owner

Can't you attach it here on the issue ?

@Peterpc58
Copy link
Author

Too big to be attached.
This is a link to the file:
https://drive.google.com/file/d/1uR-JOfawI_QgTKqLldjVjEA64JgHE7C-/view?usp=sharing

@slashback100
Copy link
Owner

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;

@Peterpc58
Copy link
Author

Sorry to ask, but how do I do that?

@slashback100
Copy link
Owner

What DB are you using? sqlite? Mysql?

@Peterpc58
Copy link
Author

I don't know. I have only HA running on a SSD on a RPI4.
How can I find out?

@slashback100
Copy link
Owner

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

@Peterpc58
Copy link
Author

There is no recorder: in my configuration.yaml

@slashback100
Copy link
Owner

slashback100 commented May 8, 2024

That was unexpected :-)
What is your HA installation? HA OS, HA Core, HA Docker, HA Supervisor ?

@Big-Gremlin
Copy link

Same problem here with external MariaDB (because I have a separate backup for the database)

@Peterpc58
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants