Temperature adjustement doesn't work, when it is a Python Plugin device

Python and python framework

Moderator: leecollings

Post Reply
pipiche
Posts: 2016
Joined: Monday 02 April 2018 20:33
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: France
Contact:

Temperature adjustement doesn't work, when it is a Python Plugin device

Post 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
Screenshot 2018-11-26 at 12.29.18.png (59.42 KiB) Viewed 710 times
Attachments
plugin.py.gz
(1.07 KiB) Downloaded 32 times
Zigbee for Domoticz plugin / RPI3B+ / Electrolama ZZH-P / 45 devices

If the plugin provides you value, you can support me with a donation Paypal.

Wiki is available here.

Zigbee for Domoticz FAQ
pipiche
Posts: 2016
Joined: Monday 02 April 2018 20:33
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: France
Contact:

Re: Temperature adjustement doesn't work, when it is a Python Plugin device

Post 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
Zigbee for Domoticz plugin / RPI3B+ / Electrolama ZZH-P / 45 devices

If the plugin provides you value, you can support me with a donation Paypal.

Wiki is available here.

Zigbee for Domoticz FAQ
pipiche
Posts: 2016
Joined: Monday 02 April 2018 20:33
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: France
Contact:

Re: Temperature adjustement doesn't work, when it is a Python Plugin device

Post 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
Zigbee for Domoticz plugin / RPI3B+ / Electrolama ZZH-P / 45 devices

If the plugin provides you value, you can support me with a donation Paypal.

Wiki is available here.

Zigbee for Domoticz FAQ
southmind
Posts: 11
Joined: Wednesday 22 January 2020 10:07
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2 -
Location: French Riviera
Contact:

Re: Temperature adjustement doesn't work, when it is a Python Plugin device

Post 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.
Version: 2023.2
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest