Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contact Sensor implementation #250

Closed
neviskevin opened this issue Jun 15, 2021 · 3 comments
Closed

Contact Sensor implementation #250

neviskevin opened this issue Jun 15, 2021 · 3 comments
Labels
stale Stale PRs and Issues

Comments

@neviskevin
Copy link

Is there a way to get data from the contact sensors? I have one installed but it does not show up when I list devices.

@samskalicky
Copy link

Hi @neviskevin did you ever make any progress? Im just starting to play around and started #254 to address this issue for my own interest as well. If you're interested I would very much appreciate any help or collaboration.

@neviskevin
Copy link
Author

neviskevin commented Sep 14, 2021

Yeah, I added code to example.ts, added my logic inside of the same async function that connects to ring.

alarmEvents = await location.getHistory({limit: 1, category: 'alarm',}) //gets the latest alarm event sync = (JSON.stringify(alarmEvents[0].context)).slice(12, 48)// cuts out event id from string of data, unique to each event

For me I just have one contact sensor so I am constantly checking to see if another event has passed to tell if it has been opened or closed. You cannot see the state of the contact sensor from the data sent by ring (I think this is due to security reasons), so I assumed the starting position was closed and added some logic to keep track of the state of the sensor. If you have multiple sensors there is a device ID in the alarmEvent you can use to sort things out. I used this to automatically turn off my air-conditioning when I leave my door open. Hope this helps!

Also, I am not sure what you are working on, but alexa has the ability to react to an open or closed contact sensor directly so maybe you could leverage a skill as a solution

Copy link

There hasn't been any activity on this issue recently. This issue has been automatically marked as stale because of that. It will be closed if no further activity occurs.
Please make sure to update to the latest ring_doorbell version and check if that solves the issue.
Thank you for your contributions.

@github-actions github-actions bot added the stale Stale PRs and Issues label May 18, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Stale PRs and Issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants