I like open source community. It is matter of time and if you sell your idea then everything is possible. I have mentioned in my last post related to Digoo DG-R8H about ongoing work towards implementing it in OpenMQTTGateway project. It would allow us to intercept weather signals on any modern ESP8266 or ESP32 and send it directly to the MQTT server in your SmartHome setup.
It happens! As you may read in this thread on the community forum, latest version in development branch has it and it works!
What is required?
- piece of ESP8266 – Wemos mini, NodeMCU or even Sonoff RF Bridge (however additional hardware hack would be required.)
- Platformio IDE – based on Visual Studio development platform where you download project code from git source and then compile and upload directly to you ESP device. Similar to Arduino IDE.
- 433 MHz receiver. There is a list of recommended ones or you may give a try with the one I have used. Everything is a matter of range you would like to get.
- and also DG-RH8 sensor
As this approach is little bit different what we get used to configure in tasmota please find few steps and screenshots how to proceed.
- Download and install Visual Studio Code from https://code.visualstudio.com/
2. Execute and install extension called Platformio IDE
3. Add github source of OpenMQTTGateway code.
4. Load project and edit WIFI and MQTT settings – in User_config.h file, uncomment
1 |
# define ESPWifiManualSetup true |
which allows you to connect your board directly to the wifi network without setting up wizard.
in the same file search for MQTT_SERVER and put your server IP.
1 2 3 |
#ifndef MQTT_SERVER # define MQTT_SERVER "10.0.1.10" #endif |
5. Enable pilight module – in User_config.h uncomment
1 |
#define ZgatewayPilight "Pilight" //ESP8266, Arduino, ESP32 |
6. Set output platform – in the file platformio.ini uncomment:
1 |
default_envs = nodemcuv2-pilight |
7. Compile your project – click in build button here:
if no errors after compiling then you should be ready to upload code into board.
8. Upload to the Wemos/NodeMCU board – Be sure that is connected to the USB port. then press upload button:
9. Followup OpenMQTTGateway setup – you find there how to connect your board with RX/TX. In short just for receiveing signal from sensor you need to get RX board connected with D3 on NodeMCU/Wemos.
10. Enjoy mqtt messages from your DG-R8H sensor
1 2 3 4 |
user@serwer ~ $ /usr/local/bin/mosquitto_sub -v -h mosquitto_IP -p 1883 -t 'home/#' home/OpenMQTTGateway_ESP8266_Pilight/LWT online home/OpenMQTTGateway_ESP8266_Pilight/version version_tag home/OpenMQTTGateway_ESP8266_Pilight/PilighttoMQTT {"message":{"id":154,"channel":0,"battery":1,"temperature":0.4,"humidity":98},"protocol":"nexus","length":"154","value":"154","repeats":2,"status":2} |
11. Integrate with OpenHAB – you may follow my previous post for more details.