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

High load from iBeacon uuid sensor on database #687

Closed
Ernst79 opened this issue Feb 2, 2022 · 7 comments
Closed

High load from iBeacon uuid sensor on database #687

Ernst79 opened this issue Feb 2, 2022 · 7 comments

Comments

@Ernst79
Copy link
Collaborator

Ernst79 commented Feb 2, 2022

As reported on the forum, the iBeacon is still giving a high load on the database. See https://community.home-assistant.io/t/passive-ble-monitor-integration/303583/361?u=ernst

In this issue, I try to reproduce this behavior and make some notes.

Step 1. Deleted the Database to start with a new fresh empty DB
Step 2. Restarted HA, running a database scan once per 10 minutes.
Step 3. After 20 minutes I have the following number of number of state updates. Seems to be the uuid sensor only.

image

Step 4. After 30 minutes, uuid has increased with 500 state updates, temperature and humidity only with 9 (one per minute, so 9-10 is as expected).

image

Step 5. After 40 minutes, uuid has increased with 650 state updates, temperature and humidity only with 10 (one per minute, so 9-10 is as expected).

image

Step 5. Checked the states, of MAC, major and minor, these had a state change 38 minutes ago, uuid has had a state update 4 seconds ago.

Conclusion
uuid sensor state is updated on every advertisement, while it should change on a change of the uuid (@dmamontov just copying you in, to let you know, I will also have a look myself to see if I can find out why).

@Ernst79 Ernst79 changed the title Load from iBeacon sensors on database High load from iBeacon uuid sensor on database Feb 2, 2022
@dmamontov
Copy link
Contributor

So I checked now. uuid is written only once at startup. measured power as expected, the average is calculated.

Maybe it's another apple device? which for some reason changes the uuid, and according to the statistics from the screenshots it is clear that the uuid is changing and not the mac.

@Ernst79
Copy link
Collaborator Author

Ernst79 commented Feb 2, 2022

The strange thing is that I don't see any change of the uuid sensor (both the state and all attributes stay the same). It has been the same for hours. But the last update is constantly saying a few seconds ago.

image

I'm not sure what device it is, could be an apple device, yes. I'll do some further research

@dmamontov
Copy link
Contributor

I have one suspicion. Now I'll do some debugging.

@dmamontov
Copy link
Contributor

Found. I'll send you a PR now.

@dmamontov
Copy link
Contributor

#688

@Ernst79
Copy link
Collaborator Author

Ernst79 commented Feb 2, 2022

Excellent, I also found that the uuid key didn't follow the if statement., but hadn't started solving it. Great, I'll do a final test tonight and will release it tonight.

@Ernst79
Copy link
Collaborator Author

Ernst79 commented Feb 2, 2022

Fixed in 7.5.0

@Ernst79 Ernst79 closed this as completed Feb 2, 2022
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

2 participants