Comments (8)
Please provide a snapshot of the reported bed level the next time it happens. That is the value used internally by pyEight to figure out whether or not someone is in bed.
from pyeight.
sorry, I've been out. I will provide it to you as soon as I reproduce the problem (it is intermittent)
from pyeight.
Just had the problem: I am getting it down to 36% and it still shows I am in bed while I have been long out of bed. Maybe the determination should be based on the slope (derivative) of the drop over a few points?
Somehow if I restart Hass, It immediately shows the sensor to be off even though the value is 35% vs 36%? Is there a hysteresis between the on and off value?
from pyeight.
I use the delta over the last 4 readings (I fetch updated data once a minute so we don't hammer the Eight API) and a threshold of being below 50% to indicate a change from in bed to out of bed. In early testing I found anything more aggressive resulted in false triggers while in bed.
In this scenario, does it ever switch to out of bed? If so, how long does it take?
from pyeight.
Hmm it's interesting. I found that the detection of in bed presence is pretty good but it is the switch out which is unreliable. As you can see on the previous day, it worked pretty well. I found that in many cases, it never switch out even though the level is already very low. Strangely the absolute threshold does not work. I have observed mine to go down to 35% and still indicating the sensor to be on.
from pyeight.
see the problem here
from pyeight.
It's not an absolute threshold, it only starts to check the deltas once the sensor goes below 50%. You will never see it change prior to that.
This is the portion of code in action. The fail-safe at the moment is 15% or less to switch off no matter what. Does that scenario work for you?
elif self.presence:
if self.heating_level <= 15:
# Failsafe, very slow
self.presence = False
elif self.heating_level < 50:
if self.past_heating_level(0) - self.past_heating_level(1) < 0 \
and self.past_heating_level(1) - self.past_heating_level(2) < 0 \
and self.past_heating_level(2) - self.past_heating_level(3) < 0:
# Values are decreasing so we are likely out of bed
self.presence = False
from pyeight.
15% seems a bit high... and it seems like are looking for 3 consecutive value decrease it appears once it gets below 50% but what I have observed is that the value still bounces up and down (say 40-41-39-38-40) at the frequency it is being pinged so even if over time it is decreasing it still fails to untrip the presence sensor. You can see that the slope is much sharper when it is above 50. Maybe you could build a logic where one of the 3 can increase but 0-3 still is <0?
from pyeight.
Related Issues (20)
- Pod Support HOT 9
- Issues when bed is set to "both" instead of left or right. HOT 8
- Presence Detection fails with POD HOT 1
- Feature Suggestion: Vibration Control for Pod Pro HOT 15
- 'NoneType' object is not subscriptable HOT 5
- Can't turn on the heat HOT 7
- Intermittent connection failures HOT 2
- Support for local non-cloud connection HOT 5
- initialization fails due to 403 when partner is not sharing data
- [Feature Request] Add support for enabling and disabling "Away Mode" HOT 3
- Did the new app update break things HOT 2
- API and App data discrepancy HOT 1
- Some API reversing discoveries: HOT 4
- Set away mode HOT 1
- Home Assistant Single Sleeper HOT 2
- Error putting Eight data HOT 3
- Parameters EightUser class HOT 1
- KeyError: 'rightUserId' HOT 2
- Unable to authenticate and fetch eight token HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyeight.