tsightler / ring-mqtt

Ring devices to MQTT Bridge
MIT License
582 stars 104 forks source link

Support for Ring Retro Kit #45

Closed mattb112 closed 4 years ago

mattb112 commented 4 years ago

At the moment the sensors aren't picked up by this solution even though it's not a 3rd party device. Hopefully support can be added.

tsightler commented 4 years ago

I have no need for this device thus I have no plans to acquire one. To be able to add support I would need someone that has one to send me the output of the devices so that I can determine how to detect and classify them. My suspicion is that it will show up as a single device with 8 "zones" that can be toggled open/closed and thus probably easy to support at least in some basic way. I'd also be interested in seeing how it appears in the Ring app.

If you are able/willing to share these details with me I'd be happy to take a stab at adding support for it, assuming it's easy. Feel free to reach out to me directly using my github username at gmail and I can provide some more details on exactly what I would need.

mattb112 commented 4 years ago

I think I sent you what you asked for. If you need anything more please let me know. Also thanks for the quick reply and a huge THANKS for looking into it.

tsightler commented 4 years ago

Hey Matt, I've pushed an update that should support Retro kit zones. There was no device class that matched perfectly with zones so "safety" seemed the closest, however, I'm open to suggestions here, and of course this only sets the default icon, it's always possible to override it.

Note that the retro kit bridge itself will not appear. I could perhaps add it to at least monitor the tamper/battery status, so I'll keep this aside as a potential future enhancement.

Also, I decided to only actively "enabled" zones in the HA interface. It appears that the device supports 8 zones, but I'm going to guess lots of people will use a smaller number of zones, this way you don't have a lot of unused devices appearing in the UI that you have to hide manually. If people think it's better to just always display all zones, it's easy to back out this feature.

Since I don't have this device at all if you could please test and let me know if it works I would appreciate it.

mattb112 commented 4 years ago

I think I may have to get the guy that made the HA ring integration add-on to update the add-on so I could test this. I will let you know my findings the minute I can test it. Thanks again for this!!On Feb 1, 2020 10:40 AM, tsightler notifications@github.com wrote:Hey Matt, I've pushed an update that should support Retro kit zones. There was no device class that matched perfectly with zones so "safety" seemed the closest, however, I'm open to suggestions here, and of course this only sets the default icon, it's always possible to override it. Note that the retro kit bridge itself will not appear. I could perhaps add it to at least monitor the tamper/battery status, so I'll keep this aside as a potential future enhancement. Also, I decided to only actively "enabled" zones in the HA interface. It appears that the device supports 8 zones, but I'm going to guess lots of people will use a smaller number of zones, this way you don't have a lot of unused devices appearing in the UI that you have to hide manually. If people think it's better to just always display all zones, it's easy to back out this feature. Since I don't have this device at all if you could please test and let me know if it works I would appreciate it.

—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or unsubscribe.

tsightler commented 4 years ago

I don't believe you have to do this as all the add-on does is start a container and run git to pull the script directly from my repo so when I publish new versions you just have to click "rebuild" in the add-on and it will rebuild the docker image with the latest code.

mattb112 commented 4 years ago

Ahhh trying out nowOn Feb 2, 2020 7:14 AM, tsightler notifications@github.com wrote:I don't believe you have to do this as all the add-on does is start a container and run git to pull the script directly from my repo so when I publish new versions you just have to click "rebuild" in the add-on and it will rebuild the docker image with the latest code.

—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or unsubscribe.

mattb112 commented 4 years ago

So I've rebuilt the addon 3 times and restarted Hassio 3 times. I don't see any sensors nor zones anywhere unfortunately.On Feb 2, 2020 7:14 AM, tsightler notifications@github.com wrote:I don't believe you have to do this as all the add-on does is start a container and run git to pull the script directly from my repo so when I publish new versions you just have to click "rebuild" in the add-on and it will rebuild the docker image with the latest code.

