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

Add doorbell code #211

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jsiegenthaler
Copy link
Contributor

The doorbell was requested in issue #143 so i thought I would add it for you as a stateless programmable switch.
It could also be anything else, such as a pushbutton, but the stateless programmable switch made moste sense in the Home app.

You can trigger the doorbell using standard webhooks commands for the stateless programmable switch:
http://localhost:51828/?accessoryId=doorbell1&event=0 // ring the doorbell using single press
http://localhost:51828/?accessoryId=doorbell1&event=1 // ring the doorbell using double press
http://localhost:51828/?accessoryId=doorbell1&event=2 // ring the doorbell using long press

When the doorbell is rung, it will send the standard HomeKit notification "Roomname doorbell rang", and it will trigger any actions added in the Home app to the stateless programmable switch

The code is based on HttpWebHookStatelessSwitchAccessory, but limited to one button only (as multiple buttons make no sense for a doorbell).

The doorbell does not trigger any urls to be called (but neither does HttpWebHookStatelessSwitchAccessory)

This is worthy of a new release, but wait a day or so, as I will update the readme comments and config.json for the stateless programmable switch as a separate PR (to make the readme more understandable)

@jsiegenthaler
Copy link
Contributor Author

When you merge this, you can close issue #143

@jsiegenthaler
Copy link
Contributor Author

Hold on a bit, I'm going to improve the code to read props before updating values

Added clean handling of invalid event values. anything invalid will log a warning in Homebridge and no HomeKit updates will occur
@jsiegenthaler
Copy link
Contributor Author

Code improved invalid values are now logged as warnings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant