I have successfully gotten the Google doorbell to work via python
However, Google restricts your ability to pull media from the doorbell api if you are not using their home app, so when I see the video clips, it returns a 401 error, which indicates that I am not accessing via the home app
There is a work around, but this will take some time to test and may not be a priority: https://medium.com/@tamirmayer/google-nest-camera-internal-api-fdf9dc3ce167
My code currently uses the Google API and a refresh token to try to access the image preview (we will see if it works after trying the thing above)
The doorbell now uses pub/sub to post events, and my python code allows the user to subscribe to the event log and pull event threads when available. The events for a doorbell press (sdm.devices.events.DoorbellChime.Chime) require no other user interaction and can trigger the doorbell notification via Mattermost once I work with Ian to set this up. The result is:
Listening for messages on projects/lab-doorbellapi/subscriptions/doorbell-subscription-v1...
Received message: b'{\n "eventId": "b3326428-aceb-461a-ab2a-25ab3f8c06a6",\n "timestamp": "2025-04-12T02:00:15.064852Z",\n "resourceUpdate": {\n "name": "<redacted>,\n "events": {\n "sdm.devices.events.DoorbellChime.Chime": {\n "eventSessionId": "1740690860",\n "eventId": "n:1"\n }\n }\n },\n "userId": "<redacted>",\n "eventThreadId": "6855bbc9-f284-4582-a679-b875450c9ec2",\n "resourceGroup": ["<redacted>"],\n "eventThreadState": "STARTED"\n}'
Processing event for eventThreadId: 6855bbc9-f284-4582-a679-b875450c9ec2
Doorbell was pressed!
Received message: b'{\n "eventId": "b3326428-aceb-461a-ab2a-25ab3f8c06a6",\n "timestamp": "2025-04-12T02:00:15.064852Z",\n "resourceUpdate": {\n "name": "<redacted>",\n "events": {\n "sdm.devices.events.DoorbellChime.Chime": {\n "eventSessionId": "1740690860",\n "eventId": "n:1"\n }\n }\n },\n "userId": "<redacted>",\n "eventThreadId": "6855bbc9-f284-4582-a679-b875450c9ec2",\n "resourceGroup": ["<redacted>"],\n "eventThreadState": "ENDED"\n}'
Processing event for eventThreadId: 6855bbc9-f284-4582-a679-b875450c9ec2
The print statement "Doorbell was pressed!" occurs when a new event is processed and its eventThreadState is "STARTED"
This will be changed to a Mattermost post via webhook in the future
Access to the developer settings for the device console, pub/sub, API, and Google Cloud developer settings are all set up for gquestlab@gmail.com
Please don't make any changes to the Lab-DoorbellAPI project without contacting me first.