Giter VIP home page Giter VIP logo

Comments (8)

mezz64 avatar mezz64 commented on September 24, 2024

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.

rafale77 avatar rafale77 commented on September 24, 2024

sorry, I've been out. I will provide it to you as soon as I reproduce the problem (it is intermittent)

from pyeight.

rafale77 avatar rafale77 commented on September 24, 2024

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?
Screen Shot 2019-06-10 at 7 38 44 AM

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.

mezz64 avatar mezz64 commented on September 24, 2024

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.

rafale77 avatar rafale77 commented on September 24, 2024

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.

rafale77 avatar rafale77 commented on September 24, 2024

Screen Shot 2019-06-17 at 8 11 56 AM

see the problem here

from pyeight.

mezz64 avatar mezz64 commented on September 24, 2024

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.

rafale77 avatar rafale77 commented on September 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.