Page 1 of 1

How to add a new *type* of virtual device?

Posted: Friday 23 March 2018 10:29
by axello2
I want to add some new sensors via MQTT to my domoticz system.
The first one is an air particulate sensor (Dylos DC1100), which measures the PM10 and PM2.5 particles. I send the data to the domotics/in MQTT channel, and it is received and retransmitted on the /out channel.

I modelled it after temp+humidity sensors, like thus:
/in:

Code: Select all

{"idx":24,"nvalue":0,"svalue":"261;11"}
/out:

Code: Select all

{
   "Battery" : 255,
   "RSSI" : 12,
   "dtype" : "Air Quality",
   "id" : "82024",
   "idx" : 24,
   "name" : "Dylos",
   "nvalue" : 0,
   "stype" : "Voltcraft CO-20",
   "svalue1" : "196",
   "svalue2" : "0",
   "unit" : 1
}
However, the only 'Air Quality' sensor in the predefined list is the Voltcraft CO2 sensor, and the Dylos measures something completely different.
Also, the graph does not appear with the two svalues.

Q: How does one create a device for a new type of signal and how does one create a double graph for these values?

Preferably something like this quickly photoshopped adaption:
airquality.png
airquality.png (68.68 KiB) Viewed 1985 times
I tried searching in the domoticz 'config' directory, but that seems mostly Z-Wave devices. The only other reference to the 'Voltcraft' device above is in the domoticz binary. Are all sensors hard coded???

I am happy to create a wiki page for this if I know how to do it.
Still learning...

Axel

Re: How to add a new *type* of virtual device?

Posted: Friday 23 March 2018 10:30
by axello2
Let's bump this up, since there was no reply the last 11 months :(

Re: How to add a new *type* of virtual device?

Posted: Thursday 25 October 2018 17:07
by aardbewoner
Indeed very sad there is no reply yet ,i have the same problem :x

Re: How to add a new *type* of virtual device?

Posted: Thursday 25 October 2018 23:07
by gerardvs
Are all sensors hard coded???
So it seems. I also ran against a lot of "hard-coded" (i mean bad designed) behavior of Domoticz.
For general stuff like switching some lights with minor scripting aside, Domoticz is easy-peasy. But if you have, like me, things that are a little bit different than the developper(s) had on their bench, than the bad design and lack of any architectural vision of Domoticz will give you a lot of frustrations.

Not an answer to your question but I "solved" these problems by using node-red, Influxdb and Grafana for graphing and dashboard functionality. It is fairly easy to setup and runs fine next to, and less dependent of Domoticz.

Just my 2 cts.....
--Gerard