dgreif / homebridge-hatch-baby-rest

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

Doesn't appear to work with second generation Hatch Baby Rest #65

Closed josereyes closed 2 years ago

josereyes commented 2 years ago

I had it working well with the first gen via bluetooth, but now that I've upgraded to the second gen Hatch Rest, this config seems to have stopped working.

dgreif commented 2 years ago

Interesting, haven't heard of the 2nd Gen Rest yet. To clarify, does this model have WiFi, or is it Bluetooth only? I don't see it in their store, where did you find it to buy it?

josereyes commented 2 years ago

This model uses wifi, it's actually quite similar to Rest+, maybe even just a rebranded Rest+?

You're right that it's not browsable from the home page but it is on the website: https://www.hatch.co/restsecondgen

I got an email with that link and it shipped and arrived like overnight basically.

dgreif commented 2 years ago

Thanks for the link, looks like it definitely has wifi and is similar to the Rest+ but without the rechargeable battery. Sounds like a great light! I looked at the api and it looks like there are a few new device types that I could add support for, but what would be most helpful is if you could check your homebridge logs for some information. If you restart homebridge, you should get a log from this plugin that starts with Unsupported Light Found:. If you could post that full line of information, it would allow me to get something in place for you to test out.

bsteinbach112 commented 2 years ago

I just came here to say the same thing. I’ve got a Rest+ and now a RestV2. Only the Rest+ is shown in Homebridge. I checked the logs and so not see anything about an unsupported light. Are you referring to the running logs in Homebridge or a separate log file? Here’s what I see in terms of the Rest plug-in… C9F7CB55-A3EF-4227-8FAD-3D0404E66F81 Interesting enough, my Eero system shows that the host name for both the Rest+ and RestV2 are both “restplusXXXXXX”.

dgreif commented 2 years ago

Operating under the assumption that the Rest 2nd gen is almost identical to the Rest+, it should work with v3.3.0-beta.0. I didn't remove the Battery service, but I can clean that up I get confirmation that everything else (light/sound/etc) works as expected. Let me know when either of you get a chance to test out the beta 😄

bsteinbach112 commented 2 years ago

Thanks for the quick turnaround. Good news is that it did recognize the RestV2, but it got an error due to the battery and kept throwing errors until Homebridge rebooted and the same thing is happening. Here’s part of the error:

[26/12/2021, 16:39:30] [HatchBabyRest] Configuring 0 Rest, 1 Rest+, 0 Rest Mini, 1 Rest 2nd Gens, and 0 Restore Devices [26/12/2021, 16:39:32] [homebridge-hatch-baby-rest] This plugin generated a warning from the characteristic 'On': characteristic value expected boolean and received undefined. See https://git.io/JtMGR for more info. [26/12/2021, 16:39:32] [homebridge-hatch-baby-rest] This plugin generated a warning from the characteristic 'Battery Level': characteristic value expected valid finite number and received "undefined" (undefined). See https://git.io/JtMGR for more info. [26/12/2021, 16:39:32] TypeError: Cannot read property 'v' of undefined at /usr/local/lib/node_modules/homebridge-hatch-baby-rest/lib/rest-plus.js:13:121 at /usr/local/lib/node_modules/homebridge-hatch-baby-rest/node_modules/rxjs/src/internal/operators/map.ts:56:33 at OperatorSubscriber._this._next (/usr/local/lib/node_modules/homebridge-hatch-baby-rest/node_modules/rxjs/src/internal/operators/OperatorSubscriber.ts:43:13) at OperatorSubscriber.Subscriber.next (/usr/local/lib/node_modules/homebridge-hatch-baby-rest/node_modules/rxjs/src/internal/Subscriber.ts:75:12) at /usr/local/lib/node_modules/homebridge-hatch-baby-rest/node_modules/rxjs/src/internal/operators/filter.ts:71:107 at OperatorSubscriber._this._next (/usr/local/lib/node_modules/homebridge-hatch-baby-rest/node_modules/rxjs/src/internal/operators/OperatorSubscriber.ts:43:13) at OperatorSubscriber.Subscriber.next (/usr/local/lib/node_modules/homebridge-hatch-baby-rest/node_modules/rxjs/src/internal/Subscriber.ts:75:12) at /usr/local/lib/node_modules/homebridge-hatch-baby-rest/node_modules/rxjs/src/internal/Subject.ts:63:20 at Object.errorContext (/usr/local/lib/node_modules/homebridge-hatch-baby-rest/node_modules/rxjs/src/internal/util/errorContext.ts:29:5) at BehaviorSubject.Subject.next (/usr/local/lib/node_modules/homebridge-hatch-baby-rest/node_modules/rxjs/src/internal/Subject.ts:58:5)

dgreif commented 2 years ago

Thanks for trying it out @bsteinbach112! Based on the errors, I think the data for this light is a different format than the Rest+. I just released 3.3.0-beta.1 which will log the state for the new rest light. After you update/reboot, look for RIOT: ... in your logs and paste that whole line here. You can check through it for anything that looks like sensitive information, but based on the other lights I don't think there should be anything secret in there.

bsteinbach112 commented 2 years ago

