Page 1 of 2

new airQualitySensor block ( updated airQualityEcowitt )

Posted: Sat Feb 20, 2021 4:59 pm
by davidefa
New block to show data from particulate sensor ( in my case a Plantower pms7003 ).
Shows different readings pm1.0/pm2.5/pm10.0 from same or different sensors ( configurable )

NOTE
The block is derived from airQualityEcowitt module ( only slight modifications )

Re: new airQualitySensor block ( updated airQualityEcowitt )

Posted: Tue Mar 09, 2021 5:41 am
by andyk1
Sorry, I just saw this. I did try some of your mods and have the ecowitt PP1 working with modes of my own but not the battery status and a few others. I go back to looking at it from time to time but can't seem to get some ecowitt sensors to read such as lightning. I am also using an Rpi 4B as my new Meteobridge.

Re: new airQualitySensor block ( updated airQualityEcowitt )

Posted: Tue Mar 09, 2021 4:15 pm
by davidefa
The ecowitt block expects the WBAT, RBAT, LBAT... fields for the sensors battery status. these are read from the meteotemplateLive.txt file.
You should configure meteobridge to upload these fields too.
I have a little bit updated the block adding the WH65 and WH25 sensors reported by my wh2650.

Code: Select all

		"WS80"    => array("module_name" => "WS80", "battery_percent" => ($apiData['WBAT'] * 31), "last_seen" => $apiData['U'], "data_type" => array("Wind","Temperature","Humidity","Pressure","UV"), "firmware" => $firmware, "rf_status" => (117 - ($apiData['WBAT'] * 18)) ),
		"WH65"    => array("module_name" => "WH65", "battery_percent" => ($apiData['WH65BAT'] * 31), "last_seen" => $apiData['U'], "data_type" => array("Wind","Temperature","Humidity","Pressure","Rain","Sun","UV"), "firmware" => $firmware, "rf_status" => (117 - ($apiData['WBAT'] * 18)) ),
		"WH25"    => array("module_name" => "WH25", "battery_percent" => ($apiData['WH25BAT'] * 31), "last_seen" => $apiData['U'], "data_type" => array("Temperature","Humidity","Pressure"), "firmware" => $firmware,  "rf_status" => (117 - ($apiData['WH25BAT'] * 18)) ),
		"WH40"    => array("module_name" => "WH40", "battery_percent" => ($apiData['RBAT'] * 62), "last_seen" => $apiData['U'], "data_type" => array("Rain"), "firmware" => $firmware, "rf_status" => (89 - ($apiData['RBAT'] * 18)) ),
		"WH41"    => array("module_name" => "WH41", "battery_percent" => ($apiData['PP1BAT'] * 18), "last_seen" => $apiData['U'], "data_type" => array("pp25"), "firmware" => $firmware, "rf_status" => (150 - ($apiData['PP1BAT'] * 18)) ),
		"WH51_1"  => array("module_name" => "WH51_1", "battery_percent" => ($apiData['SM1BAT'] * 58), "last_seen" => $apiData['U'], "data_type" => array("Soil"), "firmware" => $firmware, "rf_status" => (91 - ($apiData['SM1BAT'] * 18)) ),
		"WH51_2"  => array("module_name" => "WH51_2", "battery_percent" => ($apiData['SM2BAT'] * 58), "last_seen" => $apiData['U'], "data_type" => array("Soil"), "firmware" => $firmware, "rf_status" => (91 - ($apiData['SM2BAT'] * 18)) ),
		"WH57"    => array("module_name" => "WH57", "battery_percent" => ($apiData['LBAT'] * 19), "last_seen" => $apiData['U'], "data_type" => array("Lightning"), "firmware" => $firmware, "rf_status" => (150 - ($apiData['LBAT'] * 18)) ),

In the lightning block, I see there's a reference to L, LD, LT, so you should upload these fields too ( I have no sensor so I'm not 100% sure about this )

Code: Select all

		$lightning_num = $apiData["L"];		//Number of lightning from the power on
		$lightning_dist = $apiData["LD"];	//Distance of last thunderstorm
		$lightning_time = $apiData["LT"];	//Unix Time last lightning

Re: new airQualitySensor block ( updated airQualityEcowitt )

Posted: Mon Apr 19, 2021 12:42 pm
by mchd17
any thoughts on getting this to work with a davis airlink?

Re: new airQualitySensor block ( updated airQualityEcowitt )

Posted: Mon Apr 19, 2021 2:14 pm
by davidefa
This block shows the PP1-PP4 fields of the alldataExtra database table.
Once you feed your sensor's data to PP1-PP4 you should be good to go.
So it should work with an AirLink.
Check ( in the control panel ) that the extra sensors are shown correctly.


extraSensors.png
extraSensors.png (184.17 KiB) Viewed 6396 times

Re: new airQualitySensor block ( updated airQualityEcowitt )

