Comments (6)
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.
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:
- 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.
- 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)
- 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.
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.
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.
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.
First implementation of this has been merged into home assistant. Closing this...
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
- Bed Presence update HOT 8
- 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.