Here's what it says: RIOT: {"env":"prod","alarmsDisabled":false,"nightlightOn":false,"nightlightIntensity":32780,"toddlerLockOn":false,"snoozeDuration":540,"current":{"srId":3724708,"playing":"routine","step":1,"color":{"i":16383,"id":235,"r":61166,"g":43690,"b":0,"w":21845,"duration":0,"until":"indefinite"},"sound":{"v":26297,"id":10137,"mute":false,"url":"https://images.hatchbaby.com/content/sounds/003_pinknoise16.wav","duration":0,"until":"indefinite"}},"dataVersion":"20211226052526807","sleepScene":{"srId":0,"enabled":false},"timer":{"s":"2021-12-26 07:25:42","d":0},"timezone":"America/Chicago","rF":{"v":"7.1.319","i":true,"u":"https://firmware.hatchbaby.com/prod/riot/riot_DFU_7_1_319.bin?f=g"},"deviceInfo":{"f":"7.1.319","fR":0,"hwVersion":"7.00"},"clock":{"i":41942,"turnOffAt":"22:00:00","turnOnAt":"07:00:00","flags":32768,"turnOffMode":"never"},"toddlerLock":{"turnOffAt":"07:00:00","turnOnAt":"19:00:00","turnOnMode":"never"},"lucky":0,"LDR":"OK","LWTP":false,"debug":0,"logging":5,"owned":true,"lastReset":"PowerOn","REX":{"lock":678248528,"key":611770275,"command":"RB"},"connected":true,"rssi":-40,"streaming":{"status":"none"}}

Homekitdude commented 2 years ago

Thinking of ordering one of these — can anyone confirm if the 2nd gen rest works with this?

dgreif commented 2 years ago

@Homekitdude it should work eventually, but I haven't gotten around to adding support yet. The details posted by @bsteinbach112 should give me a good start, I just need to find some time to do it 😄

Homekitdude commented 2 years ago

Right on! I ordered the rest mini instead — that one works right? :)

dgreif commented 2 years ago

Yep, Rest Mini is already supported

dgreif commented 2 years ago

Sorry for the delay on getting this added. The info provided by @bsteinbach112 was helpful to gauge the general format for the new light, but it looks like it is fairly complicated. It's some fun combination between the Rest Mini and the Restore light. With this in mind, I decided to order one of the lights so that I can do further data discovery without bothering any of you for extensive testing. Given the similarities to the Restore, I'm not positive that I'll be able to add color/sound controls. I went ahead and released 3.3.0-beta.2, which will give you a simple on/off switch that should activate the first "routine" you have set up for the light when you turn on the HomeKit switch (same setup we currently have for the Restore light). Let me know how it works for you!

bsteinbach112 commented 2 years ago

Thanks Dusty. That's too bad about the Rest v2. I appreciate your hard work on the plugin. I kind of wish we went with the Rest+ for an additional $10 for Christmas. I figured the Rest v2 would be better, but I'm finding it to be more complicated to use (in the app) and less functional with the features I was hoping to set up....mainly turning on different scenes using a Lutron Caseta Pico remote and Homebridge. I reached out to their support and suggested implementing Siri Shortcuts which would make this a bit easier to accomplish, but they don't have that in the roadmap. They do have Alexa skills to do all of these things. Any chance you know if Homebridge has the ability to send out Alexa commands?

kenwdelong commented 2 years ago

@dgreif LMK if you need any clarifications

dgreif commented 2 years ago

I appreciate the offer @kenwdelong! Do you happen to have any docs or other resources you could share? I just got my 2nd gen rest yesterday so I can figure out the new schema on my end, but having something a little more official would probably lead to better results 😄

kenwdelong commented 2 years ago

We don't really have any docs suitable for public consumption, unfortunately, but I can answer questions if you have any!

truncj commented 2 years ago

@dgreif first off thanks for maintaining this plug-in! I now realized that I have a Rest v2, so I installed the 3.3.0-beta.2 through homebridge. Appears to not be picking up the device

I'd be happy to debug and help get this working. Any ideas?


Edit: It turns out I have a Hatch v1 despite purchasing it last month. Plugin is working perfectly!

Hatch related logs below:


[3/12/2022, 11:27:43 PM] Loaded plugin: homebridge-hatch-baby-rest@3.3.0-beta.2
[3/12/2022, 11:27:43 PM] Registering platform 'homebridge-hatch-baby-rest.HatchBabyRest'
[3/12/2022, 11:27:43 PM] ---
[3/12/2022, 11:27:43 PM] [HatchBabyRest] Initializing HatchBabyRest platform...
[3/12/2022, 11:27:43 PM] Loading 1 accessories...
[3/12/2022, 11:27:44 PM] [HatchBabyRest] Configuring 0 Rest, 0 Rest+, 0 Rest Mini, 0 Rest 2nd Gens, and 0 Restore Devices```
dgreif commented 2 years ago

Sorry for the long delay on this feature, but Rest 2nd Gen should be working with 3.3.0 🚀. Much like the Restore, the data types from Hatch don't line up super well with what is available in HomeKit. When you add a Rest 2nd Gen, you will simply see a switch. When turned on, it will turn on your first favorite. Turning it off will turn off the light/sound. Hopefully this is enough for most peoples use case 😄