This repository contains a MQTT Client specifically written for the LSC Smart Connect Video Doorbell (2021) and written in Go.
The application uses the Paho MQTT client to connect to an MQTT broker and publish messages about the doorbell's state. It also listens for messages from the broker to update the doorbell's state.
The doorbell's state is represented as a binary sensor in Home Assistant. The application publishes a discovery message to Home Assistant to create the binary sensor.
The camera firmware needs to run OpenIPC firmware. Detailed installation instructions can be found on the OpenIPC website.
LSC regularly introduces new versions of their products with updated hardware. If your camera looks like the one pictured on the box and has a hi3518ev300
SOC, you're good to go.
For a step-by-step installation guide, please visit: OpenIPC Installation Guide: https://openipc.org/cameras/vendors/hisilicon/socs/hi3518ev300.
For additional information, refer to the following OpenIPC Wiki at: https://github.com/OpenIPC/wiki/blob/master/en/device-lsc-smart-connect-video-doorbell-2021.md.
- Install Go on your machine if you haven't done so already.
- Clone this repository.
- Navigate to the project directory.
- Create an environment variable:
TOOLCHAIN_BIN_DIR = "/path_to/firmware/output/host/bin"
.- Note: Retrieve the toolchain from:
https://github.com/OpenIPC/firmware.git
.
- Note: Retrieve the toolchain from:
- Run
make
to compile the application. - Copy
output/lscdoorbellmqtt
directory to the sdcard of the doorbell. - Copy service file:
init.d/S96lscdoorbellmqtt
to/etc/init.d/
of the doorbell. - Start the script as a
post-up
option in/etc/network/interfaces.d/wlan0
.post-up /etc/init.d/S96lscdoorbellmqtt start
- Reboot the doorbell and test it out using the doorbell button.
- ???.
- Profit.
The application's configuration is stored in a file named config.yaml
. This file contains the following settings:
mqtt_broker
: The hostname or IP address of the MQTT broker.mqtt_port
: The port number of the MQTT broker.mqtt_client_id
: The client ID to use when connecting to the MQTT broker.mqtt_username
: The username to use when connecting to the MQTT broker.mqtt_password
: The password to use when connecting to the MQTT broker.log_level
: Log level of the application. Choose eitherINFO
orERROR
.
The application's code is divided into three packages:
- main: This package contains the application's entry point. It initializes the configuration and GPIO handler and starts the MQTT client.
- mqtt: This package contains the MQTT client and related functions. It handles connecting to the MQTT broker, subscribing to topics, publishing messages, and discovering Home Assistant.
- gpiohandler: This package handles the GPIO operations for the doorbell.
- config: This package handles the configuration of the application.
- logger: This package handles the logging of the application.
- openipc: This package handles OpenIPC specific operations.
Contributions are welcome! Please feel free to submit a pull request.
This software is released under the BOLA License.