Giter Club home page Giter Club logo

Comments (11)

tsightler avatar tsightler commented on August 16, 2024

I don't actually own any Ring smart lighting and have no plans to purchase any at this time so the code for this was developed "blind". Feedback from other users have indicated that it worked fine but that's all I have to go on. Is this a new issue or something that previously worked for you?

If you are willing to provide debugging information I'm happy to try to dig into it, but I would most likely need debug output for at least these devices. Also, do you see any debug output when motion is triggered on these devices.

I can't see any reason that the same device would be registered twice, but every light also has a motion sensor, is it possible that's why you see two sensors registered?

from ring-mqtt.

tsightler avatar tsightler commented on August 16, 2024

Did a quick review of the motion status code (it's basically three lines) and did indeed find a typo on the property name for the motion status, which would likely explain why it wasn't working. If you reinstall with the latest version (just hit rebuild if using the HASS.io addon) it might work now. Please let me know.

Would still be interested in understanding the "two sensors" issue as well, I have no idea how that would be possible with the current code unless Ring somehow returns two separate devices.

from ring-mqtt.

bolencki13 avatar bolencki13 commented on August 16, 2024

No worries, man. I appreciate the effort. I was unable to get this functionality working on any version of ring-mqtt. I did try out the latest fix and also found some more details that may be helpful.

Sensor is showing in home assistant under two different identifiers:
Screen Shot 2020-08-07 at 11 06 35 AM

After looking at the logs for ring-mqtt and triggering motion manually, it appears the to be capturing the movement but possibly classifying it incorrectly. My best guess is the conditional may not be classified as "faulted". The reason I made this assumption is because the logs indicate motion is triggered by updating however it is always a state of OFF.

I'm happy to assist in any way possible. If you'd like logs or other device specific info, I would gladly share it with you.

from ring-mqtt.

tsightler avatar tsightler commented on August 16, 2024

Since I didn't have any Ring smart lighting to test with I followed the logic in the Homebridge plugin regarding the conditional. It looks to me like this code is clearly using "faulted"

The easiest thing to do is probably to just add the line "debug(this.device.data)" to get the raw data output when motion is triggered. It should become really obvious what value in the data is changing when motion is detected.

Right now I can't even fathom how it's creating two devices though.

from ring-mqtt.

tsightler avatar tsightler commented on August 16, 2024

Looking at the screenshot, based on the fact that "Driveway" has no device attributes, that would indicate it is a light group. Can you verify if that's the case?

from ring-mqtt.

bolencki13 avatar bolencki13 commented on August 16, 2024

That would make sense. The top one has no lights in it but it is a group named Driveway and only contains the motion sensor. I'll investigate more as to the constant OFF state.

from ring-mqtt.

bolencki13 avatar bolencki13 commented on August 16, 2024

Maybe I am misunderstanding the implementation... It looks like you referenced a conditional for the motionStatus in the Homebridge plugin. In the motion-sensor device, I believe it checks for a property of faulted vs the conditional in home bridge. Am I reading that right?

from ring-mqtt.

tsightler avatar tsightler commented on August 16, 2024

The motion-sensor.js code is for alarm motion sensors, i.e. devices of class sensor.motion. The Smart Lighting devices are beam devices, i.e. devices of class motion-sensor.beam. All code for beam devices, including motion sensors, is in beam.js, so you should only compare beam.js in ring-mqtt to beam.js in homebridge.

However, you can also look at properties for RingDeviceData in the API:

https://github.com/dgreif/ring/blob/ab8764acdbaa710296ccd9de33667f98e7b10577/api/ring-types.ts#L167

You will see that there is a property:
faulted?: boolean

This is used my sensor.motion devices and why the code can simply check for boolean state. Further down you will see:

motionStatus?: 'clear' | 'faulted'

This is the property used by motion-sensor.beam devices (or at least it should be) and it's a string value so I'm using a conditional to compare the value of this property to "faulted" and setting state based on that. At least, that's what the code is attempting to do and what the homebridge code also appears to do.

If you just add the debug line I mentioned above right above the const motionState = this.device.data.motionStatus === 'faulted' ? 'ON' : 'OFF' it should tell us pretty quickly what is happening.

from ring-mqtt.

bolencki13 avatar bolencki13 commented on August 16, 2024

Just ran this locally on my laptop (no docker), and it works!! Alexa started yelling at me that someone was coming down my driveway lol. Good to know my automation is working😁. I am going to start debugging Home assistant to see why the docker container isn't working...

from ring-mqtt.

tsightler avatar tsightler commented on August 16, 2024

If you're doing a Docker pull from the repo its mostly likely because I haven't pushed the very latest changes there yet (Docker image is still 3.1.0). I still need to make some fixes for the Docker support which I hope to do this weekend and push a new Docker image.

from ring-mqtt.

bolencki13 avatar bolencki13 commented on August 16, 2024

I've been using the ring-mqtt-hassio-addon you made as well. When I was rebuilding the image, it seems to be using a cache or something. The project instance of ring-mqtt within the running docker container wasn't updating to the latest master branch.

I followed these instructions on modifying a docker image. I connected to the running container and manually pulled the master branch. By committing the changes and overwriting my local image of ring-mqtt-hassio-addon it seems to be running great.

That was a great fix, thanks for the help!

from ring-mqtt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.