npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mqtt-bridge-doorbird

v1.0.0

Published

This is an MQTT Bridge that integrates with [Doorbird][doorbird] "smart" doorbells. These doorbells offer a live camera feed, motion sensor, relays and of course a doorbell button.

Downloads

4

Readme

mqtt-bridge-doorbird

This is an MQTT Bridge that integrates with Doorbird "smart" doorbells. These doorbells offer a live camera feed, motion sensor, relays and of course a doorbell button.

This bridge can be used to get image snapshots of whatever the camera sees at any point, and also will provide them upon the doorbell being run, or any motion events. The bridge can also activate any of the relays on the device.

This bridge does not require registering with any third party services. It uses the local network API to interact with the devices.

Setup

You MUST set the environment variables DOORBIRD_USER, and DOORBIRD_PASS.

You MAY set the environment variable DOORBIRD_IP. If not set the bridge will attempt to discover the IP using bonjour discovery.

You MAY set the environment variable MQTT_ROOT. If not set it will default to doorbird. The below documentation is written as if this is set to the default.

Messages Published

The bridge will publish messages under doorbird/_ID_ where _ID_ is the WiFi MAC address of the device, as noted in the literature when you receive the device.

The bridge will also publish to 3 sub-topics (image, motion, doorbell), so in total these are all topics the bridge publishes to:

doorbird/_ID_ (QOS 0 Retained)
doorbird/_ID_/image (QOS 0 Retained)
doorbird/_ID_/motion (QOS 0 Retained)
doorbird/_ID_/doorbell (QOS 0 Retained)

The sub-topic messages are published for different events:

  • doorbird/_ID_/motion is published to whenever the device senses a motion event.
  • doorbird/_ID_/doorbell is published to whenever the doorbell button is pressed.
  • doorbird/_ID_/image is published to whenever the bridge first starts, and whenever a message of doorbird/_ID_/image is published with an empty payload. Effectively this is an on-demand "get what the camera currently sees" topic.

The payload of these subtopics includes consists of the binary bytes of a JPEG snapshot of what the doorbell receives.

The "root" topic consists of a JSON payload describing a few details about the device including the firmware version, available relays and the device name:

doorbird/DEADBEEFFADE (QOS 0 Retained)
{
  "FIRMWARE" : "000118",
  "BUILD_NUMBER" : "15514320",
  "WIFI_MAC_ADDR" : "DEADBEEFFADE",
  "RELAYS" : [ "1" ],
  "DEVICE-TYPE" : "DoorBird D101"
}

Messages Accepted

This bridge will subscribe to doorbird/#. It will respond to messages of the format doorbird/_ID_/_COMMAND_ where _ID_ is the ID of the device (as described above), and _COMMAND_ is one of the following commands:

  • info - Causes the bridge to refresh device information.
  • image - With an empty payload this will make the bridge retrieve the current image and post back to the topic doorbird/_ID_/image with the bytes of a JPEG snaphsot that the camera currently sees. The bridge ignores any image message with a payload to prevent recursion.
  • light - This activates the infrared LED, if the device is equipped with one. There is no way to turn this off, but it will turn off on its own after a period of time.
  • restart - This restarts the device
  • relay - This will activate one of the relays. The payload must contain a relay ID that is present in the RELAYS array in the JSON "root topic".

Some examples:

  • Turn light on:
doorbird/DEADBEEFFADE/light (QOS 0)
  • Activate Relay 1
doorbird/DEADBEEFFADE/relay (QOS 0)
1
  • Get the current image snapshot from the camera
doorbird/DEADBEEFFADE/image (QOS 0)