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

[Experimental] Use ruuvi tag experimental bleson BLE interface (Requires python build) #4

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

sergioisidoro
Copy link
Member

I was experimenting with this branch:
ttu/ruuvitag-sensor#72

It needs python built with support for bluetooth (eg. libbluetooth or bluez-dev)

This is based on previous work with #3

@sergioisidoro
Copy link
Member Author

To work it needs this: home-assistant/docker-base#53

@peltsippi
Copy link

Got all my ruuvitags to appear with this version after some small adjustments. I'll do stability testing and let you know if there are any issues.

@sergioisidoro
Copy link
Member Author

That's awesome!

@peltsippi can you share your setup? Are you running HASS.io image, HASS.io on raspbian, or running home assistant directly on raspbian?

@peltsippi
Copy link

I have installed python venv to raspbian and homeassistant with pip. And all kinds of modifications while tinkering with btle etc.

Using standard poll interval with 5 ruuvitags originally, I got something around 24 hours without sensor data collection stopping which is better than the no-python version with longer poll intervals (60 secs). And now I've increased poll_interval: 60 for each sensor and I am somewhere around 30+ hours mark at the moment without any issues.

@peltsippi
Copy link

15 minutes to 72 hour mark with 60sec poll interval, zero entries in log after the first warning about custom sensor component.

So it seems to work really well. I'll continue monitoring, let's see if I meet hass general stability with my own experimental stuff running before there are entries about issues with this one.

@peltsippi
Copy link

80 hours and data collection stopped. Need to go through hass documentation later on if there would be a way to reset something and get btle scans working again without reboots.

@sergioisidoro
Copy link
Member Author

sergioisidoro commented Feb 22, 2020

@peltsippi Found the reason.

This lib uses get_data_for_sensors which spins up a process every time it is called. This is problematic as it will probably reach the max sockets / open files.

https://github.com/ttu/ruuvitag-sensor#get-data-for-specified-sensors (See the NOTE)

I'm working and testing a fix. I'll keep you posted

@peltsippi
Copy link

I found one issue with ruuvitag that sometimes has strong enough signal and sometimes not: if sensor is not visible during update interval (30 secs) it seems to be halting whole scanning operation with repeatable error messages concerning exceeding max update interval.

@peltsippi
Copy link

I tested the new version partly on python console and I can not figure out what causes the issue. Inputs to sensor.py seem to be ok and I cannot find any problems in logic within data collection functions etc with quick glance. I'll keep digging.

@sergioisidoro
Copy link
Member Author

@peltsippi maybe revert that 5f493b9 commit because it might have introduced broken things.

@sergioisidoro
Copy link
Member Author

Also feel free to drop by here: ttu/ruuvitag-sensor#72 as the discussion is quite relevant

@peltsippi
Copy link

I am working on setting ha into VM on my laptop to get any testing or debugging done without huge hassle. It should be running next week and I can test things out then.

@sergioisidoro
Copy link
Member Author

sergioisidoro commented Mar 28, 2020

@peltsippi So, I got a bit tired of chasing my tail and decided to start from "scratch"

I ended up forking https://github.com/ttu/ruuvitag-sensor and greatly simplifying it for the bleson usecase - The work is here https://github.com/sergioisidoro/simple-ruuvitag

I also forked this repo and made some house re-arrangement so that only one platform would be spawn in HASS - https://github.com/sergioisidoro/hass-ruuvi

So far it has been running for a few hours with 4 sensors and it has been one of the most stable solutions I've found so far.

Needless to say those projects are really new and they might be riddled with bugs. But feel free to poke around 👍

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

Successfully merging this pull request may close these issues.

2 participants