Closed tylerdorazio closed 4 years ago
Are you thinking of this?
https://developer.amazon.com/en-US/docs/alexa/device-apis/alexa-doorbelleventsource.html
Implementing the door bell event should be straight forward, but not the video feed.
I don’t have my doorbell integrated into homebridge yet, so I would not be able to test this, but if you have the ability to provide testing support it could be done.
To start I would need a homebridge accessory dump for your doorbell service. If you can share that we can look at implementing
That's exactly what I was looking at! Just the doorbell event is what i'm looking for honestly so it can announce when someone is at the door. Not worried about the video stream. I'd be more than happy to test this out!
Attached is the accessory dump for the doorbell. doorbell.txt
This is what is currently being passed to Alexa for your doorbell
{
"event": {
"header": {
"namespace": "Alexa.Discovery",
"name": "Discover.Response",
"payloadVersion": "3",
"messageId": "1bd5d003-31b9-476f-ad03-71d471922820"
},
"payload": {
"endpoints": [
{
"endpointId": "Q0M6MjI6M0Q6RTM6Q0U6MzAtcGFyc2VUZXN0LVViaXF1aXRpIE5ldHdvcmtzLVVWQyBHNCBEb29yYmVsbCA3NTY1LTAwMDAwMDQ5LTAwMDAtMTAwMC04MDAwLTAwMjZCQjc2NTI5MQ==",
"friendlyName": "UVC G4 Doorbell 7565",
"description": "parseTest UVC G4 Doorbell 7565 Switch",
"manufacturerName": "Ubiquiti Networks",
"displayCategories": [
"SWITCH"
],
"cookie": {
"TurnOn": "{\"deviceID\":\"CC:22:3D:E3:CE:30\",\"aid\":3,\"iid\":14,\"value\":1}",
"TurnOff": "{\"deviceID\":\"CC:22:3D:E3:CE:30\",\"aid\":3,\"iid\":14,\"value\":0}",
"ReportState": "[{\"interface\":\"Alexa.PowerController\",\"deviceID\":\"CC:22:3D:E3:CE:30\",\"aid\":3,\"iid\":14}]"
},
"capabilities": [
{
"type": "AlexaInterface",
"interface": "Alexa",
"version": "3"
},
{
"type": "AlexaInterface",
"interface": "Alexa.PowerController",
"version": "3",
"properties": {
"supported": [
{
"name": "powerState"
}
],
"proactivelyReported": false,
"retrievable": true
}
}
]
},
{
"endpointId": "Q0M6MjI6M0Q6RTM6Q0U6MzAtcGFyc2VUZXN0LVViaXF1aXRpIE5ldHdvcmtzLVVWQyBHNCBEb29yYmVsbCA3NTY1LTAwMDAwMDg1LTAwMDAtMTAwMC04MDAwLTAwMjZCQjc2NTI5MQ==",
"friendlyName": "UVC G4 Doorbell 7565",
"description": "parseTest UVC G4 Doorbell 7565 Motion Sensor",
"manufacturerName": "Ubiquiti Networks",
"displayCategories": [
"MOTION_SENSOR"
],
"cookie": {
"ReportState": "[{\"interface\":\"Alexa.MotionSensor\",\"deviceID\":\"CC:22:3D:E3:CE:30\",\"aid\":3,\"iid\":11}]"
},
"capabilities": [
{
"type": "AlexaInterface",
"interface": "Alexa",
"version": "3"
},
{
"type": "AlexaInterface",
"interface": "Alexa.MotionSensor",
"version": "3",
"properties": {
"supported": [
{
"name": "detectionState"
}
],
"proactivelyReported": true,
"retrievable": true
}
}
]
},
{
"endpointId": "Q0M6MjI6M0Q6RTM6Q0U6MzAtcGFyc2VUZXN0LVViaXF1aXRpIE5ldHdvcmtzLVVWQyBHNCBEb29yYmVsbCA3NTY1LTAwMDAwMTEwLTAwMDAtMTAwMC04MDAwLTAwMjZCQjc2NTI5MQ==",
"friendlyName": "UVC G4 Doorbell 7565",
"description": "parseTest UVC G4 Doorbell 7565 undefined",
"manufacturerName": "Ubiquiti Networks",
"displayCategories": [
"OTHER"
],
"cookie": {
"TurnOn": "{\"deviceID\":\"CC:22:3D:E3:CE:30\",\"aid\":3,\"iid\":28,\"value\":1}",
"TurnOff": "{\"deviceID\":\"CC:22:3D:E3:CE:30\",\"aid\":3,\"iid\":28,\"value\":0}",
"ReportState": "[{\"interface\":\"Alexa.PowerController\",\"deviceID\":\"CC:22:3D:E3:CE:30\",\"aid\":3,\"iid\":28}]"
},
"capabilities": [
{
"type": "AlexaInterface",
"interface": "Alexa",
"version": "3"
},
{
"type": "AlexaInterface",
"interface": "Alexa.PowerController",
"version": "3",
"properties": {
"supported": [
{
"name": "powerState"
}
],
"proactivelyReported": false,
"retrievable": true
}
}
]
},
{
"endpointId": "Q0M6MjI6M0Q6RTM6Q0U6MzAtcGFyc2VUZXN0LVViaXF1aXRpIE5ldHdvcmtzLVVWQyBHNCBEb29yYmVsbCA3NTY1LTAwMDAwMTEyLTAwMDAtMTAwMC04MDAwLTAwMjZCQjc2NTI5MQ==",
"friendlyName": "UVC G4 Doorbell 7565",
"description": "parseTest UVC G4 Doorbell 7565 Microphone",
"manufacturerName": "Ubiquiti Networks",
"displayCategories": [
"OTHER"
],
"cookie": {
"AdjustVolume": "{\"deviceID\":\"CC:22:3D:E3:CE:30\",\"aid\":3,\"iid\":20}",
"SetVolume": "{\"deviceID\":\"CC:22:3D:E3:CE:30\",\"aid\":3,\"iid\":20}",
"ReportState": "[{\"interface\":\"Alexa.Speaker\",\"deviceID\":\"CC:22:3D:E3:CE:30\",\"aid\":3,\"iid\":20}]"
},
"capabilities": [
{
"type": "AlexaInterface",
"interface": "Alexa",
"version": "3"
},
{
"type": "AlexaInterface",
"interface": "Alexa.Speaker",
"version": "3",
"properties": {
"supported": [
{
"name": "volume"
}
],
"proactivelyReported": false,
"retrievable": true
}
}
]
}
]
}
}
}
And this is current defined as an event source
{
endpointId: 'Q0M6MjI6M0Q6RTM6Q0U6MzAtcGFyc2VUZXN0LVViaXF1aXRpIE5ldHdvcmtzLVVWQyBHNCBEb29yYmVsbCA3NTY1LTAwMDAwMDg1LTAwMDAtMTAwMC04MDAwLTAwMjZCQjc2NTI5MQ==',
friendlyName: 'UVC G4 Doorbell 7565',
description: 'parseTest UVC G4 Doorbell 7565 Motion Sensor',
manufacturerName: 'Ubiquiti Networks',
displayCategories: [ 'MOTION_SENSOR' ],
cookie: {
ReportState: '[{"interface":"Alexa.MotionSensor","deviceID":"CC:22:3D:E3:CE:30","aid":3,"iid":11}]'
},
capabilities: [
{ type: 'AlexaInterface', interface: 'Alexa', version: '3' },
{
type: 'AlexaInterface',
interface: 'Alexa.MotionSensor',
version: '3',
properties: [Object]
}
]
}
It seems like the Programmable Switch Event acts as the doorbell in Homebridge. The Home app treats it as such as well with the ability to alert on doorbell notifications. I wonder if that can trigger the DoorbellPress
event.
I looked at the HomeKit spec, and it is the programmable switch. Just need to do some plumbing to the service and configure events. Give me a week or so
This is taking longer than I expected, as getting the interface to the physical doorbell to work is taking longer. I ordered some parts based on this
https://hackaday.com/2020/06/01/the-easiest-way-to-put-your-doorbell-on-the-internet/
But I ordered the wrong ones, so a bit longer
My doorbell in now complete and working, now for Alexa integration.
Success, give me a couple of hours to publish and we are good to go
The last little bit was really straight forward and this is now ready for testing. Support for the doorbell is included in the Beta branch and can be installed with this command.
sudo npm install -g homebridge-alexa@beta
After you install the beta, please ensure routines is set to true in the config.json as well. Then discovery devices again and then go into the Amazon Alexa App to configure your Doorbell and let Alexa know which devices to announce the pressing of the doorbell.
For the testing of this I used the plugin homebridge-camera-ffmpeg, so YMMV with other plugins.
This is awesome! I will test a bit later and report back. Super fast turnaround here :)
I tried updating my plugin using home bridge on my raspberry pi and it gave an error that it could not find the homebridge-alexa JSON file and crashed Homebridge. I am running Homebridge Config UI and did the update using the built in terminal in that. Any ideas what the issue could be? When I ran 'sudo npm install -g homebridge-alexa' it downgraded and everything has returned to normal. I was going to test this with the Skybell Plugin. I have been trying to breathe new life into Skybell because my parents bought it for me as a housewarming gift but it is not supported by any platforms.
Can you share the error message ?
As the downgrade worked I'm a little bit stumped
Are you running undo sudo mode or not ?
https://github.com/oznu/homebridge-config-ui-x#sudo-mode
If not then the install command would be
npm install homebridge-alexa@beta
I'm using sudo mode with config ui and using the sudo keyword at the start of the command to up the permissions.
[9/11/2020, 15:34:52] [Alexa] alexaDiscovery - returned 6 devices
[9/11/2020, 15:34:52] Error: ENOENT: no such file or directory, open './Desktop/alexa.json'
at Object.openSync (fs.js:458:3)
at Object.writeFileSync (fs.js:1279:35)
at Object.
Tks, that's a oops on my part, give me 10 minutes
I was saving the Alexa discovery response to my desktop while coding this up and left the saving of the file behind
[9/11/2020, 15:34:52] Error: ENOENT: no such file or directory, open './Desktop/alexa.json'
Fixed in the latest beta, v0.5.10
Thanks! Can I just say "hats off to you". I have never had a developer respond and fix an issue so quickly before.
You caught me at the right moment, sitting with my laptop open and an easy fix. It took all of 10 seconds to comment out the two lines causing the issue. At other times, who knows
PS The error message really help as it pointed out the exact line with the issue.
Will this plugin support doorbell devices? Specifically, I have a unifi G4 doorbell that is defined properly as a doorbell in HomeBridge (using the homebridge-unifi-protect2 package).