ESP8266 Air quality sensor

Everything about esp8266 and more.

Moderator: leecollings

User avatar
jvdz
Posts: 2189
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: ESP8266 Air quality sensor

Post by jvdz »

This is a setting for the MHZ19b and supported both according the manual.

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
User avatar
LouiS22
Posts: 433
Joined: Friday 27 February 2015 13:21
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Budapest, Hungary
Contact:

Re: ESP8266 Air quality sensor

Post by LouiS22 »

jvdz wrote: Tuesday 07 November 2017 18:45 Pretty sure it worked that way before I changed my ESPEASY version, which is to be expected. ;)
Hm ;)
User avatar
Igrek
Posts: 9
Joined: Sunday 22 October 2017 11:28
Target OS: NAS (Synology & others)
Domoticz version: 3.8153
Location: Moscow
Contact:

Re: ESP8266 Air quality sensor

Post by Igrek »

jvdz wrote: Tuesday 07 November 2017 18:07 Just enable the Rules in ESPEasy and add this rule:
...
Jos
Hi, Jos!
I have problem with dummy air quality, but with Custom sensor this work fine!
Big thanks!
Igor.
User avatar
jvdz
Posts: 2189
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: ESP8266 Air quality sensor

Post by jvdz »

Not sure I fully understand you post here.
You mean the standard ESPEASY setting using the HTTP & IDX settings like i show in the screenshot don't work for an Dummy Air Quality sensor but working for a custom sensor? Guess you are using the standard Mega ESPEASY?
The standard one needs the Rules approach. My version has a different device defined that fixes the used URL to update the Air Quality sensor.

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
User avatar
Igrek
Posts: 9
Joined: Sunday 22 October 2017 11:28
Target OS: NAS (Synology & others)
Domoticz version: 3.8153
Location: Moscow
Contact:

Re: ESP8266 Air quality sensor

Post by Igrek »

I understood.
The air quality sensor requires the data in parameter "&nvalue =". The standard ESPEASY plugin transmits "&svalue=". I also copied a line from another rule with "&svalue=". This works with a dummy custom type but does not work with an dummy air quality sensor.
Thanks for the tips!
User avatar
LouiS22
Posts: 433
Joined: Friday 27 February 2015 13:21
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Budapest, Hungary
Contact:

Re: ESP8266 Air quality sensor

Post by LouiS22 »

Igrek wrote: Wednesday 08 November 2017 7:10 I understood.
The air quality sensor requires the data in parameter "&nvalue =". The standard ESPEASY plugin transmits "&svalue=". I also copied a line from another rule with "&svalue=". This works with a dummy custom type but does not work with an dummy air quality sensor.
Thanks for the tips!
So, if you download the latest mega dev version (i believe v12), you can use my rule for sure.
User avatar
Igrek
Posts: 9
Joined: Sunday 22 October 2017 11:28
Target OS: NAS (Synology & others)
Domoticz version: 3.8153
Location: Moscow
Contact:

Re: ESP8266 Air quality sensor

Post by Igrek »

LouiS22 wrote: Wednesday 08 November 2017 9:28 So, if you download the latest mega dev version (i believe v12), you can use my rule for sure.
For my "MH-Z19B" sensor this possible with last assembly ESPEasy from GIt source (not v12 ) and yours rules!
nixalsschrott
Posts: 39
Joined: Tuesday 11 July 2017 10:26
Target OS: NAS (Synology & others)
Domoticz version: 2020.2
Location: Germany
Contact:

Re: ESP8266 Air quality sensor

Post by nixalsschrott »

jvdz wrote: Friday 03 November 2017 17:27 ESPEasy - Latest Mega version will work but won't update via HTTP JSON with the standard settings. My version does work with JSON. So the below only works with my GIT version at this moment.
Dear Jos,

finally I have got all components on hand.
Already prepared the components and tried to flash your firmware version after compiling with ATOM.
Unfortunately I get an error message while trying to flash.

warning espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed ....

Kind regards
Domoticz Beta | Aeon Labs Z-Wave USB Stick Gen5 | Cyrus SmartHome 4-in-1 Multisensor | Qubino ZMNHCD1 - Roller Shutter | NEO COOLCAM NAS-WR01ZE Power Plug | Fibaro FGRGB-101 | WEMOS D1 MINI (ESP8266) Sensors CO2/TEMP/BARO |
User avatar
jvdz
Posts: 2189
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: ESP8266 Air quality sensor

Post by jvdz »