Posted: Mon Apr 19, 2021 3:22 pm
by mchd17
PP1 and PP2 show up in alldataExtra database table. I see no PP3.
airlink1.png
airlink1.png (173.48 KiB) Viewed 6393 times
I see no PP3 and PP4 within the API file on the Extra Table Setup. I have PP1 and PP2 Save to Database. Using meteobridge Nano.
airlink2.png
airlink2.png (167.72 KiB) Viewed 6393 times
Airqualitysensor block shows nothing.
airlink3.png
airlink3.png (353.01 KiB) Viewed 6393 times

Re: new airQualitySensor block ( updated airQualityEcowitt )

Posted: Mon Apr 19, 2021 4:43 pm
by davidefa
Ok, you are receiving only 2 of the 3 measurements of the davis airlink.

You can't include PP3 ( in configuration ) as PP3 is not present in alladataExtra ( the query to database will fail ).
If your airlink measure pm1.0, pm2.5 and pm10.0 you should verify why the third data is not received.
The files in the cache directory ( apiLog.txt, apiCache.txt... ) should give you a hint.

P.S.
I took a glimpse of your cache data, here an extract:
update PP0: 21.2

update PP1: 18.2

update PP2: 13.6
You should 'shift' your PP0-PP2 to PP1-PP3 ( after fixing this your block configuration should be ok )

Re: new airQualitySensor block ( updated airQualityEcowitt )

Posted: Mon Apr 19, 2021 6:15 pm
by mchd17
Do I do this shift in meteobridge?

Re: new airQualitySensor block ( updated airQualityEcowitt )

Posted: Mon Apr 19, 2021 6:39 pm
by mchd17
airlink6.png
airlink6.png (235.64 KiB) Viewed 6383 times
airlink5.png
airlink5.png (169.12 KiB) Viewed 6383 times

Re: new airQualitySensor block ( updated airQualityEcowitt )

