Smanar / Domoticz-deCONZ

deCONZ plugin for Domoticz (Zigbee application)
GNU General Public License v3.0
36 stars 27 forks source link

Agara air Pressure metter cannot be adjusted in Domoticz #104

Closed Scoperius closed 3 years ago

Scoperius commented 3 years ago

I am using Agara air Pressure meters and they measure air pressure, but usually the value should be adjusted for altitude. Using standard place in Domoticz does not impact the value reported. How to adjust the pressure? I need to add 45Hpa to the Pressure reported by the sensor.

Smanar commented 3 years ago

Arf, bad luckn have checked mine, I have a config/offset setting for temperature device, but not pression. And from my memory, using the "offset" feature in domoticz not working too.

I m seing 2 Solutions :

For the second one I can make the PR, I think it will be validated even few users use the pression sensor, but you will need some time for validation ?

Scoperius commented 3 years ago

I Think PR should be the best solution: I can manage to test it immediately having several instance Zigbee pressure sensors in place.

Smanar commented 3 years ago

Are you able to compile the code to test ?

You have the procedure here https://github.com/dresden-elektronik/deconz-rest-plugin#install-deconz-development-package-optional-linux-only So for you, after having installed deconz :

sudo apt install deconz-dev
git clone --branch pressure_offset https://github.com/Smanar/deconz-rest-plugin.git
cd deconz-rest-plugin
qmake && make -j2
sudo cp ../libde_rest_plugin.so /usr/share/deCONZ/plugins

Else I will make the PR in blind mode, but not sure I don't forget something.

This code will enable a field "state/offset" for the presence sensor.

Scoperius commented 3 years ago

Ouups, I am not familiar how to compile, but If you will have some time we can open Zoom to little bit educate me what is needed. I didnot find any new procedure in https://github.com/dresden-elektronik/deconz-rest-plugin#install-deconz-development-package-optional-linux-only may I ask you to point me where to find it?

Smanar commented 3 years ago

You was at good place ^^ , it 's "Install deCONZ development package (optional, Linux only)"

I have made a shortcut with the command you need to use on previous post, but for that you need a full Unix OS, not docker, or light OS.

Scoperius commented 3 years ago

Hmm, after compile in Raspbery4 and copying of libde_rest_plugin.so DeConz does not start. Backup copy works fine.

Smanar commented 3 years ago

Ha ? Wich one deconz version have you ?

I will make a try on real machine.

Scoperius commented 3 years ago

DeConz is 2.10.4-beta

Smanar commented 3 years ago

It work on my side, on deconz v2.12.0-beta. I have used the last version from official, the problem is perhaps from here

pi@raspberrypi:~/deCONZ/deconz-rest-plugin $ sudo apt install deconz-dev
deconz-dev is already the newest version (2.12.00-raspbian-stretch-beta).

You need to compile on the same machine you are using deconz, the compilation is "host dependent"

Scoperius commented 3 years ago

I tried to update, it seems that latest version is installed already...

pi@raspberrypi:~ $ sudo apt install deconz-dev Načítají se seznamy balíků… Hotovo Vytváří se strom závislostí
Načítají se stavové informace… Hotovo deconz-dev je již nejnovější verze (2.12.01-raspbian-buster-beta). 0 aktualizováno, 0 nově instalováno, 0 k odstranění a 240 neaktualizováno. pi@raspberrypi:~ $

Smanar commented 3 years ago

Can come from your deconz version, perhaps new plugin are not compatible with older core. But nevermind, it work on my side so will make the PR

Have corrected too the domoticz plugin front end, not possible to update the value previously.

Scoperius commented 3 years ago

How can I access the domoticz plugin front end?

Smanar commented 3 years ago

Using the domoticz menu > custom / deconz, But you need to install the beta to be able to change the "offset" value.

The PR is here https://github.com/dresden-elektronik/deconz-rest-plugin/pull/5063

Need to wait for validation now.

Scoperius commented 3 years ago

Ouuups I really do not see Custom either deconz submenu...

image

Smanar commented 3 years ago

You can see it here https://github.com/Smanar/Domoticz-deCONZ/issues/82 Just beetwen "Utility" and "Setup"

You need to enable this tab on Domoticz setting (the first page)

Scoperius commented 3 years ago

OK, I manageg to compile and also update to newest Deconz. Where can I find the offset settings? It should work this one? image

Scoperius commented 3 years ago

Finally I managed to update everything and find offset settings on Deconz page under item settings. For now it seems that not all items are updated every time properly. I will test and let you know my observation. Thanks for your support.

Scoperius commented 3 years ago

Hi, so my observations shows that the offset is not calculated every time, please see graph for Pressure. The similar situation is on all 5 sensors I have activated in my system. image

Smanar commented 3 years ago

Arf, my bad, have forget Xiaomi specificity. Unfortunately, the PR is already validated, so need to make a new one to correct it.

cd deconz-rest-plugin
git pull
git checkout pressure_offset_fix
git pull
qmake && make -j2
sudo cp ../libde_rest_plugin.so /usr/share/deCONZ/plugins

find offset settings on Deconz page under item settings

You mean in custom / deconz page ? the integrated front end in domoticz ?

Scoperius commented 3 years ago

pi@raspberrypi:~/deconz-rest-plugin $ git checkout pressure_offset_fix error: pathspec 'pressure_offset_fix' did not match any file(s) known to git

Scoperius commented 3 years ago

Yes offset settings found on custom/deconz page. Yes.

Smanar commented 3 years ago

Ok m y bad, forget to publish the branch ^^. It s online now, and compilation is faster (less files to compile)

Scoperius commented 3 years ago

Thanks a lot, now it seems that everything is going fine. Have a nice day. Petr