Here is the npm project: https://www.npmjs.com/package/node-domoticz-mqtt
Here is the code: https://github.com/nayrnet/node-domoticz-mqtt
What is the MQTT Interface? Its identical to the JSON HTTP GET interface with these important differences:
- Persistent Connection - Quick Response without setting up full blown HTTP connections for every update. Great if your changing lots of devices.
- Bi-Directional - Get instant status updates without polling for changes, no need to call your app via HTTP/Script
- MQTT Broker provides simple security for devices, with crypto support. great if your locking down the Web interface for security reasons.
- Your NodeJS app will have nearly all the benefits of native hardware
Why NodeJS? Well tons of hardware is already supported by NodeJS, for example:
- Rasbery Pi GPIO - https://www.npmjs.com/package/raspi-io
- BeagleBone Black GPIO - https://www.npmjs.com/package/beaglebone-io
- PowerMate USB Knob - https://www.npmjs.com/package/node-powermate
This solution does not require node-red or any of that, this lets you develop NodeJS applications interacting directly with Domoticz. All you need to do is install mosquito locally and add and configure the MQTT Hardware within Domoticz. Your now ready to start using this module.
- MQTT Broker (apt-get install mosquitto)
- NodeJS and NPM (apt-get install nodejs npm)
- Domoticz w/MQTT Hardware Interface
Code: Select all
npm install node-domoticz-mqtt
Support, Feedback, Contributions, etc should all be done in this thread or my github repo.. thanks and enjoy!
Ive got several NodeJS Applications that will be using this module, and more planned.. I should be able to finally add BeagleBone Black support to Domoticz soon!