Correct... I use the firmware.bin from directory: ESPEasy\.pioenvs\normal_4096 to flash my WEMOS D1 Mini.
Are you doing the initial flash via USB cable? if so, how are you doing this?
What are the exact error messages you get in the console?

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
nixalsschrott
Posts: 39
Joined: Tuesday 11 July 2017 10:26
Target OS: NAS (Synology & others)
Domoticz version: 2020.2
Location: Germany
Contact:

Re: ESP8266 Air quality sensor

Post by nixalsschrott »

Yes. And now, after disconnecting all sensors before flashing, it worked like a charm. So if using ATOM only connect the "clean" WEMOS D1 Mini without any additional sensors ... then it will work ... OK ... I will go on with your tutorial ...
Domoticz Beta | Aeon Labs Z-Wave USB Stick Gen5 | Cyrus SmartHome 4-in-1 Multisensor | Qubino ZMNHCD1 - Roller Shutter | NEO COOLCAM NAS-WR01ZE Power Plug | Fibaro FGRGB-101 | WEMOS D1 MINI (ESP8266) Sensors CO2/TEMP/BARO |
nixalsschrott
Posts: 39
Joined: Tuesday 11 July 2017 10:26
Target OS: NAS (Synology & others)
Domoticz version: 2020.2
Location: Germany
Contact:

Re: ESP8266 Air quality sensor

Post by nixalsschrott »

jvdz wrote: Friday 03 November 2017 17:27 Define the Device is the Devices tab: ...
In the devices tab I cannot configure whats shon on your screenshot. there are some environmental sensortypes, but no one for gas ...
zhb19b.PNG
zhb19b.PNG (28.05 KiB) Viewed 3081 times
Perhabs wrong image ... do I need to compile with testing modules ... ;-)
=> You need to compile "TESTING"
// I was using wrong files to compile the bin .... //
https://www.letscontrolit.com/wiki/inde ... lugin_list

Kind regards
Last edited by nixalsschrott on Sunday 17 December 2017 17:32, edited 4 times in total.
Domoticz Beta | Aeon Labs Z-Wave USB Stick Gen5 | Cyrus SmartHome 4-in-1 Multisensor | Qubino ZMNHCD1 - Roller Shutter | NEO COOLCAM NAS-WR01ZE Power Plug | Fibaro FGRGB-101 | WEMOS D1 MINI (ESP8266) Sensors CO2/TEMP/BARO |
User avatar
jvdz
Posts: 2189
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: ESP8266 Air quality sensor

Post by jvdz »

... you are sure you have the appropriate sourcecode in your directory: espeasy\ESPEasy\src ?
It should contain file _P049_MHZ19.ino and if so check the content whether line 12 doesn't look like this:

Code: Select all

#ifdef PLUGIN_BUILD_TESTING
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
nixalsschrott
Posts: 39
Joined: Tuesday 11 July 2017 10:26
Target OS: NAS (Synology & others)
Domoticz version: 2020.2
Location: Germany
Contact:

Re: ESP8266 Air quality sensor

Post by nixalsschrott »

Huhu ...
OK, now flashed the correct "Testing" Compilation ...
I also can select the correct sensor now.
But after setting up the values, I get no input ...

===> also refers to wrong files
Log shows:
ErrorLog.PNG
ErrorLog.PNG (24.03 KiB) Viewed 3074 times
Kind regards
Last edited by nixalsschrott on Sunday 17 December 2017 17:33, edited 1 time in total.
Domoticz Beta | Aeon Labs Z-Wave USB Stick Gen5 | Cyrus SmartHome 4-in-1 Multisensor | Qubino ZMNHCD1 - Roller Shutter | NEO COOLCAM NAS-WR01ZE Power Plug | Fibaro FGRGB-101 | WEMOS D1 MINI (ESP8266) Sensors CO2/TEMP/BARO |
User avatar
jvdz
Posts: 2189
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: ESP8266 Air quality sensor

Post by jvdz »

I think you aren't using my version, but the standard ESPEasy Mega version!
That one requires the indicated Rule.

so: Either use the version I have published on Github and use the Normal 4096 build with the standard settings
-or-
use the standard Mega version, flash the TEST 4096 build and add the Rule to the Rules option in ESPEasy.

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
nixalsschrott
Posts: 39
Joined: Tuesday 11 July 2017 10:26
Target OS: NAS (Synology & others)
Domoticz version: 2020.2
Location: Germany
Contact:

Re: ESP8266 Air quality sensor

Post by nixalsschrott »

OK. Sorry. I followed your link but on the website I switched to "releases" and then indeed downloaded the "original" firmware.
I know did flash your version .... fianlly .. but still getting the error "ConnectFailures 0 FreeMem 21704"
Also under devices there are no values shown ...

By the way .. I often read that the MH-Z19b should be connected to 5Volt .. manual shows 3.3V and 5V is possible. Actually I have connected to 3.3V.
Domoticz Beta | Aeon Labs Z-Wave USB Stick Gen5 | Cyrus SmartHome 4-in-1 Multisensor | Qubino ZMNHCD1 - Roller Shutter | NEO COOLCAM NAS-WR01ZE Power Plug | Fibaro FGRGB-101 | WEMOS D1 MINI (ESP8266) Sensors CO2/TEMP/BARO |
User avatar
jvdz
Posts: 2189
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: ESP8266 Air quality sensor

Post by jvdz »

Looking at the log there indeed seems to be an issue with getting the information from the mhz19.
I have no experience with that as it simply worked for me as I have detailed in my post.

Had a quick look in the manual for the MH-Z19b regarding your comment about 5v and it states:
Technical Parameters and Structure:
Working voltage 4.5 ~ 5.5 V DC
Average current < 60mA (@5V)
Peak current peak 150mA (@5V)
So I would think it indeed should have 5v in stead of 3.3v and also checked my setup which is indeed connected to 5v.
... this of course is valid for the b version only!

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
nixalsschrott
Posts: 39
Joined: Tuesday 11 July 2017 10:26
Target OS: NAS (Synology & others)
Domoticz version: 2020.2
Location: Germany
Contact:

Re: ESP8266 Air quality sensor

Post by nixalsschrott »

OK. Tried with 5V but do not get any results either.
And you are still sure with the pin connection, since I have read also different pins to use with MH-Z19B.

"Assembling
Connect the following:
MH-Z19 Tx → Wemos pin D8
MH-Z19 Rx → Wemos pin D7
MH-Z19 gnd → Wemos gnd pin
MH-Z19 vcc → Wemos 3.3V pin // 5.0V pin
"
And also GPIOs are GPIO14 and GPIO12 ...?
===> After changing GPIO Device Settings to 1st GPIO:15 (D8) and 2nd GPIO:13 (D7) it is working ... I get values for PPM and Temp!

Can`t figure out the problem. Anything else I have to adjust within the WEMOS D1?

Kind regards and thank`s for any help ...
Domoticz Beta | Aeon Labs Z-Wave USB Stick Gen5 | Cyrus SmartHome 4-in-1 Multisensor | Qubino ZMNHCD1 - Roller Shutter | NEO COOLCAM NAS-WR01ZE Power Plug | Fibaro FGRGB-101 | WEMOS D1 MINI (ESP8266) Sensors CO2/TEMP/BARO |
nixalsschrott
Posts: 39
Joined: Tuesday 11 July 2017 10:26
Target OS: NAS (Synology & others)
Domoticz version: 2020.2
Location: Germany
Contact:

Re: ESP8266 Air quality sensor

Post by nixalsschrott »

jvdz wrote: Sunday 29 October 2017 14:39 This Wemos also has 2 LUX sensors, a DHT22 Sensor for Temp&Humidity and a BMP180 Barometer (Presure).
Dear Jos,

I still have two sensors here - one BMP-180 (GY-68 ) and one DHT22 (AM2303).
Which Pins to I connect to and which virtual switches di I have to create?

Kind regards matty
Domoticz Beta | Aeon Labs Z-Wave USB Stick Gen5 | Cyrus SmartHome 4-in-1 Multisensor | Qubino ZMNHCD1 - Roller Shutter | NEO COOLCAM NAS-WR01ZE Power Plug | Fibaro FGRGB-101 | WEMOS D1 MINI (ESP8266) Sensors CO2/TEMP/BARO |
joostnl
Posts: 68
Joined: Wednesday 03 February 2016 19:22
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: ESP8266 Air quality sensor

Post by joostnl »

Thanks for al your hard work! Can you supply a photo from your hardware set up? What kind of power supply and case are you using?
User avatar
jvdz
Posts: 2189
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: ESP8266 Air quality sensor

Post by jvdz »

@nixalsschrott,
Is the MHZ19 working now for you as you post seems inclusive for me or is the Bold part added later and I should stop reading there? :D

The Bmp180 & DHT22 are connected as described in this webpage: https://diyprojects.io/esp-easydht22bmp ... -barometer

Code: Select all

Component Pin    Arduino Pin    Wemos D1 mini
DHT22     VDC     5V              5V
          GND     GND             GND
          Data    GPIO-14         D5
BMP180    VDC     5V              5V
          GND     GND             GND
          SDA     GPIO-4          D2
          SCK     GPIO-5          D1
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest