homebridge-knx icon indicating copy to clipboard operation
homebridge-knx copied to clipboard

Doorbell configuration

Open unaxboy opened this issue 8 years ago • 47 comments

Hi, I want to make alternative to August Smart Lock and Doorbell Cam that works with homekit and knx. I already know how to integrate door lock and ip cam, but have a problem with doorbell.

For door lock I use Zennio ZIO-QUADP + PERCo LB85.2. For doorbell the same Zennio knx module + ip cam + wired push button. I know how to configurate all devices in knx_config.json (ip cam and door lock), except doorbell.

Can someone help me with that?

unaxboy avatar Feb 19 '17 01:02 unaxboy

Can you tell a bit about the doorbell? What group addresses doe it need, which values etc?
And paste the part of the config you already have for ip cam and door lock?
I assume you are on 0.3.x of homebridge-knx?

snowdd1 avatar Feb 19 '17 13:02 snowdd1

Doorbell

knx_config.json

{
	"knxd_ip": "127.0.0.1",
	"knxd_port": 6720,
	"AllowWebserver": true,
	"AllowKillHomebridge": false,
	"Devices": [{
		"DeviceName": "Room1",
		"Services": [{
			"ServiceType": "LockMechanism ",
			"ServiceName": "Entrance",
			"Characteristics": [{
				"Type": "LockCurrentState",
				"Listen": ["0/3/5"]
			}, {
				"Type": "LockTargetState",
				"Set": ["0/0/5"]
			}]
		}, {
			"ServiceType": "Doorbell",
			"ServiceName": "Entrance",
			"Characteristics": [{
				"Type": "ProgrammableSwitchEvent",
				"Listen": ["0/3/4"]
			}]
		}]
	}]
}

unaxboy avatar Feb 19 '17 18:02 unaxboy

Guessing from the picture behind that link your doorbell knob is just a switch you've connected to an KNX binary input, right?

For HomeKit it should be sufficient to place all the three services into one room. Your knx_config.json looks good. Upon doorbell event, the iPhone/iPad should show the picture from IP Cam and offer to work the door lock.

Haven't got one myself (donations welcome!) so I am just reciting from memory what I've read at https://github.com/nfarina/homebridge/issues You might search there for details.

snowdd1 avatar Feb 19 '17 20:02 snowdd1