—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or unsubscribe.

tsightler commented 4 years ago

When you say you don't see ANY sensors, do you mean you don't even see your alarm or other Z-wave sensors? It appeared you had at least one wireless contact sensor.

I've updated the script to include some additional debugging so if you rebuild again, and have no sensors, please copy the log and send them to me via gmail. Thanks!

mattb112 commented 4 years ago

I meant I was not seeing any sensors from the Retro Kit. I can still see the 1 wireless sensor and the alarm. I never saw this in the log before until you did what you did prior to your last email.2020-02-02T23:05:05.022Z ring-alarm-mqtt !!! Found unsupported device type: bridge.flatline !!! 2020-02-02T23:05:05.022Z ring-alarm-mqtt !!! Found unsupported device type: sensor.zone !!! 2020-02-02T23:05:05.025Z ring-alarm-mqtt !!! Found unsupported device type: sensor.zone !!! 2020-02-02T23:05:05.026Z ring-alarm-mqtt !!! Found unsupported device type: sensor.zone !!! 2020-02-02T23:05:05.026Z ring-alarm-mqtt !!! Found unsupported device type: sensor.zone !!! 2020-02-02T23:05:05.027Z ring-alarm-mqtt !!! Found unsupported device type: sensor.zone !!! 2020-02-02T23:05:05.028Z ring-alarm-mqtt !!! Found unsupported device type: sensor.zone !!! 2020-02-02T23:05:05.028Z ring-alarm-mqtt !!! Found unsupported device type: sensor.zone !!! 2020-02-02T23:05:05.029Z ring-alarm-mqtt !!! Found unsupported device type: sensor.zone !!!

On Sunday, February 2, 2020, 01:30:53 PM CST, tsightler <notifications@github.com> wrote:  

When you say you don't see ANY sensors, do you mean you don't even see your alarm or other Z-wave sensors? It appeared you had at least one wireless contact sensor.

I've updated the script to include some additional debugging so if you rebuild again, and have no sensors, please copy the log and send them to me via gmail. Thanks!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

tsightler commented 4 years ago

OK, perfect, I added that extra debugging to make it easier to see what was happening so that tells me I have some time of error in the detection logic since "sensor.zone" should be supported now. Feels like somehow the little code I'm using to detect enabled vs disabled zones might not be working since it's showing all 8 of your zones not recognized.

mattb112 commented 4 years ago

Just a heads up the zones don't actually show up unless you wire it up and set it up and test it. Otherwise the unused zone does nothing. On Sunday, February 2, 2020, 06:03:58 PM CST, tsightler notifications@github.com wrote:

OK, perfect, I added that extra debugging to make it easier to see what was happening so that tells me I have some time of error in the detection logic since "sensor.zone" should be supported now. Feels like somehow the little code I'm using to detect enabled vs disabled zones might not be working since it's showing all 8 of your zones not recognized.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

tsightler commented 4 years ago

I'm assuming you mean they don't show up in the app, because they certainly show up in the API. That's why I was trying to emulate that, because I see all 8 of your zones (as you can see there are 8 instances of "unsupported device sensor.zone"). I'm trying to select on the enabled/disabled state so that the behavior of this script is the same as the app, but it didn't work for some reason.

I've stripped that little part out of the code and added a little more debugging. If you rebuild again you should get the new script and hopefully you'll see the zones and if you could pass me the debugging output it would be really useful to figure out why this logic failed.

mattb112 commented 4 years ago

Looks like you got it! I see the sensors and they are reporting open/closed correctly!! I will keep an eye on it and keep you updated. If you need me to test anything else just let me know. Thanks this is great! On Sunday, February 2, 2020, 07:33:57 PM CST, tsightler notifications@github.com wrote:

I'm assuming you mean they don't show up in the app, because they certainly show up in the API. That's why I was trying to emulate that, because I see all 8 of your zones (as you can see there are 8 instances of "unsupported device sensor.zone"). I'm trying to select on the enabled/disabled state so that the behavior of this script is the same as the app, but it didn't work for some reason.

