snoo
snoo copied to clipboard
PubNub API support?
Thanks for creating this. Just wondering if you had any plans to support the PubNub API in order to control the Snoo?
I briefly started looking into it. It's possible to intercept the requests to PubNub (https://ps.pndsn.com) with something like mitmproxy
. The commands look simple enough, I verified something like this works:
curl -v -X POST \
"https://ps.pndsn.com/publish/pub-c-<UUID>/sub-c-<UUID>/0/ControlCommand.<NUMBER>/0?auth=<JWT>" \
-H "Content-Type: application/json" \
--data-binary '{"command": "go_to_state","hold": "off","state": "WEANING_BASELINE"}'
Of course the tricky part is figuring out where those UUIDs come from and signing the JWT.
Hey @tlrobinson, thanks for using it! I'm not planning on including PubNub support myself (mostly because my tiny human is now 6 months old and out of the snoo), but if you want to have a go at it and create a PR I'd love to include it!
Hey @tlrobinson! Do you have the pubnub code lying around? My 1mo kid is squirming more than snoo can handle. I want to write a simple Pebble app that shows status and buttons to adjust rocking. Yes it's 5am π
Hey Eric! Unfortunately I never got it working, sorry!
I am also awake on account of my little one. Unfortunately they donβt make a Snoo for 1 year olds ;)
Congratulations and good luck!
On Sat, Nov 21, 2020 at 5:55 AM Eric Migicovsky [email protected] wrote:
Hey @tlrobinson https://github.com/tlrobinson! Do you have the pubnub code lying around? My 1mo kid is squirming more than snoo can handle. I want to write a simple Pebble app that shows status and buttons to adjust rocking. Yes it's 5am π
β You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/maebert/snoo/issues/3#issuecomment-731582915, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAEOEM4LW4FSAGGS3MN2LDSQ7BGXANCNFSM4KRI4U2A .
@tlrobinson how were you able to get the uuid and create the jwt (any specific claims?). Do you have any resources so I could potentially look into this further.
Hey everyone, just FYI, since I'm a recent dad I actually implemented a similar project with pubnub support: https://github.com/rado0x54/pysnoo Happy to get some feedback! I needed a library with pubnub support because I'm writing a home-assistant integration as well and a PubSub model is cleaner to a polling-based solution.
@rado0x54 did you ever get the HASS integration done? About to get a snoo and would love to be able to control it from HASS.