There is not change unit for barometer device at setting Topic is solved

Moderator: leecollings

Post Reply
poleg
Posts: 7
Joined: Friday 03 January 2020 22:37
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Location: RU
Contact:

There is not change unit for barometer device at setting

Post by poleg »

I use Davis meteo station and get data from baro device. Domoticz shor baro at hPa. I check setting and dont see where i can change unit to mmHg.
baro sensor from Davis.JPG
baro sensor from Davis.JPG (9.08 KiB) Viewed 1046 times
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: There is not change unit for barometer device at setting

Post by waaren »

poleg wrote: Tuesday 07 January 2020 15:08 I use Davis meteo station and get data from baro device. Domoticz shor baro at hPa. I check setting and dont see where i can change unit to mmHg.baro sensor from Davis.JPG
You can't. It is not even allowed by law in the Netherlands. :D

Google translated this for me in
The Netherlands: legal ban on the use of mmHg
Since the Calibration Act of 1978, the use of mmHg as a unit of pressure "in the practice of a profession or business when requesting, offering or supplying goods or services" has been prohibited in the Netherlands, except for the blood pressure and pressure of other body fluids. This prohibition is repeated in the Units Decree to the Calibration Act of 1981 and in the Metrology Act of 2006. Following an amendment of the Metrology Act, this prohibition was implicitly applicable to everyone from 1 January 2010. [3] With effect from 2016 this prohibition applies explicitly to 'everyone'. [4]


Using a script and a virtual custom sensor you can work around this quite easily

Code: Select all

-- Conversion from hPa to mmHG 

return
{
    on = 
    { 
        devices = 
        {
            31 -- change to "name" or idx of your barometer device
        },
    },

    logging =   
    {
        level = domoticz.LOG_DEBUG, -- set to LOG_ERROR when tested and OK
    },
    
    execute = function(dz, item)
        _G.logMarker =  _G.moduleLabel -- set logmarker to scrptname
        hydrargyrum = dz.devices('Call me old fashioned') -- Change to name of your custom sensor (with x-as mmHG) 
        hydrargyrum.updateCustomSensor( dz.utils.round( item.barometer / 1.3322387415, 1 ))
    end
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
MikeF
Posts: 350
Joined: Sunday 19 April 2015 0:36
Target OS: Raspberry Pi / ODroid
Domoticz version: V2022.2
Location: UK
Contact:

Re: There is not change unit for barometer device at setting

Post by MikeF »

...or in UK use mb(ar): 1 hPa = 1 mb
poleg
Posts: 7
Joined: Friday 03 January 2020 22:37
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Location: RU
Contact:

Re: There is not change unit for barometer device at setting

Post by poleg »

i dont understand how i can add Dummy virtual sensor. At hardware type list i have Dummy (Does nothing, use for virtual switches only) only.
Attachments
Screenshot_106.png
Screenshot_106.png (85.29 KiB) Viewed 1017 times
poleg
Posts: 7
Joined: Friday 03 January 2020 22:37
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Location: RU
Contact:

Re: There is not change unit for barometer device at setting

Post by poleg »

if i add Dummy (Does nothing, use for virtual switches only) and add script at Setup-More Options-Events i see at Log:
2020-01-09 15:36:10.547 Status: dzVents: Info: Handling events for: "Temp Hum Baro", value: "18.2;44;1;985.8;3"
2020-01-09 15:36:10.547 Status: dzVents: Info: ------ Start internal script: Script #1: Device: "Temp Hum Baro (Davis)", Index: 17
2020-01-09 15:36:10.547 Status: dzVents: Error (2.4.19): Method updateCustomSensor is not available for device "Temp Hum Baro" (deviceType=Temp + Humidity + Baro, deviceSubType=Weather Station). If you believe this is not correct, please report.
2020-01-09 15:36:10.547 Status: dzVents: Info: ------ Finished Script #1

my script:
Spoiler: show

Code: Select all

-- Conversion from hPa to mmHG 

return
{
    on = 
    { 
        devices = 
        {
            17 -- change to "name" or idx of your barometer device
        },
    },

    logging =   
    {
        level = domoticz.LOG_DEBUG, -- set to LOG_ERROR when tested and OK
    },
    
    execute = function(dz, item)
        _G.logMarker =  _G.moduleLabel -- set logmarker to scrptname
        hydrargyrum = dz.devices('Temp Hum Baro') -- Change to name of your custom sensor (with x-as mmHG) 
        hydrargyrum.updateCustomSensor( dz.utils.round( item.barometer / 13.322387415, 1 ))
    end
}
device have name Temp Hum Baro and have idx=17
poleg
Posts: 7
Joined: Friday 03 January 2020 22:37
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Location: RU
Contact:

Re: There is not change unit for barometer device at setting

Post by poleg »

Answer how add Dummy virtual sensor at V4.10717:
1. Select Dummy (Does nothing, use for virtual switches only)
2. Click Create Virtual Sensor and select Sensor Type: Custom Sensor
poleg
Posts: 7
Joined: Friday 03 January 2020 22:37
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Location: RU
Contact:

Re: There is not change unit for barometer device at setting

Post by poleg »

my finish script:
-- Conversion from hPa to mmHG

Code: Select all

return
{
    on = 
    { 
        devices = 
        {
            17 -- change to "name" or idx of your barometer device
        },
    },

    logging =   
    {
        level = domoticz.LOG_DEBUG, -- set to LOG_ERROR when tested and OK
    },
    
    execute = function(dz, item)
        _G.logMarker =  _G.moduleLabel -- set logmarker to scrptname
        hydrargyrum = dz.devices('Barometer') -- Change to name of your custom sensor (with x-as mmHG) 
        hydrargyrum.updateCustomSensor( dz.utils.round( item.barometer * 0.75006375541921 + 6.3, 1 ))
    end
}
I used correct value 6.3 for getting result as at my MeteoStation Davis...
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: There is not change unit for barometer device at setting

Post by waaren »

poleg wrote: Thursday 09 January 2020 14:43 my finish script:
-- Conversion from hPa to mmHG
Good to see that you got it working !
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: There is not change unit for barometer device at setting

Post by EdwinK »

O wow.. We are good in banning some stuff, but not others.
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest