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

[Feature Request] Doorbell support (and other device types) #203

Open
Joecorleone opened this issue May 3, 2021 · 6 comments
Open

[Feature Request] Doorbell support (and other device types) #203

Joecorleone opened this issue May 3, 2021 · 6 comments

Comments

@Joecorleone
Copy link

Joecorleone commented May 3, 2021

Hi,

while looking for support for the new device types in Google, I came across the extensive refactoring by @michikrug #175 . I am excited to seeing it deployed (I am not running my own cloud, yet).
As part of the refactoring new device types such as TV, TemperatureSensor and Sensor have been added already. I was curious if there is any planned support for other device types, e.g. door bell (https://developers.google.com/assistant/smarthome/guides/doorbell). If I have missed it in the commits or if there is a different way to implement such, I would appreciate a pointer and please feel free to close this issue.
Thanks

Edit:
Just some reasoning behind my request. I am using a DoorWindow Contact sensor placed at the bell to detect the ringing of the doorbell. This seems to be relatively common, if you are looking for a non-permanent and cheap alternative. After adding a timeout in openHab it works quite reliably and using the cloud, one can even get notifications on the smartphone. Still, having the GA integration would be a nice bonus, especially for members in the household not using the openHab app.

@Joecorleone Joecorleone changed the title Request for doorbell support (and other device types) [Feature Request] Doorbell support (and other device types) May 3, 2021
@michikrug
Copy link
Collaborator

Hello and thanks for reaching out.
I just took a look at the documentation.
To implement this properly with notifications, we would need to use the State Reporting API. This is not possible because we cannot distinguish between individual users connected to the openHAB Google Assistant integration. openHAB Cloud does not transmit a unique identifier that could be used as an "agentId" for Google.

Unless someone else can prove me wrong, I have to say that this is not considered possible.

@Joecorleone
Copy link
Author

Hei,
thanks a lot for checking the feasibility of my request. Well, if that's a limitation with openHAB Cloud, it cannot be helped. Is that something I should bother the people at openHAB Cloud repo with?

@michikrug
Copy link
Collaborator

@Joecorleone could be an option

I already tried to implement a workaround in openHAB cloud and succeeded by passing the user's email in an extra header field in the HTTP response.

It is still uncertain if this use-case will ever be possible with openHAB, as the item state change is not actively pushed to either the openHAB cloud or the Google Assistant integration.

So it would require a "real add-on" to openHAB that listens to state changes and somehow notifies and updates the Google Smarthome Graph.

@Joecorleone
Copy link
Author

Okay, thank you very much for clarifying.

@michikrug
Copy link
Collaborator

michikrug commented May 21, 2021

@Joecorleone FYI, I sat down today and hacked a working doorbell in my setup.

Unfortunately, this requires a lot of custom configurations like:

  • the already mentioned modified openHAB cloud instance that sends user information
  • a script invoked on every item change at the openHAB system itself that pushes the updated state to this Google integration (I wrote a small python one that can be called by rules)
  • a custom instance of this integration with Google Homegraph integration

For everyone interested in the code, have a look at my state-reporting branch.

[EDIT]
Also tried it with a fake Sensor device. Works quite nice.

@Joecorleone
Copy link
Author

@michikrug Wow, okay, that's awesome. I guess it is time to set up my own openHAB cloud instance. Excited to see it in action. Thanks again

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

No branches or pull requests

2 participants