Giter Club home page Giter Club logo

Comments (6)

mezz64 avatar mezz64 commented on September 1, 2024

That's the end goal. It's being written with home assistant in mind.

Just started working on it so it'll be a couple weeks at least until it gets that far. The API is a little limited so i'd be interested in what types of use cases you were hoping to get out of it.

from pyeight.

jer78 avatar jer78 commented on September 1, 2024

That's awesome! Looking forward to it. My goal is to learn Python so I can do the same thing one day. ;)

What does the API now provide? I noticed there's a smartthings integration (unofficial of course) that has sleep score, warming etc.

My use cases would be the following:

  1. I have an alarm within Home Assistant that wakes me up with a tts of my daily activities. I would integrate the last nights sleep score (for both my wife and I) and/or hours of sleep.
  2. Delay the alarm by up to 15 minutes if it senses I'm in a deep sleep vs. light sleep. (this would be really cool if it was possible)
  3. If I'm home, turn on the bed warming. I'd rather not use the auto timer in the app, because if I'm not at home there's no sense turn it on.

Thanks again for working on this!!

from pyeight.

mezz64 avatar mezz64 commented on September 1, 2024

1 and 3 are definitely possible, 2 is a maybe. Right now the api only reports certain things on an hourly basis once it determines someone is actually in the bed so it's easy to get the deep sleep data after the fact, but harder to get it in real-time.

The smartthings integration was what motivated me to get started on this without the official API being available. There are some neat things in there in terms of using the bed heating level (one of the few things that can be requested in real-time) to determine bed presence that I plan to work into the python library also.

from pyeight.

jer78 avatar jer78 commented on September 1, 2024

Awesome!! So for #2, would there be a way to pull data at a certain time? For instance, if my alarm is set to go off, could a script in Home Assistant request an update? Or do you mean, Eight Sleep doesn't actually even know until an hour after the fact because it pushes the data every hour? Somehow Eight Sleep uses it for their "Smart Alarm" in real-time. But maybe they don't expose it to their API?

from pyeight.

mezz64 avatar mezz64 commented on September 1, 2024

The intervals api endpoint does report what it thinks the current sleep state is and how long you've been in that state. Problem is that data is very dynamic while you are sleeping because of the way it's processed, so you could query it and it might say light sleep one minute and then update that past state to deep sleep once it processes more data the next time you query it.

from pyeight.

mezz64 avatar mezz64 commented on September 1, 2024

First implementation of this has been merged into home assistant. Closing this...

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.