Page 1 of 1

There is not change unit for barometer device at setting

Posted: Tuesday 07 January 2020 15:08
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 1109 times

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

Posted: Tuesday 07 January 2020 17:39
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
}

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

Posted: Thursday 09 January 2020 0:01
by MikeF
...or in UK use mb(ar): 1 hPa = 1 mb

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

Posted: Thursday 09 January 2020 11:26
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.

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

Posted: Thursday 09 January 2020 13:40
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

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

Posted: Thursday 09 January 2020 14:08
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

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

Posted: Thursday 09 January 2020 14:43
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...

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

Posted: Thursday 09 January 2020 15:04
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 !

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

Posted: Thursday 09 January 2020 17:49
by EdwinK
O wow.. We are good in banning some stuff, but not others.