Baro constants  [Solved]

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
Number8
Posts: 374
Joined: Friday 23 May 2014 7:55
Target OS: Linux
Domoticz version: 2022.1
Location: Saint Pierre de Jards
Contact:

Baro constants

Post by Number8 »

Hello
Baro constants currently features: BARO_STABLE, BARO_SUNNY, BARO_CLOUDY, BARO_UNSTABLE, BARO_THUNDERSTORM. Wunderground API returns a comprehensive set of forecast conditions that is: Chance of Flurries, Chance of Rain, Chance of Freezing Rain, Chance of Sleet, Chance of Snow, Chance of Thunderstorms, Clear, Cloudy, Flurries, Fog, Haze, Mostly Cloudy, Mostly Sunny, Partly Cloudy, Partly Sunny, Freezing Rain, Rain, Sleet, Snow, Sunny, Thunderstorms, Unknown, Overcast, Scattered Clouds.

I'm wondering whether the number of dzvents constants is a current limitation of dzvents or a Domoticz limitation.
Thank you
Debian buster on NUC and three RPi with buster.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Baro constants  [Solved]

Post by waaren »

Short answer: the number of BARO constants are limited in domoticz

if you look in the source file main/RFXtrx.h you'll find:

#define baroForecastNoInfo 0x00
#define baroForecastSunny 0x01
#define baroForecastPartlyCloudy 0x02
#define baroForecastCloudy 0x03
#define baroForecastRain 0x04

and in dzVents/runtime/device-adapters/barometer_device.lua
local constMapping = {
['stable'] = 0,
['sunny'] = 1,
['cloudy'] = 2,
['unstable'] = 3,
['thunderstorm'] = 4
}

The Baro forecast from domoticz are based on the current atmospheric air-pressure and therewith the forecast quality is limited. Given this limited forecast quality it would not add a lot of value to distinguish more weather characteristics.
I know that the buienradar forecast is also based on a lot of other information and I would be surprised if the Wunderground API returns a forecast based only on the same barometer value.
Debian buster, bullseye on RPI-4, Intel NUC.
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: Baro constants

Post by Number8 »

Thanks waaren for the detailed answer
Debian buster on NUC and three RPi with buster.
hestia
Posts: 361
Joined: Monday 25 December 2017 23:06
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: Paris
Contact:

Re: Baro constants

Post by hestia »

Hello waaren
BARO_PARTLY_CLOUDY seems to be a nill value (from https://www.domoticz.com/wiki/DzVents:_ ... _scripting)
The others are ok
The result of a print test: nothing for BARO_PARTLY_CLOUDY =>

BARO_NOINFO
noinfo
BARO_SUNNY
sunny
BARO_PARTLY_CLOUDY
BARO_CLOUDY
cloudy
BARO_RAIN
rain

Could you advise with the right value?

Thanks in advance
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Baro constants

Post by waaren »

hestia wrote: Friday 28 September 2018 23:14 ...BARO_PARTLY_CLOUDY seems to be a nill value (from https://www.domoticz.com/wiki/DzVents:_ ... _scripting)
...
This is a typing error in the wiki. The right "constant" name is BARO_PARTLYCLOUDY whch has the value 'partlycloudy'
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
hestia
Posts: 361
Joined: Monday 25 December 2017 23:06
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: Paris
Contact:

Re: Baro constants

Post by hestia »

Thanks waaren for this quick answer
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest