Ecowitt WH45 sensor new version

Hi Wim,

the template is working beautifully (http://www.iconoclasti.com/pwsd/), thanks as always for your work and for your great support here, it’s really incredible.

I received the new AQ sensor by ecowitt (WH45) some weeks ago, and I was thinking how to integrate it in the template.

It measures PM2.5, PM10, CO2 concentration, Temperature and Humidity, specs are in the manual: https://osswww.ecowitt.net/uploads/20201225/WH45%20Manual.pdf

I took a look at the Station Values via PWS_module_test.php, and here is the relevant data, I added a short description:


tf_co2 - temperature
humi_co2 - humidity
pm10_co2	- PM 10
pm10_24h_co2	- PM 10 24h avg.
pm25_co2	- PM 2.5
pm25_24h_co2	- PM 2.5 24h avg.
co2 - CO2
co2_24h - CO2 24h avg.		
co2_batt - sensor battery (1-5 value, where 5 is 100%. The value 6 means it's being powered via USB)

Would a specific block/module have to be developed for it or can I customize something to integrate it?

Thanks,

Alessandro

Hi!

You could use this block for integrating the WH45.
Here you can have a look at this block beforehand: https://wetter.phantasoft.de/

Regards, Oliver

MOD edit 2022-01-02 => download now at post http://discourse.weather-watch.com/

@olicat Thanks for posting your version. =D>

As soon as the Meteoalarm changes are operational, it is on my todo list.
My re-ordered WH45 will be arriving in the coming weeks, I was told it has shipped. But I can use test-values for that also.

The extra sensor values can be easily processed in livedata. Both for ecowitt and ambient.

The AQ station-block will get the extra co2 value one way or another.
The AQ station-block already supports multiple AQ-ecowitt sensors: 1-4 or outside-inside.

The co2 levels need to be tested in the notifications block and in the top-left (warning) block.
Maybe an extra small block if I can find correct warning levels for co2 concentration.
Do have to find a nice display in the or an extra pop-up.

Wim

Oliver, thanks a lot for this.

I integrated the block in PWS_blocks.php, and I can select it in the easyweather settings, but it doesn’t pickup data (it says “No WH45 CO2 sensor found”), but data is in the array actually. I guess I have to modify something else in order to pull the additional data from the ecowitt array, which file should I adapt to do this?

Hi!

You still need a few changes in PWS_blocks.php and in PWS_livedata.php:
PWS_blocks.php directly below the AQ_station_block.php block:


# AQ WH45
$script = 'AQ_wh45_block.php';
$blck_rfrs[$script]     = $rfrsh_CO2; 
$blck_ttls[$script]     = $head_AQ_co2;
$blck_ppp [$script][]   = array ('show' => true,      'popup' => 'AQ_wh45_popup.php?lang='.$used_lang,       'chartinfo' => 'popup',  'text' => $AQ_txt );
$blck_setup[$script]    = 'CO2 data from your weather-station';
$blck_type[$script]     = 'b'; 
#

And in order to record the data at all, the adaptation of PWS_livedata.php (also below the AQ program block):


#  AQ WH45
        $key    = 'pm25_co2';                       # EW-name
        if (array_key_exists ($key, $arr))
                     {  $name   = 'pm25_co2';       # PWS-name
                        $weather[$name] = (float) $arr[$key];}
        $key    = 'pm25_24h_co2';                   # EW-name
        if (array_key_exists ($key, $arr))
                     {  $name   = 'pm25_co2_24avg'; # PWS-name
                        $weather[$name] = (float) $arr[$key];}
        $key    = 'pm10_co2';                       # EW-name
        if (array_key_exists ($key, $arr))
                     {  $name   = 'pm10_co2';       # PWS-name
                        $weather[$name] = (float) $arr[$key];}
        $key    = 'pm10_24h_co2';                   # EW-name
        if (array_key_exists ($key, $arr))
                     {  $name   = 'pm10_co2_24avg'; # PWS-name
                        $weather[$name] = (float) $arr[$key];}
        $key    = 'co2';                            # EW-name
        if (array_key_exists ($key, $arr))
                     {  $name   = 'co2';       # PWS-name
                        $weather[$name] = (float) $arr[$key];}
        $key    = 'co2_24h';                        # EW-name
        if (array_key_exists ($key, $arr))
                     {  $name   = 'co2_24avg';      # PWS-name
                        $weather[$name] = (float) $arr[$key];}
        $key    = 'tf_co2';                         # EW-name
        if (array_key_exists ($key, $arr))
		                 {  $from = strtolower($fr_temp);
                        $to   = trim(strtolower($tempunit));
                        $name   = 'tf_co2';
                        $value  = $arr[$key];
                        $weather[$name] = convert_temp ($value,$from,$to);}
        $key    = 'humi_co2';                       # EW-name
        if (array_key_exists ($key, $arr))
                     {  $name   = 'humi_co2';       # PWS-name
                        $weather[$name] = (float) $arr[$key];}
        $key    = 'co2_batt';                       # EW-name
        if (array_key_exists ($key, $arr))
                     {  $name   = 'batt_co2';       # PWS-name
                        $value  = (float) $arr[$key];
                        $weather[$name.'_t'] = 'OK';
                        if ($value <= 1)  {$weather[$name.'_t'] = 'low';}
                        $weather[$name.'_v'] = $value;}

Regards, Oliver

Thanks, adding the block was ok, I was missing the PWS_livedata.php integration. :slight_smile:

It’s working fine Oliver, thank you so much. :slight_smile:

Hi!

It's working fine Oliver, thank you so much.
You are welcome. Of course you could adjust the localisation in your preferred language file. Here's mine for german - just to give you the keys you need:

# CO2/WH45 sensor
 |Our CO2 sensor|CO2-Sensor innen
 |Excellent|bestens|
 |Fine|unbedenklich|
 |Moderate|Lüften empfohlen|
 |Poor|Lüften erforderlich!|
 |Very Poor|inakzeptabel|
 |Severe|gefährlich|
 |unknown|unbekannt|
 |Excellent air|ausgezeichnete Luftqualität|
 |Fine air|gute Luftqualität, unbedenklich|
 |Moderate air, ventilation recommended|mäßige Luftqualität, Lüften empfohlen|
 |Poor air, ventilation necessary|schlechte Luftqualität, Lüften erforderlich!|
 |Very poor air, unacceptable|sehr schlechte Luftqualität, inakzeptabel!|
 |Severe air, leave the room|gefährliche Luftqualität, Raum verlassen!|

Oliver

Thanks. Here’s the italian, if someone needs it:

# CO2/WH45 sensor |Our CO2 sensor|Sensore CO2/PM25/PM10 |Excellent|Eccellente| |Fine|Tutto Ok| |Moderate|Ventilazione Consigliata| |Poor|Ventilazione necessaria!| |Very Poor|Inaccettabile| |Severe|Pericoloso!| |unknown|Ignoto| |Excellent air|Eccellente qualità dell'aria| |Fine air|Buona qualità dell'aria| |Moderate air, ventilation recommended|Qualità dell'aria moderata, ventilazione raccomandata| |Poor air, ventilation necessary|Scarsa qualità dell'aria, ventilazione necessaria!| |Very poor air, unacceptable|Pessima qualità dell'aria, inaccettabile!| |Severe air, leave the room|Qualità dell'aria pericolosa, liberare la stanza!|

Oliver,

how did you do the 4x4 design of the middle section? You customized it right? Because if I add the 4th column I can’t have the 4th row, they’re mutually exclusive options, IIRC. :slight_smile:

Hi!

how did you do the 4x4 design of the middle section?
This is actually a separate mod of the PWS_index2.php, in which I have dispensed with a configuration option. So I can no longer switch to 3 lines (but that's not what I intend to do - the 4 lines just look better at 1920x1200). Perhaps Wim should introduce this configuration option in the standard.

Regards, Oliver

I agree…it is both functional and good looking at those resolutions.

Thanks again for your help Oliver, highly appreciated.

Ciao,

Alessandro

Yes, i am working on it.
The option for a fourth column, as is now already, will remain.
And 0 → 2 extra rows making a maximum grid of 5 rows of 4 columns = 20 normal" blocks + 5 small ones.

If needed extra rows can be added later as much as needed, but I need to find a easier to maintain easyweather-solution.

The scripts which need to be changed are essential scripts: easyweather, index2, blocks.
I am now alpha testing it, will be available later this month.
Also trying to make a script to define user-blocks and modify standard blocks without touching the PWS_blocks.php script itself.

I will use @olicat script+popup as test script for that.

Wim


These are great news Wim, thank you so much for implementing them.

Idea: I don’t know if you use the ecowitt.net site to check data, they use squares, 1 for each sensor, and some months ago they implemented a drag&drop function which is really really nice. Basically, when you put the mouse on the title of the square (the name of the sensor) the mouse pointer changes and you can then left-click and drag the square to another place, so you can reorder each block.

I don’t know how hard is it to implement though. If you need further info, let me know, I don’t know if you have ecowitt sensors, in case you don’t I can make a short video.

Yes, I have a few ecowitt stations to take care off.
But I do not have any income from selling any devices and my pension is used for food and shelter.
No money left to pay co-workers to develop or give support.
My version (and all other templates also) are developed and maintained by a single person only.

Maybe my priority is wrong and less is more better? I could get rid of all extra’s easily.
I made a screenshot of a normal phone displaying my Ecowitt-station and a similar station in the PWS_Dashboard.

The Ecowitt dashboard is a javascript driven website using only 1 one block type and one data source.
I prefer mine on the right, it is a PHP driven website using multiple (large/small/popup) block-types and dozens of out-side data-sources.
I decided to include a weather-warning, more languages then Chinese and English, outside data such as forecasts.
And considering the number of users, the long list of extra’s was the better choice.

:smiley:
Wim


Dear Wim, I didn’t mean to make a comparison whatsover, I LOVE your template, if I preferred ecowitt’s, I would not use your template. Simple logic. :smiley:

You do an AMAZING work for free, I’ve always told you. And I didn’t know you were in pension, I thought you were a professional developer doing this only for passion during free time. It’s even more amazing now that I know.

I was just expressing a wish: dynamic block movement. I thought maybe there was some JS library that could be used, something like that. If it’s too hard or time-consuming no problem. :slight_smile:

Let us express our ideas, don’t take it personally, I personally appreciate a lot your work, I think you know that. :slight_smile:

Can’t wait to try your latest updates.

Ciao. :slight_smile:

Alessandro

@olicat Hi Oliver, How is your experience with the WH45 sensor after a couple of month now? Can you recommend it?
Was your noisy fan issue/WX Forum, fixed?
I will possible place an order at Lucy for the 868MHz version. How long took your shipment? I‘m currently waiting for also 3 ordered soil sensors.
And was a pickup from the legal tax office necessary?

I‘m interested in the WH45 Sensor to be placed in our combined kitchen/living room, as we also use a fire place/stove and also especially in dry winter times we have to moisten the room continuously with our Venta humidifier to increase the humidity. Especially our daughter is a little sensitive/asthmatic. The Friday for Future generation seams to be a little less robust as older generations :wink:

I assume that also the Foshkplugin MQTT forward/PreBeta of 008 will forward all WH45 Data? Would then like to match/compare as use case the WH45 Data with the Venta operation times to check its efficiency via IObroker/Grafana…

Br,

Matthias

Hi!

How is your experience with the WH45 sensor after a couple of month now? Can you recommend it?
I'm (still) not exactly sure. The fan can still be heard clearly. But I'm sitting very close to him. I don't need PM2.5 and PM10 indoors. But CO2 is very helpful, especially when you spend a lot of time in the office - I receive a push notification via FOSHKplugin when the CO2 pollution becomes too high. Then I open the window before I get a headache. Otherwise, the WH45 also contains a temperature and a humidity sensor - so it can take over the entire sensor system in one room. But it's not only quite annoying when it comes to the background noise. It's also quite expensive. A real recommendation looks different. But with regard to CO2, the WH45 is quite useful - because it is fully integrated in the Ecowitt universe.
I assume that also the Foshkplugin MQTT forward/PreBeta of 008 will forward all WH45 Data?
Of course. And it could be fully integrated within [PWSDashboard](https://wetter.phantasoft.de/).

Regards, Oliver

Attached an PHP8.1 version of the @olicat scripts.

Changes:

  • Added a smal block script to use in the top-row, it only shows the CO2 level.
  • Removed a PHP8.1 conflict using {} for dynamic field names in the pop-up
  • Moved the co2 levels to an array for easier adapting to upcoming “standards”

I will modify the original @olicat post to point to this attachment.

Wim


WH45.zip (12.6 KB)