Hello,
It is my understanding that updateRain(rate, counter) documentation should be : updateRain(rate*100, counter) as its JSON equivalent . However the data sent do InfluxDB should be divided by 100 to get the correct display. Am I correct?
dzVents 3.04
updateRain(rate, counter) error [Solved]
Moderator: leecollings
-
Number8
- Posts: 374
- Joined: Friday 23 May 2014 7:55
- Target OS: Linux
- Domoticz version: 2022.1
- Location: Saint Pierre de Jards
- Contact:
updateRain(rate, counter) error
Debian buster on NUC and three RPi with buster.
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: updateRain(rate, counter) error
It all depends where you get your rain rate value from. You are in control in what you send. If you want to muliply your source value with a factor that's ok.Number8 wrote: Saturday 09 May 2020 9:53 Hello,
It is my understanding that updateRain(rate, counter) documentation should be : updateRain(rate*100, counter) as its JSON equivalent . However the data sent do InfluxDB should be divided by 100 to get the correct display. Am I correct?
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
-
Number8
- Posts: 374
- Joined: Friday 23 May 2014 7:55
- Target OS: Linux
- Domoticz version: 2022.1
- Location: Saint Pierre de Jards
- Contact:
Re: updateRain(rate, counter) error
My understanding is that documentation as it is written for the JSON API should define what unit is expected, and in that case milliliters x 100, or whatever unit
Debian buster on NUC and three RPi with buster.
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: updateRain(rate, counter) error
Let me try to put it in other words.Number8 wrote: Saturday 09 May 2020 18:08 My understanding is that documentation as it is written for the JSON API should define what unit is expected, and in that case milliliters x 100, or whatever unit
Assume you get from an external source the rain rate with a value of 0.8. In it self that does not provide you with enough information to do something useful with it. If you would know that this number represents 0.8 mm of rain in the last hour you would have to use 80 as rate in the method updateRain()
But if your weather station defines this value as 0.8 cm during the last day, the rate you would have to enter in updateRain() is 33.3 ( 10 * 100 * 0.8 / 24 )
So the unit definition of your source determines the factor you have to use in updateRain
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
-
Number8
- Posts: 374
- Joined: Friday 23 May 2014 7:55
- Target OS: Linux
- Domoticz version: 2022.1
- Location: Saint Pierre de Jards
- Contact:
Re: updateRain(rate, counter) error
Thanks waaren, but may I say that I respectfully disagree. What I’m saying is: no matter what the raw data is, the rain rate widget displays data in mm/h. And to get it correctly displayed you have to multiply the value you have in mm/hr by 100. This is well documented in the JSON api. Then, of course depending on your raw data you have to do the math accordingly. But at the end, when you get your data in mm/h you have to apply *100. To me the documentation should reflect that. Even more, the documentation, which by the way is a real masterpiece, should define what unit is involved for each updated data. Same issue with Windspeed and Windgust where a *10 factor has to be applied.
Debian buster on NUC and three RPi with buster.
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: updateRain(rate, counter) error
Thanks for the complement on the documentation. All credits are for @dannyBloeNumber8 wrote: Sunday 10 May 2020 7:20 Even more, the documentation, which by the way is a real masterpiece, should define what unit is involved for each updated data. Same issue with Windspeed and Windgust where a *10 factor has to be applied.
From what I understand of your posts we use different words but are telling the same. Probably a language thing.
I will have another look at the documentation and make the units to be used / returned more explicit where possible. Hopefully you can help with by pointing at other methods / functions where this would be applicable. You can send them using PM
When you use the windUpdate method you don't need a factor. The unit to be used is m/sec. The underlying factor is applied in dzVents' device-adapter wind_device.lua
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
-
Number8
- Posts: 374
- Joined: Friday 23 May 2014 7:55
- Target OS: Linux
- Domoticz version: 2022.1
- Location: Saint Pierre de Jards
- Contact:
Re: updateRain(rate, counter) error [Solved]
You may be rightFrom what I understand of your posts we use different words but are telling the same. Probably a language thing.
Code: Select all
When you use the windUpdate method you don't need a factor. The unit to be used is m/sec. The underlying factor is applied in dzVents' device-adapter wind_device.luaCode: Select all
Hopefully you can help with by pointing at other methodsDebian buster on NUC and three RPi with buster.
Who is online
Users browsing this forum: No registered users and 1 guest