Posted: Mon Apr 19, 2021 7:03 pm
by davidefa
Yes you should do it in meteobridge ( but I don't know how )

One momentary and partial solution is to change your block configuration as follow (
This will permit your block to show only pm2.5 and pm10.0 data until you fix the meteobridge upload ):


airQuality.png
airQuality.png (268.58 KiB) Viewed 6381 times

Re: new airQualitySensor block ( updated airQualityEcowitt )

Posted: Mon Apr 19, 2021 8:00 pm
by mchd17
airlink7.png
airlink7.png (297.31 KiB) Viewed 6377 times
This is how i had to do it. I compared the API file to Meteobridge Live Data. So my PP0 is actually the PM10.

Thanks for helping out this far

Re: new airQualitySensor block ( updated airQualityEcowitt )

Posted: Sat Jul 03, 2021 4:57 pm
by Ironside1977
Hola buenas tardes,

Alguien podría explicar como instalar un sensor de calidad del aire al PC, he estado mirando por internet pero no se como empezar.

Saludos.

Hello, good afternoon,

Could someone explain how to install an air quality sensor to the PC, I have been looking on the internet but I don't know how to start.

Thanks.

Re: new airQualitySensor block ( updated airQualityEcowitt )

Posted: Mon Jul 05, 2021 7:40 pm
by davidefa
Ironside1977 wrote: Sat Jul 03, 2021 4:57 pm
Could someone explain how to install an air quality sensor to the PC, I have been looking on the internet but I don't know how to start.

Thanks.
Do you want to connect the air quality sensor to your Davis Vue or do you want a sensor that connect directly to the pc ( via usb for example )?
A Davis AirLink a Purple Air or a diy 'luftdaten' could do the job

Re: new airQualitySensor block ( updated airQualityEcowitt )

Posted: Sun Jul 11, 2021 7:16 pm
by Ironside1977
davidefa wrote: Mon Jul 05, 2021 7:40 pm
Ironside1977 wrote: Sat Jul 03, 2021 4:57 pm
Could someone explain how to install an air quality sensor to the PC, I have been looking on the internet but I don't know how to start.

Thanks.
Do you want to connect the air quality sensor to your Davis Vue or do you want a sensor that connect directly to the pc ( via usb for example )?
A Davis AirLink a Purple Air or a diy 'luftdaten' could do the job
Thanks for the info¡¡¡¡

Another question, is there a block for davis Airlink ??

Thanks in advance....

Re: new airQualitySensor block ( updated airQualityEcowitt )

Posted: Tue Sep 28, 2021 11:01 am
by Julius
davidefa wrote: Sat Feb 20, 2021 4:59 pm New block to show data from particulate sensor ( in my case a Plantower pms7003 ).
Shows different readings pm1.0/pm2.5/pm10.0 from same or different sensors ( configurable )

NOTE
The block is derived from airQualityEcowitt module ( only slight modifications )
It does not show any values when used with a nettigo/sensor.community sensor-suite. While they do show up in the live data txt as PP0 (which is PM10) and PP1 (which is PM2.5). It draws conclusions (i.e. it's all green), but the values aren't shown, even though the ug/m unit is. Is this on purpose?

Re: new airQualitySensor block ( updated airQualityEcowitt )

Posted: Tue Sep 28, 2021 11:48 am
by davidefa
Please provide a link to your site, I can take a look

Re: new airQualitySensor block ( updated airQualityEcowitt )

Posted: Fri Oct 01, 2021 8:57 am
by Julius
davidefa wrote: Tue Sep 28, 2021 11:48 am Please provide a link to your site, I can take a look
That is useless, you can't see server-logs or anything. It's a test-page now; https://weer.stro.men

Re: new airQualitySensor block ( updated airQualityEcowitt )

Posted: Fri Oct 01, 2021 11:37 am
by Daali
Julius wrote: Fri Oct 01, 2021 8:57 am
davidefa wrote: Tue Sep 28, 2021 11:48 am Please provide a link to your site, I can take a look
That is useless, you can't see server-logs or anything. It's a test-page now; https://weer.stro.men
/cache is not locked down by default, and lots of errors can be derived from apiLog/cache/ecowitt.txt and inspection.

Re: new airQualitySensor block ( updated airQualityEcowitt )

Posted: Sun Oct 03, 2021 9:29 am
by Julius
Daali wrote: Fri Oct 01, 2021 11:37 am /cache is not locked down by default, and lots of errors can be derived from apiLog/cache/ecowitt.txt and inspection.
but this is not an ecowitt.txt, the sensor is an SDS011 (from a nettigo kit) for sensor.community i.e. luftdaten.
Either way, the meteobridge puts it out as follows towards meteotemplateLive.txt :

,"SW":"meteobridge","T":12.9,"TMX":12.9,"TMN":12.9,"H":94,"P":995,"W":5.4,"G":14.8,"B":247,"R":24.5,"RR":0,"S":61.5,"UV":0.6,"TIN":12.9,"HIN":94,"T1":15,"H1":85,"PP0":5.2,"PP1":1.6,"UTime":1633253073,"SWTime":1633253073,"TTime":1633253073,"TMXTime":1633253073,"TMNTime":1633253073,"HTime":1633253073,"PTime":1633253073,"WTime":1633253073,"GTime":1633253073,"BTime":1633253073,"RTime":1633253073,"RRTime":1633253073,"STime":1633253073,"UVTime":1633253073,"TINTime":1633253073,"HINTime":1633253073,"T1Time":1633253073,"H1Time":1633253073,"PP0Time":1633253073,"PP1Time":1633253073,"D":11.9,"DTime":1633253073,"A":12.5,"ATime":1633253073}

Where "PP0" is PM 10 and "PP1" is PM 2.5. I have tried to switch the PP0 around, so that PP1 is the first, and PP2 would be the second, but I can't seem to get meteobridge to do that.

Re: new airQualitySensor block ( updated airQualityEcowitt )

Posted: Sun Jan 02, 2022 1:06 am
by andyk1
What I found that works in MB is adding a second station. Primary and Station one. Use the same IP address for both and for some reason you can switch pm10 and pm2.5 around. I had to do this to also get my lightning sensor to work.

Andy

Re: new airQualitySensor block ( updated airQualityEcowitt )

Posted: Tue Mar 29, 2022 4:16 pm
by Gerrit
Good day to you,

I can only see two sensors of the airlink, has anyone managed to get all three visible?

Gerrit

Re: new airQualitySensor block ( updated airQualityEcowitt )

Posted: Tue Mar 29, 2022 4:54 pm
by davidefa
in your cache/apiLog.txt I see your sensors are:

Code: Select all

update PP0: 36.7
update PP1: 31.9
update PP2: 17.6
Meteotemplate uses PP1-PP8 ( so you should 'shift the names by 1' )

Re: new airQualitySensor block ( updated airQualityEcowitt )

Posted: Tue Mar 29, 2022 5:08 pm
by Gerrit
There are only 2 visible the 1pm and the 2.5pm see attachment



Gerrit

Re: new airQualitySensor block ( updated airQualityEcowitt )

Posted: Tue Mar 29, 2022 8:16 pm
by davidefa
Your meteobridge is sending 3 particulate values: PP0, PP1, and PP2, but only PP1 and PP2 are saved in meteotemplate db.
The airqualitysensor block, retrieves ppm data from db, and so can only access PP1 and PP2.
I think you should reconfigure meteobridge to send air quality data as PP1, PP2 and PP3

Re: new airQualitySensor block ( updated airQualityEcowitt )

Posted: Wed Mar 30, 2022 1:58 pm
by Gerrit
As far as I know you cannot change sensor names and numbers in meteobridge.
I will ask on the meteobridge forum if they have a solution,

Gerrit