Ah, and in Home App (Apple's native Homekit app) the doorbell still appears as Not Supported, but that means only the app, not HomeKit itself.

snowdd1 avatar Feb 19 '17 20:02 snowdd1

Guessing from the picture behind that link your doorbell knob is just a switch you've connected to an KNX binary input, right?

Right

unaxboy avatar Feb 19 '17 20:02 unaxboy

[37m[2/19/2017, 9:12:45 PM][39m [36m[homebridge-knx.KNX][39m [ERROR] cannot create service of ServiceType LockMechanism  (not found)
21:12:45
/usr/lib/node_modules/homebridge-knx/lib/service-knx.js:65
21:12:45
			throw new Error("Must specify VALID 'ServiceType' property for each service in knx_config.json.");
21:12:45
			^
21:12:45
21:12:45
Error: Must specify VALID 'ServiceType' property for each service in knx_config.json.
21:12:45
    at new ServiceKNX (/usr/lib/node_modules/homebridge-knx/lib/service-knx.js:65:10)
21:12:45
    at new KNXDevice (/usr/lib/node_modules/homebridge-knx/lib/knxdevice.js:101:23)
21:12:45
    at KNXPlatform.configure (/usr/lib/node_modules/homebridge-knx/index.js:198:23)
21:12:45
    at KNXPlatform.<anonymous> (/usr/lib/node_modules/homebridge-knx/index.js:88:9)
21:12:45
    at emitNone (events.js:91:20)
21:12:45
    at API.emit (events.js:185:7)
21:12:45
    at Server.run (/usr/lib/node_modules/homebridge/lib/server.js:93:13)
21:12:45
    at module.exports (/usr/lib/node_modules/homebridge/lib/cli.js:40:10)
21:12:45
    at Object.<anonymous> (/usr/lib/node_modules/homebridge/bin/homebridge:17:22)
21:12:45
    at Module._compile (module.js:556:32)

unaxboy avatar Feb 19 '17 21:02 unaxboy

Sorry overlooked the extra space in your "LockMechanism ":

  "Services": [{
  	"ServiceType": "LockMechanism ",
  	"ServiceName": "Entrance",
  	"Characteristics": [{

And, please try to reduce the log output in issues to a minimum. If more date is required to analyze the case, I will ask for it. Usually the lines around the first occurrence of "[ERROR]" or "throw" are sufficient, and make the things much better readable to anyone trying to help.

snowdd1 avatar Feb 19 '17 21:02 snowdd1

events.js:160
22:14:32
      throw er; // Unhandled 'error' event
22:14:32
      ^
22:14:32
22:14:32
Error: listen EADDRINUSE :::51826
22:14:32
    at Object.exports._errnoException (util.js:1036:11)
22:14:32
    at exports._exceptionWithHostPort (util.js:1059:20)
22:14:32
    at Server._listen2 (net.js:1252:14)
22:14:32
    at listen (net.js:1288:10)
22:14:32
    at Server.listen (net.js:1384:5)
22:14:32
    at EventedHTTPServer.listen (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/util/eventedhttp.js:60:19)
22:14:32
    at HAPServer.listen (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:158:20)
22:14:32
    at Bridge.Accessory.publish (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:496:16)
22:14:32
    at Server._publish (/usr/lib/node_modules/homebridge/lib/server.js:114:16)
22:14:32
    at Server.run (/usr/lib/node_modules/homebridge/lib/server.js:91:10)

Upd: I found a problem, can't run two docker with homebridge at the same time

unaxboy avatar Feb 19 '17 22:02 unaxboy

New problem with adding ip cam in homebridge

events.js:160
05:01:14
      throw er; // Unhandled 'error' event
05:01:14
      ^
05:01:14
05:01:14
Error: spawn ffmpeg ENOENT
05:01:14
    at exports._errnoException (util.js:1036:11)
05:01:14
    at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
05:01:14
    at onErrorNT (internal/child_process.js:359:16)
05:01:14
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
05:01:14
    at process._tickCallback (internal/process/next_tick.js:98:9)

config.json:

{
	"bridge": {
		"name": "Homebridge",
		"username": "CC:22:3D:E3:CE:30",
		"port": 51826,
		"pin": "321-21-321"
	},

	"accessories": [
	],

    "platforms": [
	{
  "platform": "Camera-ffmpeg",
  "cameras": [
    {
      "name": "Camera Name",
      "videoConfig": {
      	"source": "-re -f mjpeg -i http://extcam-14.se.axis.com/axis-cgi/mjpg/video.cgi",
        "stillImageSource": "-f mjpeg -i http://extcam-14.se.axis.com/axis-cgi/mjpg/video.cgi",
        "maxStreams": 2,
        "maxWidth": 1280,
        "maxHeight": 800,
        "maxFPS": 30
	   }
	  }
	 ]
	}
	]
}

Tryed with live demo stream from this site

Upd: I found solution. But can't make working a doorbell, nothing happens when push a button.

unaxboy avatar Feb 20 '17 05:02 unaxboy

Hmmmm, going to test this at home too, I had the ProgrammableSwitch type in my config but since the Home app showed it was not yet supported I deleted it yesterday and now I stumble upon this.

FYI, I had a slightly different config, but upon further inspection it should be listen instead of Set (I think)

     {
        "DeviceName": "Voordeur Deurbel",
        "Services": [
            {
                "ServiceType": "Doorbell",
                "ServiceName": "Voordeur Deurbel",
                "Characteristics": [
                    {
                        "Type": "ProgrammableSwitchEvent",
                        "Set": [
                            "X/Y/Z"
                        ]
                    }
                ]
            }
        ]
    }

For HomeKit it should be sufficient to place all the three services into one room. Your knx_config.json looks good. Upon doorbell event, the iPhone/iPad should show the picture from IP Cam and offer to work the door lock.

@snowdd1 : does it produce some kind of "ding dong" sound on all the linked iPhones and iPads? Haven't installed a doorbell yet and this would be the solution. Somebody rings your doorbell: all your iPhones go "ding dong". Not yet interested in the IP camera story here...

hyperbart avatar Feb 23 '17 08:02 hyperbart

Sorry I never tried it myself, just citing from homebridge issues I've read.

snowdd1 avatar Feb 23 '17 20:02 snowdd1

For now I got work lock mechanism, ip cam and motion sensor. Also think that microphone, speaker and camera control works, but I don't know how to check. A doorbell still don't working. Nothing happening when I push a button.

My knx_config.json below:

        {
            "DeviceName": "Video Doorbell",
            "Services": [
                {
                    "ServiceType": "LockMechanism",
                    "ServiceName": "Entrance",
                    "Characteristics": [
                        {
                            "Type": "LockCurrentState",
                            "Listen": [
                                "0/0/5"
                            ],
                            "DPT": "DPT1"
                        },
                        {
                            "Type": "LockTargetState",
                            "Set": [
                                "0/0/5"
                            ],
                            "DPT": "DPT1"
                        }
                    ]
                },
                {
                    "ServiceType": "Doorbell",
                    "ServiceName": "Entrance",
                    "Characteristics": [
                        {
                            "Type": "ProgrammableSwitchEvent",
                            "Set": [
                                "0/5/1"
                            ],
                            "Listen": [
                                "0/5/1"
                            ],
                            "DPT": "DPT1"
                        }
                    ]
                },
                {
                    "ServiceType": "Microphone",
                    "ServiceName": "Entrance",
                    "Characteristics": [
                        {
                            "Type": "Mute",
                            "Set": [
                                "0/5/1"
                            ],
                            "Listen": [
                                "0/5/1"
                            ],
                            "DPT": "DPT1"
                        }
                    ]
                },
                {
                    "ServiceType": "Speaker",
                    "ServiceName": "Entrance",
                    "Characteristics": [
                        {
                            "Type": "Mute",
                            "Set": [
                                "0/5/1"
                            ],
                            "Listen": [
                                "0/5/1"
                            ],
                            "DPT": "DPT1"
                        }
                    ]
                },
                {
                    "ServiceType": "CameraControl",
                    "ServiceName": "Entrance",
                    "Characteristics": [
                        {
                            "Type": "On",
                            "Set": [
                                "0/5/1"
                            ],
                            "Listen": [
                                "0/5/1"
                            ],
                            "DPT": "DPT1"
                        }
                    ]
                },
                {
                    "ServiceType": "MotionSensor",
                    "ServiceName": "Датчик движения",
                    "Characteristics": [
                        {
                            "Type": "MotionDetected",
                            "Listen": [
                                "0/0/7"
                            ]
                        }
                    ]
                }
            ]
        }

unaxboy avatar Feb 24 '17 13:02 unaxboy

@snowdd1

Haven't got one myself (donations welcome!) so I am just reciting from memory what I've read at https://github.com/nfarina/homebridge/issues You might search there for details.

Send me a message via a verified channel and I'll try to send you one. With all the work you have put in homebridge-knx and the features it provides to my setup it's the least I can do.

hyperbart avatar Aug 12 '17 12:08 hyperbart

Has anyone had any success with doorbell implementation ? I am still trying to figure out how to get working alert(notification) from knx pushbutton

dlt- avatar Sep 03 '17 16:09 dlt-

If you find out let me know 😄.

Have you tested with iOS11 yet? The family iPad is running on iOS 11 here but I haven't tested it yet. On Sun, 3 Sep 2017 at 18:52, dlt- [email protected] wrote:

Has anyone had any success with doorbell implementation ? I am still trying to figure out how to get working alert(notification) from knx pushbutton

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/snowdd1/homebridge-knx/issues/84#issuecomment-326816590, or mute the thread https://github.com/notifications/unsubscribe-auth/ACCFbrdHw9hGmZ1eAVT6PosTozZUvzvRks5setlpgaJpZM4MFUwA .

hyperbart avatar Sep 03 '17 17:09 hyperbart

This one actually works: https://github.com/Samfox2/homebridge-videodoorbell (notifications too!)

dlt- avatar Jan 02 '18 23:01 dlt-

cool, have to try that on the weekend! Thanks for mentioning!

snowdd1 avatar Jan 03 '18 21:01 snowdd1

@dlt- do you mind explaining a bit how all of this works? the https://github.com/Samfox2/homebridge-videodoorbell shows itself as a camera or as what? What does the full setup look like tying the doorbell-button an the @Samfox2 plugin together?

hyperbart avatar Jan 04 '18 14:01 hyperbart

That Samfox2 plugin has nothing to do with KNX, but it may help when trying to implement the same thing in KNX.

Currently it supports any webcam with rtsp video feed, by using ffmpeg to transcode it. (Other homebridge camera plugins use the same method). It also adds a "web server" listener to some TCP port, and when something or someone makes a simple GET request there it will trigger the HomeKit alert. My doorbell device (made by 2N) included http API and allowed me to make that request directly from the device.

The IOS notifications contain a snapshot from the camera, taken at the same time when the button is pressed.

If the same (homekit) room containing this doorbell accessory also has a Lock mechanism accessory, the notification will also show UNLOCK button. This feature also works! (Homekit/Ios will link them together automatically when they are in the same room)

This plugin adds a homekit accessory that must be added to the homekit same way as the homebridge itself (pairing code etc, it uses the same one has homebridge service) It shows as a camera device in Homekit.

So it does not appear "under" homebridge accessory (this may have something to do with the fact that so far no-one has been successful with triggering doorbell button Notification via other homebridge plugins, such as homebridge-knx)

dlt- avatar Jan 04 '18 15:01 dlt-

They changed the api, doorbell service does not work standalone anymore. It always showed „not supported“ in home but it was working. Now it has to be used with a video doorbell profile. This means you cannot trigger the programmable switch event of an accessory with only doorbell service defined. The only workaround is to use motion service as doorbell but it would only show a „motion detected“ notification (with pic) - but this is not as nice as a real video doorbell :-)

Samfox2 avatar Jan 04 '18 18:01 Samfox2

Of course you can always generate a fake video feed, if there is no real camera available :) Maybe even render some text information to that "video" snapshot.

@Samfox2 by the way, I modified your plugin a little bit (just a very dirty hack) to allow still image capture via custom shell script, instead of forcing me to use ffmpeg commandline to download it.

I use it to download still image (jpg) from Synology Surveillance Station 's API service. My Synology records same camera all the time, but it's API requires several requests to download the (authentication token etc, can not combined to one GET request). Noticed that it is faster than requesting a snapshot jpg directly from camera.

dlt- avatar Jan 04 '18 19:01 dlt-

@dlt- nice to hear that it is working for you. There is also a „commented“ mic and speaker option. Itˋs untested as I never got ffmpeg to work with the audio stuff. But as far as I remember the input items should be added to the notification as well.

Samfox2 avatar Jan 04 '18 19:01 Samfox2

Samfox2 what happens then if you add a stateless button in homekit and add that to the same virtual room as the videodoorbell? Or if you add the doorbell accessory together with videodoorbell?

On Thu, 4 Jan 2018 at 20:40, Samfox2 [email protected] wrote:

@dlt- https://github.com/dlt- nice to hear that it is working for you. There is also a „commented“ mic and speaker option. Itˋs untested as I never got ffmpeg to work with the audio stuff. But as far as I remember the input items should be added to the notification as well.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/snowdd1/homebridge-knx/issues/84#issuecomment-355377237, or mute the thread https://github.com/notifications/unsubscribe-auth/ACCFbrYVs_vrx93RtybVMvT2G9GcvtkZks5tHSflgaJpZM4MFUwA .

hyperbart avatar Jan 04 '18 19:01 hyperbart

Both scenarious do not trigger the videodoorbell. Think you could use sth. like the ifttt plugin. Switch or whatever triggers that which executes a request 2 the videodoorbell.

Samfox2 avatar Jan 04 '18 21:01 Samfox2

Have you got any further with this?

How do you find out the configuration for the camera on the door bell?

siobhanellis avatar Mar 17 '18 01:03 siobhanellis

How do you link the video doorbell plug-in with a knx push button? And how do you configure this in the knx_config.json file? I would really like to get this working! Just to be clear, I have a SpaceLYnk, making it possible for me to make the pushbutton send a http request when pushed.

So main issue is to understand how to set up the config files and know what http request my push button needs to use.

Mr-S-D avatar May 26 '18 13:05 Mr-S-D

Just post the request to the IP:PORT of the homebridge-videodoorbell plugin defined in your config.json.

Samfox2 avatar May 26 '18 15:05 Samfox2

Thank you for replying so quick! I am a bit of a noob, could you post the part of your config files that shows how you have set up your camera and the doorbell accessories?

Mine is like this for now:

{ "bridge": { "name": "Home", "username": "CC:22:3D:E3:CE:30", "port": 51826, "pin": "123-45-678" },

"platform": "Video-doorbell",
"cameras": [{
	"name": "Ringeklokke",
	"port": 5005,
	"videoConfig": {
		"source": "-re -i rtsp://xxxx:[email protected]:554/s1",
		"stillImageSource": "-i http://faster_still_image_grab_url/this_is_optional.jpg",
		"maxWidth": 1280,
		"maxHeight": 720,
		"maxFPS": 30
	}
}],
	"DeviceName": "Gangen",
	"Services": [{
					"ServiceType": "Doorbell",
					"ServiceName": "Ringeklokke",
					"Characteristics": [
						{
						"Type": "ProgrammableSwitchEvent",
						"Set": [
						"0/0/10"
					],
				"Listen": [
				"0/0/10"
				],
			"DPT": "DPT1"
		}
	]
}
]

}

Also, the still image source... how is this found? I dont need audio or stream, I am happy with an image and a notification.... (have a camera outside our front door, Unifi camera)

When using this I am able to get the Doorbell in the home app, but it says this device is not supported at the moment...

Is this the correct url to use: curl -X POST -d 'ding=dong&dong=ding' http://10.0.1.29:51826 Where the IP is the Raspberry Pi with the Homebridge installed and the port is the one in the bridge uses? I have tried this, but nothing happens...

Mr-S-D avatar May 26 '18 16:05 Mr-S-D

Yes, the IP is the one that your homebridge server is using but the PORT is the number that you defined in your config.json (5005). Try this with your curl command and it should work... you can also test it by typing the ip:port in the browser of any device that is in the same network.

Samfox2 avatar May 26 '18 19:05 Samfox2

Thanks, that did the trick. When using that link I get a notification. But I am not getting any stream or snapshot/image. When inside the home app, there is a line over a camera, and when I press the camera it starts loading but it comes out black screen... Also I am not able to get a snapshot when I test it by using the link...

This is my config.json file: { "bridge": { "name": "Home", "username": "CC:22:3D:E3:CE:30", "port": 51826, "pin": "123-45-678" },

"platforms": [ { "platform": "Video-doorbell", "cameras": [{ "name": "Ringeklokke", "port": 5005, "videoConfig": { "source": "-re -i rtsp://xxxxxx:[email protected]:554/s1", "stillImageSource": "-i http://faster_still_image_grab_url/this_is_optional.jpg", "maxWidth": 1280, "maxHeight": 720, "maxFPS": 30 } } ] } ] }

Mr-S-D avatar May 26 '18 20:05 Mr-S-D