I've stripped that little part out of the code and added a little more debugging. If you rebuild again you should get the new script and hopefully you'll see the zones and if you could pass me the debugging output it would be really useful to figure out why this logic failed.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

tsightler commented 4 years ago

Are you seeing all 8 of the zones (both enabled and disabled)?

mattb112 commented 4 years ago

I am. But the ones not in use, have like a caution sign with a ! in the middle. The active ones have a safety shield. On Sunday, February 2, 2020, 09:46:20 PM CST, tsightler notifications@github.com wrote:

Are you seeing all 8 of the zones (both enabled and disabled)?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

tsightler commented 4 years ago

Yeah, so I think that just means they are showing open. I would still appreciate it if you can share with me the debug output that shows Found supported sensor.zone , etc messages. They should include an debug for "enabled" or "disabled" state for each. If they don't something is seriously wrong.

I guess it's not critical, people can just remove the unsed devices from the Lovalace UI, but I really wanted to make it dynamic to only present the enabled zones.

mattb112 commented 4 years ago

Is this what you need?2020-02-03T21:42:39.953Z ring-alarm-mqtt Found supported device type: sensor.zone 2020-02-03T21:42:39.953Z ring-alarm-mqtt Zone state is: undefined 2020-02-03T21:42:39.954Z ring-alarm-mqtt HASS config topic: homeassistant/binary_sensor/fda811ac-007c-4718-9e6d-12378f59181b/c2867413-128a-4e3d-9bf2-b1bf87c72013/config 2020-02-03T21:42:39.955Z ring-alarm-mqtt {

On Monday, February 3, 2020, 12:51:55 PM CST, tsightler <notifications@github.com> wrote:  

Yeah, so I think that just means they are showing open. I would still appreciate it if you can share with me the debug output that shows Found supported sensor.zone , etc messages. They should include an debug for "enabled" or "disabled" state for each. If they don't something is seriously wrong.

I guess it's not critical, people can just remove the unsed devices from the Lovalace UI, but I really wanted to make it dynamic to only present the enabled zones.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

tsightler commented 4 years ago

Thanks, yep, that's it, really useful, specifcally " Zone state is: undefined " as that's the part I don't understand. According to the dumps you originally sent me, zones all have a state:

"status":"enabled" or "status":"disabled"

And I'm attempting to use that status for the device state, so each zone should say:

Zone state is: enabled or Zone state is: disabled

But yours all just say "Zone state is: undefined", which I just don't understand. There's got to be something non-obvious (to me) going on here with that property, but it just seems so straightforward. I'll have to think about it/research and see if I can figure out a reason this might be the case. In the interim, at least the code works.

Thanks for your help!

mattb112 commented 4 years ago

Just another heads up, I was working on this with dgreif as well so others that don't use Home Assistant can also use and enjoy this. He posted an Alpha version code. Maybe you guys can help each other/ work together with more ideas. So far your version has been working great for me. On Monday, February 3, 2020, 04:52:09 PM CST, tsightler notifications@github.com wrote:

Thanks, yep, that's it, really useful, specifcally " Zone state is: undefined " as that's the part I don't understand. According to the dumps you originally sent me, zones all have a state:

"status":"enabled" or "status":"disabled"

And I'm attempting to use that status for the device state, so each zone should say:

Zone state is: enabled or Zone state is: disabled

But yours all just say "Zone state is: undefined", which I just don't understand. There's got to be something non-obvious (to me) going on here with that property, but it just seems so straightforward. I'll have to think about it/research and see if I can figure out a reason this might be the case. In the interim, at least the code works.

Thanks for your help!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

tsightler commented 4 years ago

Retro kit support has been added to the https://github.com/tsightler/ring-mqtt project which will supersede this project soon.