This project is based jeffproe's 345SecurityMQTT project which is based jlt24's 345SecurityMQTT project which is based on fusterjj's HonewellSecurityMQTT project which was based on jhaines0's HoneywellSecurity. Welcome to the open-source community :-).
It listen's for events from 345MHz security sensors and sends messages via MQTT.
It is a simple event/message translation, but some state/persistance was required to acheive debouncing of signals.
- Decodes data from sensors based on Honeywell's 345MHz system. This includes rebrands such as 2GIG, Vivint, etc.
- Requires no per-sensor configuration
- Decodes sensor status such as tamper and low battery
- Reports alarm and sensor status to an MQTT broker
- Support for multisensors. For example, a water sensor with high-temp and low-temp alerts.
- Support for some 345 keyfobs and 345 keypads.
You don't really need to do anything special for allowing the Auto Discovery messages: the Auto Discovery feature is enabled in the Home Assistant add-on.
Pay attention that each device will be discovered with multiple sensors:
- loo1-loop3: opening sensors. You'll need to identify which of them need to be used for your device.
- tamper: safety sensor.
- battery: battery sensor. Binary sensor with notifies about low battery level.
- heartbeat: connectivity sensor. HB sensor expects to get a ping message at least once in 75 minutes.
keyfob anf keyfob are not supported with MQTT Auto Discovery yet.
For more information about MQTT Auto Discovery see documentation and search the HA forum.
- RTL-SDR USB adapter; commonly available on Amazon
- rtlsdr library
- mosquittopp library
- gcc
On a Debian-based system, something like this should work:
sudo apt-get install build-essential librtlsdr-dev rtl-sdr libmosquittopp-dev
On a Alpine-based system, something like this should work:
apk add --no-cache --virtual .buildDeps build-base libusb-dev librtlsdr-dev mosquitto-dev
To avoid having to run as root, you can add the following rule to a file in /etc/udev/rules.d
:
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="2838", MODE:="0660", GROUP:="audio"
Then add the desired user to the audio
group.
If you plugged in the RTL-SDR before installing rtl-sdr, you probably will need to do something like sudo rmmod rtl2832 dvb_usb_rtl28xxu
then remove and reinstall the adapter.
Modify mqtt_config.h
to specify the host, port, username, and password of your MQTT broker. If ""
is used for the username or password, then an anonymous login is attempted. Also, the payloads of some signals can be configured.
cd src
./build.sh
./345toMqtt
Flag | Meaning | Default |
---|---|---|
-d |
Device id | 0 |
-f |
Frequency | 345000000 |
-g |
Gain | 700 |
-s |
Sample Rate | 1000000 |
-a |
Auto Discovery | false |
These environment variables will override the values set in mqtt_config.h
Variable name | Meaning |
---|---|
MQTT_HOST |
Hostname or IP address of the MQTT server |
MQTT_PORT |
Port of the MQTT server |
MQTT_USERNAME |
Username to use for logging into the MQTT server |
MQTT_PASSWORD |
Password for the provided username |
Topic | Payload | Retain |
---|---|---|
security/sensors345/sensor/<txid> /loop<N> |
OPEN or CLOSED |
Yes |
security/sensors345/sensor/<txid> /tamper |
TAMPER or OK |
Yes |
security/sensors345/sensor/<txid> /battery |
LOW or OK |
Yes |
security/sensors345/keypad/<txid> /keypress |
0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , * , # , STAY , AWAY , FIRE , POLICE |
No |
security/sensors345/keypad/<txid> /keyphrase/ |
Numbers (or # or * entered within 2 seconds of each other. Regex: [*#0-9]{2,} |
No |
security/sensors345/keyfob/<txid> /keypress |
STAY , AWAY , DISARM , AUX |
No |