Anyway to integrate the Nanit baby monitor?
Their stupid app will not even support landscape so when I cast it to an android TV it just sits in portrait mode lol
Anyway to integrate the Nanit baby monitor?
Their stupid app will not even support landscape so when I cast it to an android TV it just sits in portrait mode lol
Anybody have any clue how to get this going?
You ever figure it out - I really donât like Nanit wish I would have just done something simpler
Nope notha!
Iâve MITMâd the app and the API seems very formal and straight forward. I donât have time to figure it all out but can provide my findings if someone is willing and able to code the python.
I am interested in trying
I was just thinking about snooping the traffic to see how complicated it looked. Can I get a copy of the data you scraped?
Did anyone received an update on this ? Just being curious as a dad to be.
Notha
Iâll give it a crack if you can put the data somewhere?
Sorry for not responding sooner⌠some basic python code to invoke thier API and dump some data below⌠I couldnât get past this.
I tried MITMing video streams and some of the controls like light on/off⌠couldnt figure out the websocket stuffâŚ
Blockquote
import requests
import _thread
import time
import sys
import json
import pprint
loginUrl = âhttps://api.nanit.com/loginâ
babiesUrl = âhttps://api.nanit.com/babiesâ
s = requests.Session()
headers = {
âx-tc-transformâ: âtti-appâ,
âContent-Typeâ: âapplication/jsonâ,
âx-tc-transformVersionâ: â0.2â,
âAcceptâ: â/â
}
data = {âemailâ: â***@domain.comâ, âpasswordâ: âsecret_passwordâ}
r = s.post(loginUrl, headers=headers, json=data)
loginResults = json.loads(r.content.decode(âutf-8â))
authToken = loginResults[âaccess_tokenâ]
headers[âauthorizationâ] = "token " + authToken
b = s.get(babiesUrl, headers=headers)
babiesResults = json.loads(b.content.decode(âutf-8â))
pp = pprint.PrettyPrinter(indent=4)
pp.pprint(babiesResults)
ok following up iâm able to retrieve the Camera UUID
POST
Headers
âx-tc-transformâ: âtti-appâ,
âContent-Typeâ: âapplication/jsonâ,
âx-tc-transformVersionâ: â0.2â
Body:
{
"email" :"[email protected]",
"password" :"password"
}
Grab access_token
GET
https://api.nanit.com/babies
Headers:
âx-tc-transformâ: âtti-appâ,
âContent-Typeâ: âapplication/jsonâ,
âx-tc-transformVersionâ: â0.2â
âAuthorizationâ: âToken <your_access_token>â
Grab camera_uuid
GET
https://api.nanit.com/focus/cameras/<camera_uuid>/connection_status
headers:
âx-tc-transformâ: âtti-appâ,
âContent-Typeâ: âapplication/jsonâ,
âx-tc-transformVersionâ: â0.2â
âAuthorizationâ: âToken <your_access_token>â
Also I get a redirect URL when using the same headers and GET to
https://api.nanit.com/focus
ok, so
GET
(above headers)
https://api.nanit.com/babies/<baby_id>/events
returns a bunch of events in json format
baby_id can be obtained from /babies above
Great work on this. Iâm in the market for a baby monitor and being able to integrate with HA is on my list of âwould likesâ. Iâll likely end up purchasing the Nanit, not just because it seems to be the best option on the market at the moment, but because it does look like (with some work) an integration is possible.
Having used it for about 4 months (I used to have the cocoon cam but thankfully returned it before they went belly up). You do need the bands or the sleep sack to track breathing - the cocoon didnt need anything.
Iâm at about the edge of my technical capabilities, so if anyone can turn the above info into some python we should be in a good place
Itâs either the Nanit or the Miku for me at the moment. On paper, the Miku wins as thereâs no wareable required, however everyone seems to rate the Nanit over the Miku.
Iâm still a few weeks away from a purchase, but Iâll gladly help out with this when I can. Iâm a Developer, just not a python one, but Iâve been meaning to learn for a while now.
Have you seen anything in the API that might look like a camera stream?
congrats!
First one?
Re camera - yes in the events.json that is returned from the
https://api.nanit.com/babies/<baby_id>/events
there is a long list of event IDs, types of events (motion/sound) and also clip urls although not tried loading them yet.
Iâm doing this all manually through a REST API chrome extension (I should probably use Postman or something)
the base url for the video seems to be:
https://nanit-raw-videos.s3.amazonaws.com/<baby_id>/[year]/[month]/[day]/[hour]/[some number].mp4
then a long X-Amz-Security-Token which is the same
some info about the token
then some signature info which is different
(but iâm assuming not an issue as its all JSON so can be parsed easily to look at last events, or motion events only etc)
not sure if you could watch the json for new events and then create 2 binary_sensors
1 for motion
1 for sound
and then it would be cool to send the clip URL as a mobile notification alert
not got a live feed url yet though.
Yeah, first one. He was a few weeks early so heâs still in hospital at the moment, but heâs making excellent progress. Hopefully it wonât be too long until he can come home.
It sounds like youâve done most of the heavy lifting on this from a discovery point of view. I highly recommend postman. I use it on the daily and itâs such a timesaver.
I shall speak to my partner about this later and suggest we make a purchase sooner rather than later, that will at least give me some time to get my head around the API before I struggle to remember what sleep used to be like.
For some reason when I try and hit the events endpoint I get a 401 despite the other endpoints working fine.
Anyone discover the insights url?
hey awesome news
we bought the crib and set up all the stuff, of course being our first too didnât realize he doesnât sleep in the crib until 6 months plus lol (slept in a bassinet in our room until then) so you still have some time when you get home.