Page 1 of 1

How to use temperature adjustment option?

Posted: Friday 15 May 2015 14:16
by ThinkPad
Hi,

I am using a temperature + humidity sensor based on ESP8266 + DHT22: http://domoticz.com/forum/viewtopic.php ... 741#p40343

However, i have the idea that the temperature reported is too high. I tried to adjust the sensor (click 'Edit' underneath virtual temp sensor and then fill in adjustment). However, it doesn't seem to affect the indicated temperature?

How do i use this? I tried:
'-0.8'
'0.8'
'-0,8'

But none of these values seem to do anything. I also tried '-10' to see if it is because of the decimal, but that didn't do anything either.....
As a last resort i could do the calculation in my script, but Domoticz has the option already built in, so why not use that ;)

Re: How to use temperature adjustment option?

Posted: Friday 15 May 2015 20:13
by dannybloe
Not that I can answer your question but why don't you adjust the value in the esp8266 itself?

/me is heavily playing with the esp himself

Re: How to use temperature adjustment option?

Posted: Friday 15 May 2015 20:17
by ThinkPad
Yeah i will probably do that in my script, but i am curious why Domoticz ignores the adjustment setting.

Re: How to use temperature adjustment option?

Posted: Friday 15 May 2015 20:27
by bizziebis
It should work. But maybe not for all types of temperature sensors. I use -1.5 correction and it indeed is adjusted by 1.5 degrees.

Re: How to use temperature adjustment option?

Posted: Friday 15 May 2015 20:29
by ThinkPad
I think it doesn't work for a virtual sensor then....

How can i do the adjustment in the Bash script i am using?

Code: Select all

#!/bin/bash
# This script retrieves the temperature and humidity from the webpage
# generated by the code running on ESP8266 that is posted here
# http://harizanov.com/2014/11/esp8266-powered-web-server-led-control-dht22-temperaturehumidity-sensor-reading/

# Fill in variables
ESP_IP="192.168.4.248"
DOMO_IP="192.168.4.4"
DOMO_PORT="8084"
DOMO_IDX="121"

# Retrieve webpage and strip out relevant information and put information (position 13 & 16) into two variables (temp, hum)
curl -s http://$ESP_IP/dht22.tpl | grep "reading is" | awk '{print $13, $16;}' | sed 's/*C,//g' | while read temp hum
do
if awk "BEGIN {exit $hum <= 25 ? 0 : 1}"
then
   #echo "Dry"
    hum_status="2"
elif awk "BEGIN {exit $hum > 60 ? 0 : 1}"
then
    #echo "Wet"
    hum_status="3"
elif awk "BEGIN {exit (($hum >= 25)&&($hum <= 60)) ? 0 : 1}"
then
      #echo "Comfortable"
    hum_status="1"    
else
    #echo "Normal"
    hum_status='0'  
fi   
# Send data to virtual sensor in Domoticz ("Temp + Humidity").
OUTPUT=`curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$DOMO_IDX&nvalue=0&svalue=$temp;$hum;$hum_status"`
done
I tried something like:
$tempcorrected = $temp-1.2

But that won't work...

Re: How to use temperature adjustment option?

Posted: Tuesday 19 May 2015 20:10
by oopee
The adjustment setting kicks in when the sensor value is updated next time.

Re: How to use temperature adjustment option?

Posted: Tuesday 19 May 2015 20:12
by ThinkPad
gizmocuz told me at the (Dutch) Domoticz forum on Tweakers.net that the adjustment option only works for real, physical sensors. When you update a virtual sensor through JSON, the value is passed 1:1 to the database of Domoticz. And thus, ignoring the adjustment option.

So i have to fix it in my script. Will mark the topic as solved.

Re: How to use temperature adjustment option?

Posted: Wednesday 20 May 2015 10:02
by D'rMorris
ThinkPad wrote:gizmocuz told me at the (Dutch) Domoticz forum on Tweakers.net that the adjustment option only works for real, physical sensors. When you update a virtual sensor through JSON, the value is passed 1:1 to the database of Domoticz. And thus, ignoring the adjustment option.

So i have to fix it in my script. Will mark the topic as solved.
@ Thinkpad: one remark on the correction in the script. I would do the correction in a uservariable and use that in the script. This to avoid changing numerous scripts later. If you later want to change the correction, just change the uservariable and everything is updated automatically. Just my 2 cents ;)

Re: How to use temperature adjustment option?

Posted: Tuesday 29 December 2015 13:38
by janegils
I'm wondering why you can only adjust temperature values, and not humidity values.
Should be easy to add...