https://easydomoticz.com/forum/viewtopic.php?t=13278
I have no question because my project is supposed to be fully functional according to my test "water in the boottle" but only true rain will tell me...
Comments are welcome!
I thought I had a problem with zwave so I did the migration from zwave to ESP32 but in fact the rainmeter was dirty. I just clean it...
Anyway: I was not very happy with the zwave solution because data received in domoticz were not very clean so I had to clean it inside domoticz: data from the reed switch are sometime received in the bad order so I had to filter, FGBS is sometime on a bad state on switch on... I had to filter all that in the dz vents script...
Before the Davis rainmeter, I tried other solutions:
- 433 MHz Oregon PCR800: not so bad but last only one or 2 years and not anymore manufactured
- Zwave Popp Z-Rain: not reliable for 80€ : values are sometime eratic. https://www.domoticz.com/forum/viewtopic.php?t=36292
- 433 Mhz TFA 30.3233.01 +RFXcom : not really better but only 27€
Materials:
- Davis 6464M rainmeter: 149€
- RJ11 Breakout BOB-14021 at sparkfun $2.10
- RJ11 6-Pin Connector PRT-00132 at sparkfun $1.50
- ESP32 DFR0478 at DFRobot (any other ESP32 should work): $8.90
- Micro USB power supply
The rainmeter is a part of the vantage pro 2 weather station at more than 1000€ not including ethernet gateways annual service charge...
Wiring:
Connect 4 & 5 from RJ11 to GND and IO25/D2 of ESP32: wire can be reversed because connected to the reed switch inside the rainmeter Note: ESP32 and RJ11 are inside house and rainmeter outside RJ11 connection between rainmeter and ESP32
To do in domoticz:
Add a rainmeter and an alert as virtual devices. Look at the idx: rainmeter is 100 and alert 101 in my arduino program
Install arduino and the firebeetle board according to the dfrobot tutorials:
https://www.dfrobot.com/blog-1578.html
The arduino program:
Before you use and try to understand this program, things you must know:
- The rainmeter is not easy to de-bounce because the reed switch is only closed from 119ms to 141 ms
- Interrupt are used because http connection can last more than 150ms
- ESP32 is a 2 core microcontroller with multitask capabilities. Conflict are possible when you try to read/write the same variable in interrupt/main process. portENTER_CRITICAL_ISR(&mux); must be used
- You must change ssid + password + IP address + port + idx in my program
- The program autoreconnect on disconnect
- The alarm log reconnect and http error (once reliable communication is back)
- There is too much alert because the program is in test waiting for the next rain this night according to the forecast...
- Nothing to do in domoticz because eveything is done with Domoticz API/JSON URL
[Update 23/04/2024] the new code with no ghost interrupt is in the Arduino forum:
https://forum.arduino.cc/t/stange-ghost ... /1250942/3