I have a PWS with a tipping bucket type rain gauge. The PWS uses MQTT to talk to Node-Red, which in turn publishes on topic domoticz/in. The PWS is configured to upload sensor readings every 5 minutes. Node-Red forwards rain data to Domoticz in JSON format: {"command":"udevice","Idx:1234,"svalue":"rt;fl"}
In Domoticz (Version: 2023.1 running on a Raspberry Pi) rainfall data is handled by a device (Hardware: MQTT Devices, Type: Rain, SubType:TFA) which was created for that purpose. That arrangement is, to some extent, currently working. PWS data is successfully uploaded to Domoticz via Node-Red and rainfall readings are also successfully stored in the Domoticz database (Table: Rain). Each rainfall reading remains in the database until overwritten by next days data (24 hours later). PWS readings also update the Domoticz 'Weather' and 'Dashboard' screens with each new rain sensor reading received.
Other Domoticz functionality is not working, though. For example, received rainfall data is never reflected in the 'Rainfall Last 24 Hours' graphic/ chart. Nor does that data appear in the corresponding 'rainfall-last-24-hours' (.csv file) either.
PS I have screen print images relating to this issue but I am currently unable to attach them to this post.
Rainfall Last 24 Hours Not Working Topic is solved
Moderator: leecollings
- waltervl
- Posts: 5897
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: Rainfall Last 24 Hours Not Working
Did you clear your browser cache (or try in a pricvate/incognito brwser session)?
Do you see errors in the browser developer console (F12) when going to the graph page?
There should also be a table Calendar_Rain. Is there data in it? Should be the history data per day.
Are you giving the right values for rt and fl? In the correct unit of measurement (mmx100 and mm)
Do you see errors in the browser developer console (F12) when going to the graph page?
There should also be a table Calendar_Rain. Is there data in it? Should be the history data per day.
Are you giving the right values for rt and fl? In the correct unit of measurement (mmx100 and mm)
Code: Select all
/json.htm?type=command¶m=udevice&idx=IDX&nvalue=0&svalue=RAINRATE;RAINCOUNTER
IDX = id of your device (This number can be found in the devices tab in the column "IDX")
RAINRATE = amount of rain in last hour in [mm x 100]
RAINCOUNTER = continues counter of fallen Rain in [mm]
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
-
- Posts: 5
- Joined: Saturday 15 April 2023 11:22
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Rainfall Last 24 Hours Not Working
Thank you for your help @ waltervl
No, I didn't clear browsers cache nor did I try private/incognito browser sessions. I never noticed errors in the browser developer console either. To be honest, I never thought about it being a browser problem. Maybe because, although Safari is the browser I use to access Domoticz web UI, the problem manifests itself on all devices I have Safari running, which are the devices I use to access the Domoticz web UI (iMac, Mac Book, iPad an iPhone).
There is a table Rain_Calendar (not Calendar_Rain) and there tends to be data in it. I understand that that its contents should be the history of rain data per day. However, for some reason, in my system data in the table Rain_Calendar is very seldom, if ever, consistent with data in table Rain. With the exception of days with no recorded rain (0 rainfall), the amount of rain for a given day in the table Rain_Calendar never adds up to the amount of rain recorded for that day in the table Rain.
The PWS reports rain in units of mm and rain rate un mm/sec. Node-Red is set to convert the received rain rate to mm/hour and forward both data items (in units of mm and mm/hour respectively), rounded to two decimal places.
No, I didn't clear browsers cache nor did I try private/incognito browser sessions. I never noticed errors in the browser developer console either. To be honest, I never thought about it being a browser problem. Maybe because, although Safari is the browser I use to access Domoticz web UI, the problem manifests itself on all devices I have Safari running, which are the devices I use to access the Domoticz web UI (iMac, Mac Book, iPad an iPhone).
There is a table Rain_Calendar (not Calendar_Rain) and there tends to be data in it. I understand that that its contents should be the history of rain data per day. However, for some reason, in my system data in the table Rain_Calendar is very seldom, if ever, consistent with data in table Rain. With the exception of days with no recorded rain (0 rainfall), the amount of rain for a given day in the table Rain_Calendar never adds up to the amount of rain recorded for that day in the table Rain.
The PWS reports rain in units of mm and rain rate un mm/sec. Node-Red is set to convert the received rain rate to mm/hour and forward both data items (in units of mm and mm/hour respectively), rounded to two decimal places.
- waltervl
- Posts: 5897
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: Rainfall Last 24 Hours Not Working
The counter is a total counter (like your electricity counter) so you have to send the total mm of rain measured from installing the rain meter. Example:
100000 - 1000 mm rain measured until now
100000 - no rain
100100 -- 1 mm rain has fallen
100100 -- no rain
101000 -- 9 mm rain has fallen.
101000 -- no rain
100000 - 1000 mm rain measured until now
100000 - no rain
100100 -- 1 mm rain has fallen
100100 -- no rain
101000 -- 9 mm rain has fallen.
101000 -- no rain
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
-
- Posts: 5
- Joined: Saturday 15 April 2023 11:22
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Rainfall Last 24 Hours Not Working
Good morning, your example summarises quite clearly one part of what should be happening.
From that example, I guess (I have not seen this documented anywhere) that at a given interval (every 5 minutes?) the system adds an entry to the the Domoticz database Rain table. That entry could be a 0 (no rain reported from the PWS) or an amount of rain (in units of mm). Each entry also includes the corresponding rain rate (in units of mm/ hour?) from the PWS. That is the only part of the process that I have access to see/ verify. That is also what appears to be working in some way on my system. I can trace rain readings from the PWS to the Rain table in the database and into the 'Weather' and 'Dashboard' screens.
Regarding graphs/ reports, it would appear logical that entries in the Rain table would only be the starting point for generating reports/ graphs. It would also seem logical that besides a total counter, there would be partial counters to keep track of rain by the hour, by the day (24 hour period) etc. Access to how those counters are updated might help find where the problem is.
Thanks again for your help.
From that example, I guess (I have not seen this documented anywhere) that at a given interval (every 5 minutes?) the system adds an entry to the the Domoticz database Rain table. That entry could be a 0 (no rain reported from the PWS) or an amount of rain (in units of mm). Each entry also includes the corresponding rain rate (in units of mm/ hour?) from the PWS. That is the only part of the process that I have access to see/ verify. That is also what appears to be working in some way on my system. I can trace rain readings from the PWS to the Rain table in the database and into the 'Weather' and 'Dashboard' screens.
Regarding graphs/ reports, it would appear logical that entries in the Rain table would only be the starting point for generating reports/ graphs. It would also seem logical that besides a total counter, there would be partial counters to keep track of rain by the hour, by the day (24 hour period) etc. Access to how those counters are updated might help find where the problem is.
Thanks again for your help.
- waltervl
- Posts: 5897
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: Rainfall Last 24 Hours Not Working
If you use MQTT to update the Domoticz Rain device you have to send the TOTAL counter and not the delta's
But I am assuming you created a dummy rain device https://www.domoticz.com/wiki/Dummy_for ... tches#Rain
If you created a different device perhaps things are different. I only know this Rain device. Or the documentation is incorrect.....
But I am assuming you created a dummy rain device https://www.domoticz.com/wiki/Dummy_for ... tches#Rain
If you created a different device perhaps things are different. I only know this Rain device. Or the documentation is incorrect.....
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
- waltervl
- Posts: 5897
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: Rainfall Last 24 Hours Not Working
Also check this topic viewtopic.php?p=180640waltervl wrote: ↑Friday 21 April 2023 13:43 If you use MQTT to update the Domoticz Rain device you have to send the TOTAL counter and not the delta's
But I am assuming you created a dummy rain device https://www.domoticz.com/wiki/Dummy_for ... tches#Rain
If you created a different device perhaps things are different. I only know this Rain device. Or the documentation is incorrect.....
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
-
- Posts: 5
- Joined: Saturday 15 April 2023 11:22
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Rainfall Last 24 Hours Not Working
I do use MQTT to update the Domoticz Rain device. The rain device is (I believe) a dummy device created with 'Create Virtual Sensor' in Settings / Hardware / MQTT Devices.
Regarding what the PWS sends (totals or deltas), the way the system is set up is:
Every 5 minutes the PWS sends a rainfall reading to Domoticz via MQTT. Each reading represents the TOTAL amount of rain fallen in the 5 mutes period which has just ended. But maybe this is not the TOTAL Domoticz expects... maybe Domoticz expect the TOTAL for an hour... or even the TOTAL for today... it would be great if we could clarify.
In any case, the Domoticz Rain device appears to respond to these updates in a reasonable way, i.e.: when the PWS sends a non-zero reading, the device displays the amount of rain (in units of mm). The problem appears to be in the way individual readings are collated into hourly or daily totals. Maybe the problem has something to do with the 'totals' and 'deltas' for each particular period.
Thanks again for you help.
PS Attempting to attach files wit images in my first post caused me lots of problems. I will try to add images in a separate post.
Regarding what the PWS sends (totals or deltas), the way the system is set up is:
Every 5 minutes the PWS sends a rainfall reading to Domoticz via MQTT. Each reading represents the TOTAL amount of rain fallen in the 5 mutes period which has just ended. But maybe this is not the TOTAL Domoticz expects... maybe Domoticz expect the TOTAL for an hour... or even the TOTAL for today... it would be great if we could clarify.
In any case, the Domoticz Rain device appears to respond to these updates in a reasonable way, i.e.: when the PWS sends a non-zero reading, the device displays the amount of rain (in units of mm). The problem appears to be in the way individual readings are collated into hourly or daily totals. Maybe the problem has something to do with the 'totals' and 'deltas' for each particular period.
Thanks again for you help.
PS Attempting to attach files wit images in my first post caused me lots of problems. I will try to add images in a separate post.
-
- Posts: 5
- Joined: Saturday 15 April 2023 11:22
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Rainfall Last 24 Hours Not Working
Rain Device images
Who is online
Users browsing this forum: No registered users and 1 guest