I’m surprised this has not yet been done, but the Owlet Smart Sock would be a great addition to Home Assistant. The built-in features of the alert are OK, but integration to the smart home would take it to the next level.
I’ve found PoC code on github for the API so it should be fairly straightforward if some smart folks are able to pick it up.
I have this for my baby as well. I am not a programmer, but would be happy to test and write any documentation if anyone is willing to take on this project.
I have reached out to Owlet to see if they have an API documented. The initial support response is that they did not, but are forwarding my request on to their engineers FWIW.
Ok, so it looks lik Github user angel12 has made the most progress so far at https://github.com/angel12/pyowlet/tree/master/pyowlet. I created an issue to see if he needs any help with testing. I will keep you guys updated!
I have #3 on the way and was a very early adopter of the Owlet back when #1 was born. I’m very interested in getting this setup. I’ll be getting our Owlet out and starting to test the API. Assuming it is stable enough, I should be able to put together a component for HA rather quickly.
It was very reliable when we used it for #2. The biggest annoyance was if we didn’t place the sock properly. If it can’t get a reading after a certain period it plays a tone to alert you. This tended to happen more frequently as baby outgrew the size of the sock that we were using and needed to be bumped up a size.
I only recall one critical alert during the time we used it. Luckily it appeared to be a false alarm since everything was fine when we checked on baby. Definitely much more reliable regarding false alarms than the Angel Care sensors we used for #1. We ordered our Owlet before #1 arrived when it was still a Kickstarter, but it didn’t ship until after #2 was in the womb.
My biggest issue with the app is that it doesn’t offer any insight into the historical data, so we couldn’t tell if the alert we had was sudden or gradual onset but this can be fixed easily with integration into HA. I’ve already started on the component for HA and it is going very well in the time since my last post above. May have something that I can share by tomorrow evening.
Ok… I’ve got a quick component thrown together. Everything seems to be working as expected, but I’m going to play around with it and make sure everything is behaving. I will open a PR to try and get it merged into HA once I’m comfortable with it.
A few things I see that I will make a note of here that I think will need to be addressed…
Battery level can be > 100
Heart rate and oxygen levels are retained even when sock is charging. This is likely due to HA saving the last known value. Should move to unknown or other status if sock is charging.
Not sure what the Sock Off attribute is for. Could not get it to trigger.
Need to test responsiveness of updates (should not rely on HA notifications vs Owlet app for critical alerts)
Sock off is a flag for when the sock cannot get a good measurement and they assume it has fallen off.
It appears that battery level shows 120 when fully charged, but immediately drops below 100 when taken off the charger. I capped the battery level at 100 since a dedicated attribute is available for charge status.
Measurements are hidden when they are not available. Measurements are hidden if the sock is charging, if the base is off, or if motion is detected. This mostly mimics how the Owlet app behaves.
I’m pretty confident with how the component is behaving. I will be doing some more testing and will start working on documentation in preparation for a PR later in the week.
Currently, I have not identified a way to tell if the base station has lost wifi connectivity. However, the Owlet app is able to do this. Could be that the library doesn’t support it yet. Also, the library doesn’t have any methods for enabling the base station which can also be done from the app. These can be future enhancements unless somebody else has an idea on how to implement.
This is great work! Thank you for digging into this one; I’m sure dads all over will be happy to see progress on this. Having an accurate battery ‘fully charged’ reading is not nearly important as “LOW BATT” so if it is reporting in the ballpark, then I’d say that it is OK.
The most useful thing about integrating it into home assistant is to extend the alerting functionality to be combined with other automations/devices around the home. So, rather than your alarm playing a creepy and ironic lullaby you can now have it turn the lights on and/or trigger other output devices. Another good use case is to send all of the telemetry to influx_db and Grafana to visualize baby’s sleeping patterns, including the pulse/ox levels.
Tried to get this working as a custom component, but couldn’t get it to work. The good news is that the PR was merged today, so it should be ready on the next release. Hopefully everybody has a good experience with it. If you find any bugs, be sure to drop them here and tag me so I can take a look.
One thing that I still could not figure out is how to detect if the base station drops wifi connectivity. The app alerts for this condition, so not crucial, but it is currently not possible to bring this into HA.
@automateit I definitely want the data in influxdb. Will be very interesting to watch for any negative trends or situations that may not trigger an alert via the app. I agree with your thoughts on integrating with other devices around the house. This will provide a very accurate means for determining when baby is asleep so doorbell can be automatically silenced, light level can be automatically adjusted at night, or TV volume in adjacent room can be limited. I still have 5 months to test my automations and come up with new ideas. Please share if you come up with anything particularly clever.