-
-
Notifications
You must be signed in to change notification settings - Fork 255
Do It Yourself Doorbell
You can create a DIY doorbell using Scrypted Grouped Device that acts as a HomeKit Secure Video doorbell. Instructions are below, or a video is also available if preferred.
- Camera with hardware motion alerts (or an RTSP camera with OpenCV plugin installed)
- Hardware switch that can send messages to Scrypted (zwave, mqtt, webhook, etc) or HomeKit
The advantages of doing this are that you can use any combination of camera and button you want. The camera can be PoE and does not need to be attached to the button itself.
- Go to Device Groups
- Create device group
- Name the device group
- Assign it type: doorbell
- Select grouped devices:
- Camera (Camera) - this handles snapshots
- Camera (VideoCamera) - this handles video
- Camera (MotionSensor) - motion trigger
- Set type to Doorbell
- The button (BinarySensor) (zwave, mqtt, dummy, etc)
To test without an MQTT switch, you can add the plugin Dummy Binary Sensor and group it with the camera (VideoCamera) instead of the MQTT switch, and when you trigger it on the dummy binary sensor device page in the browser, it will cause the Homepod doorbell to ring and iOS devices to display the doorbell notification.
If you're using a Shelly device as the MQTT switch, here's how to set it up:
- Navigate to the web page at the local IP of your Shelly device. (The app doesn't have this setting exposed.)
- In the device's Internet/Security settings,
- Advanced Developer Settings,
- Check 'Enable MQTT' and put in the IP address of Scrypted, so that Scrypted can be the MQTT broker. Scrypted uses port 1883 for Matt. Scrypted does not use a User and Password for MQTT at this time.
- Click on the channel gear icon, Settings, Button type
- Set button type to Activation
- Click on Timer
- Set Auto-Off timer to 1 second
This will cause the button press to turn the doorbell on, and then turn it off again.
- Install the MQTT plugin.
- Activate the MQTT Broker in MQTT plugin settings.
- In the console for the MQTT plugin, find your device's name. Toggle power on and off for your shelly. It will be in a message that looks like
mqtt message $SYS/a0c64589-8cee-4342-8418-2ba9f3b59d88/new/subscribes {"clientId":"shellyuni-C45BBE5F4727","subs":[{"topic":"shellies/shellyuni-C45BBE5F4727/relay/1/command","qos":0}]}
- The "shellyuni-XXXXXXXXXXXX" is the important part of the name. This proves that the Shelly is talking to Scrypted's MQTT Broker.
- Toggling power should show a message like
mqtt message shellies/shellyuni-C45BBE5F4727/relay/0 on
This will be important for the subscription URL and knowing what event to listen for. - Give your device a name. In the 'Add Custom MQTT Handler', type the device name and click save.
- Go to configure this device.
- In the subscription URL, you want it to subscribe to your device. The url is formatted like
mqtt://localhost/shellies/shellyuni-XXXXXXXXXXXX
- substitute your device's ID which you can find in the console messages, or in your Shelly's local web page, Settings, Device Info menu. - In the code at the top of the MQTT handler device, put
mqtt.subscribe({
'relay/0': value => device.binaryState = value.text === 'on',
});
mqtt.handleTypes(ScryptedInterface.BinarySensor);
and click save at the top of the code entry block.
This is Shelly-specific code, listening for the event that the Shelly sends for relay on. If you're using a different MQTT device, you'll have to adjust the code to reflect the different message your device sends.
- Go to Device Groups
- Create device group
- Name the device group
- Assign it type: doorbell
- Select grouped devices:
- MQTT (BinarySensor) - this is the button
- Camera (Camera) - this handles snapshots
- Camera (VideoCamera) - this handles video
- Camera (MotionSensor) - motion trigger
- Set type to Doorbell
- Add the grouped device to HomeKit plugin
- Make sure the Rebroadcaster plug-in is unchecked. (Checking it would have pre-buffering on the underlying camera and the grouped device. Just the underlying camera is enough.)
- Reload HomeKit plugin.
Scrypted Docs have moved. Please visit https://docs.scrypted.app.