Page 1 of 1
Virtual sensor with 2 inputs
Posted: Monday 05 April 2021 12:51
by willem9136
I try to make a virtual sensor which can monitor 2 inputs.
The custom sensor asks for just one axis label.
I need 2 axis labels. Just like Temp and Humidity for example.
I want to see the position of the roofwindows of my greenhouse. Four levels 0, 1, 2 and 3.
And the inside temperature of the greenhouse. Both in one graph.
Re: Virtual sensor with 2 inputs
Posted: Tuesday 06 April 2021 20:45
by willem9136
Who can tell me where I can find the construction of for example the virtual meter for Humidity and Temperature? Maybe this gives me enough information on how to build something similar suitable for my purpose.
Re: Virtual sensor with 2 inputs
Posted: Tuesday 06 April 2021 21:21
by waltervl
You can see all the device types and how to update them through an Http api json call on
https://www.domoticz.com/wiki/Domoticz_ ... .2Fsensors
Re: Virtual sensor with 2 inputs
Posted: Tuesday 06 April 2021 21:23
by plugge
Re: Virtual sensor with 2 inputs
Posted: Wednesday 07 April 2021 12:48
by willem9136
Waltervl: I know all this. Thanks anyway.
My question is not understood I think.
All I ask is how to construct a virtual meter with 2 inputs of different types. For 1 Y axes there are plenty examples.
What I need is a 2 Y axes graph. 1 axes for temperature and 1 for position of a window. ( 4 positions) 0, 1, 2, 3 and 4.
Re: Virtual sensor with 2 inputs
Posted: Wednesday 07 April 2021 13:26
by waltervl
The Temp/hum or temp/bar devices have this double axes. You can send perhaps position 0-4 as hum or bar. Then you get 1 graph with 2 values.
you can try yourself to create a dummy device and send some sample data with the Json calls.
https://www.domoticz.com/wiki/Domoticz_ ... 2Fhumidity
If you want a position Y axis you will have to program that yourself in C+ based on the github repository as @plugge mentioned. But there is a steep learning curve. You will have to program a new device type, program database interaction, program the api, prgram the graphing and loging envirionment etc.
Another option would be to use 2 devices and merge the values in a combined graph afterwards with for example Dashticz or Grafana. But then the combined graph is not in the standard user interface.
Another option is to use the Custom Graph function in the temperature Tab and enhance that with the position device. But that will require some javascripting skills.
https://www.domoticz.com/wiki/Managing_ ... om_Graph_2
Re: Virtual sensor with 2 inputs
Posted: Wednesday 07 April 2021 14:04
by willem9136
Thanks a lot waltervl . I think I can carry on now....