Page 1 of 1
Temperature adjustement doesn't work, when it is a Python Plugin device
Posted: Monday 26 November 2018 12:35
by pipiche
I have documented that in an Issue under the domoticz github , when a Sensor is created from the python plugin framework, the adjustement doesn't work.
https://github.com/domoticz/domoticz/is ... -441357383
Here is a plugin.py creatin a fake temperature sensor and updating the value to 25°
If in domoticz you set an adjustement of -5° you never get this adjustement in consideration. Same for all sensors like Humidi, Pressure ...

- Screenshot 2018-11-26 at 12.29.18.png (59.42 KiB) Viewed 715 times
Re: Temperature adjustement doesn't work, when it is a Python Plugin device
Posted: Friday 30 November 2018 23:05
by pipiche
Here after is a statement from @gizmocuz
Yes, but it has been explained before.
Devices that are being updated via the 'normal/standard' way, for example via the CDomoticzHardwareBase::SendTempSensor call, are being adjusted.
That is because in (for example) MainWorker::decode_Temp the addjustment value is taken count of.
Now it seems that some script systems are poking directly to the database, and do not follow the normal way of updating sensors.
For example, if you update a dummy temp sensor via JSON (udevice call) the adjustment value is taken into account because it's been taken care of
So to the authors of those systems, i urge you to use "MainWorker::UpdateDevice" !
That's all i can say about it, please discuss this with the authors of those (script) systems where it does not work please.
I did my best to make it work for all devices in the above mentioned function... for a reason...
I think some functions in PythonObjects.cpp needs to be re-programmed to call the above mentioned function
Re: Temperature adjustement doesn't work, when it is a Python Plugin device
Posted: Monday 10 December 2018 11:39
by pipiche
Hello I have posted a PR :
https://github.com/domoticz/domoticz/pull/2899
But I was not able to go through due to my limited C++ knowledge. If anyone could help, this will improve the Python Plugin framework to use the proper Domoticz APIs for handling Temp, Hum and Pressure sensors
Re: Temperature adjustement doesn't work, when it is a Python Plugin device
Posted: Friday 14 May 2021 9:04
by southmind
Old thread but still the same problem with some devices. I use XIAOMI sensors with deConz, and I can't adjust the Temp values with devices adjust fields.
BUT , if you go to "Custom:deConz" page in domoticz and select "Sensors", you are able to open a setup window for each sensor.
In the field "Offset" you can put you adjust value. and it works !.For exemple if the room temp is 20.4°C , and you wand to remove 1.5°C from the displayed temp , you have t set -150 in the offset field.
Hope this help.