dgreif / homebridge-hatch-baby-rest

A homebridge plugin for Hatch Baby Rest night light
MIT License
74 stars 19 forks source link

More HatchBaby API Details? #19

Closed 2StephenWood closed 4 years ago

2StephenWood commented 4 years ago

Hi @dgreif ,

First off, sorry, I know this is not the right place for this question, but I could not find another way to contact you. Second, great work on this project! I don't actually use homebridge, but I love working on Amazon IOT platform and home automation.

I am actually wondering if you have any additional details on the HatchBaby API. I'd like to write some code to pull my baby's stats and plot things in Google Docs to find trends like certain times of the day our little one eats more than other times. I can export the data from the app, but I have to manually do that every time I want to update my stats, so I'm hoping to find an API to pull the data. I stumbled upon your project in my search. How did you find details about the API to control the Rest+? Is there Swagger docs or similar for the HatchBaby API? I'm hoping if they have the Rest+ API they might have API to get my data stored in the platform as well.

If I can find the time, I think I'll also setup a custom Alexa smart skill for my Rest+ so that it shows up as a normal Alexa smart device. I'm not sure why HatchBaby didn't do that to begin with. I hate having to say "Alexa, tell hatchbaby too..." instead of just "Alexa turn on rest". Also I'd like to add the Rest+ to some routines :)

If you'd prefer to chat over email, shoot me an email using my git-hub username + @gmail.com

Thanks for your time and contributions to the community!

dgreif commented 4 years ago

@2StephenWood thanks for reaching out, and sorry I didn't get a chance to reply sooner. For this project, I did a lot of "observation" on how the hatch baby rest app interacts with their API to determine how the API works. As far as I know, they do not have any official documentation to look at unfortunately. My original work for the bluetooth hatch baby rest was based on the work from this blog post: https://m4rc.us/2017/09/13/the-first-rest-api-for-the-hatch-baby-rest/ and this repo that goes with it: https://github.com/Marcus-L/m4rcus.HatchBaby.Rest. If you read through the blog post, it seems like hatch is actually pretty willing to work with developers if you reach out, but I was able to accomplish everything I wanted to without reaching out. Unfortunately I don't have a hatch Grow so I can't say how the API for that one works. If you are interested in interacting with the Rest+ and want to do some from Javascript, I can definitely refactor this project to export the Rest+ api for external use

2StephenWood commented 4 years ago

@dgreif , thanks for the reply! No worries at all on the delay :). I think I will reach out to Hatchbaby and see what they come back with. I've seen a few other posts that also make me think they'd be pretty open to working with developers. Your offer of an external interface for Rest+ api is very generous! I'm actually an embedded C programmer by day and Python tinkerer by night and weekend, leaving my JavaScript skills pretty lacking for now haha. I think I've got enough of the important bits from your code here to make a rudimentary Python interface, but again thanks for the offer!