Page 1 of 1

Domoticz does not update ESPEasy MH-Z19B CO2 values

Posted: Saturday 07 July 2018 21:05
by JHO01
ESPeasy with MH-Z19B CO2 device is showing CO2 values, the virtual Domoticz device is being updated (timestamp is changing according to ESPEasy settings) but CO2 value remains zero.

Connecting to Domoticz via HTTP or MQTT, both give the same results :cry:
I have tried all the obvious, update, upgrade, reboot but so far no luck. What could be the problem?

Domoticz Version 4.9700, RPI
ESP Easy: mega-20180625 on Wemos D1 mini
Sensor 1: CO2: MH-Z19B
Sensor 2: CRTC 5000, connected to an incremental counter working flawless.
Of course I doubled, doubled checked the idx of the CO2 sensor (1951)

Logfile ESPEASY:
670659: Domoticz: Sensortype: 1 idx: 1926 values: 0
675668: MHZ19: PPM value: 350 Temp/S/U values: 32/0/0.00
675694: Domoticz: Sensortype: 6 idx: 1951 values: 350;32.0;0
680660: Domoticz: Sensortype: 1 idx: 1926 values: 0
685668: MHZ19: PPM value: 350 Temp/S/U values: 32/0/0.00
685691: Domoticz: Sensortype: 6 idx: 1951 values: 350;32.0;0
690661: Domoticz: Sensortype: 1 idx: 1926 values: 0
690702: WD : Uptime 12 ConnectFailures 0 FreeMem 19200
695658: MHZ19: PPM value: 350 Temp/S/U values: 32/0/0.00
695682: Domoticz: Sensortype: 6 idx: 1951 values: 350;32.0;0
700659: Domoticz: Sensortype: 1 idx: 1926 values: 0
705666: MHZ19: PPM value: 350 Temp/S/U values: 32/0/0.00
705690: Domoticz: Sensortype: 6 idx: 1951 values: 350;32.0;0
710662: Domoticz: Sensortype: 1 idx: 1926 values: 0
715668: MHZ19: PPM value: 350 Temp/S/U values: 32/0/0.00
715691: Domoticz: Sensortype: 6 idx: 1951 values: 350;32.0;0
720659: Domoticz: Sensortype: 1 idx: 1926 values: 0
720702: WD : Uptime 12 ConnectFailures 0 FreeMem 19200
725667: MHZ19: PPM value: 352 Temp/S/U values: 32/0/0.00
725690: Domoticz: Sensortype: 6 idx: 1951 values: 352;32.0;0

any ideas?
Screen Shot 2018-07-07 at 21.01.31.png
Screen Shot 2018-07-07 at 21.01.31.png (40.51 KiB) Viewed 4105 times
Screen Shot 2018-07-07 at 21.01.31.png
Screen Shot 2018-07-07 at 21.01.31.png (40.51 KiB) Viewed 4105 times
Screen Shot 2018-07-07 at 21.01.31.png
Screen Shot 2018-07-07 at 21.01.31.png (40.51 KiB) Viewed 4105 times

Re: Domoticz does not update ESPEasy MH-Z19B CO2 values

Posted: Saturday 07 July 2018 22:05
by jvdz
When you are running the standard ESPEASY MHZ19 code and use HTTP to update domoticz, you need to make a rule to do the update as the ESPEASY device definition is a 3 value sensor, which sends the wrong information to domoticz.
In this topic i've explained my setup and also defined the rule required: http://www.domoticz.com/forum/viewtopic ... 20#p156773

Jos

Re: Domoticz does not update ESPEasy MH-Z19B CO2 values

Posted: Sunday 08 July 2018 10:45
by JHO01
Thank you very much Jos, applied the following steps on the ESPEasy:

-Tools, advanced, check rules, Submit
-Devices, edit MH-Z19 sensor, memorize Name :D (in may case CO2), uncheck Send to Controller, Submit
-Rules: add

Code: Select all

on CO2#PPM do
 SendToHTTP,192.168.2.30,8080,/json.htm?param=udevice&type=command&idx=1951&nvalue=[CO2#PPM]
endon
Submit.
and the CO2 levels are showing up in Domoticz. Great!

Now we need some actions to get the CO2 level down :oops:

Re: Domoticz does not update ESPEasy MH-Z19B CO2 values

Posted: Sunday 08 July 2018 11:37
by jvdz
JHO01 wrote: Sunday 08 July 2018 10:45 Now we need some actions to get the CO2 level down :oops:
It is quite interesting to see the result of cooking (on gas) and more people in a room, what the does to the CO2 levels. :)

Jos