Updated ecowitt/ambient weather plugin

Post Reply
davidefa
Expert
Expert
Posts: 709
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Updated ecowitt/ambient weather plugin

Post by davidefa » Sun May 09, 2021 10:00 am

ver 2.6b
Minor update: corrected json and csv log file generation

ver 2.6a

I have updated the ecowitt plugin ( by Raffaello Di Martino ) to include the following:
- updated the ecowitt sensor list
- forwarding data ( in ecowitt or wu format ) to 2 different servers
- renaming of meteotemplate fields ( useful if you want to add sensors with same name but from different gateway, sort of )
- mapping/remapping of ecowitt fields to meteotemplate fields ( useful if you want to add a sensor that is not currently supported by the module )
- modified sensor's battery report ( no conversion any more, simply reports ecowitt battery status )

NOTE
You have to update the ecowittModule block to ver 1.4 ( as battery fields are now decoded entirely by the block )


ew_plugin.png
ew_plugin.png (187.52 KiB) Viewed 5067 times
Attachments
ecowitt_2.6b.zip
(10.68 KiB) Downloaded 78 times
ecowitt_2.6a.zip
(10.28 KiB) Downloaded 68 times
Last edited by davidefa on Sun Aug 01, 2021 11:57 pm, edited 1 time in total.
Image

davidefa
Expert
Expert
Posts: 709
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: Updated ecowitt plugin

Post by davidefa » Sat Jul 17, 2021 10:29 pm

ver 2.6d
Corrected 'password leaking' in log file ( api, ecowitt forward and wu forward)

ver 2.7
- added forwarding in awekas format
- added 'math capability' in meteotemplate format, useful if you want to scale a sensor or you want to define a new sensor as a difference of other sensors...
for example you could define:
SM1=200-#SM1#*2 ( if you want to convert the soil moisture in 0-200 range, sorta cbar )
T5=#T1#-#T4# ( if you want to measure the difference respect a reference sensor )
( to substitute a sensor value use the sensor name enclosed between two '#' chars )

ver 2.8
- added ambient weather protocol support
- added authentication support ( via password or PASSKEY )
- corrected a bug in math functionality ( causing an error when math was blank/undefined )
Attachments
ecowitt_2.8.zip
(12.59 KiB) Downloaded 64 times
ecowitt_2.7.zip
(11.84 KiB) Downloaded 50 times
ecowitt_2.6d.zip
(10.4 KiB) Downloaded 53 times
Image

davidefa
Expert
Expert
Posts: 709
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: Updated ecowitt/ambient weather plugin

Post by davidefa » Mon Aug 02, 2021 9:37 pm

ver 2.8a
- corrected extra sensor naming ( error introduced in ver 2.8 )
Attachments
ecowitt_2.8a.zip
(12.43 KiB) Downloaded 88 times
Image

spd2612
Forecaster
Forecaster
Posts: 131
Joined: Thu Jan 23, 2020 4:00 pm
Location: Fort Myers
Station model: WS-2902A/GW1000
Software: ECOWITT Plugin
Contact:

Re: Updated ecowitt/ambient weather plugin

Post by spd2612 » Fri Oct 08, 2021 12:43 pm

can you explain what the 2 different paths are here

Path: /plugins/ecowitt/report/
Path: /plugins/ecowitt/report/index.php?PASS=xxx ( use this format if Enable authentication = password, xxx=update password )

I do not have a password set, I am trying the new one to try and get rid of a SSL error on the index page only, and it appears it comes from current conditions. If I enable my url rewrite to force https my update from ecowitt fails (this is how I determined this)

the path I have now is Path: /plugins/ecowitt/report/

If I switch it to ambient my updates stop working ???

AMB2902A Station
Image

User avatar
Daali
Advisor
Advisor
Posts: 56
Joined: Mon Jul 26, 2021 8:06 pm
Location: Georgia, US
Station model: Ecowitt GW1002
Software: Meteobridge, FOSHKplugin
Contact:

Re: Updated ecowitt/ambient weather plugin

Post by Daali » Sat Oct 09, 2021 4:32 am

spd2612 wrote: Fri Oct 08, 2021 12:43 pm can you explain what the 2 different paths are here

Path: /plugins/ecowitt/report/
Path: /plugins/ecowitt/report/index.php?PASS=xxx ( use this format if Enable authentication = password, xxx=update password )
Path: /plugins/ecowitt/report/ is for when you have the "Enable authentication" set to "No"

Path: /plugins/ecowitt/report/index.php?PASS=xxx if for when you have "Enable authentication" set to "password" where xxx= your METEOTEMPLATE UPDATE password

have you tried removing the port? or setting the url to https:// (in the php, not on the url line) and the port to 443?
https://www.jeffersonweather.com
GW1000 gateway
WS68 Anemometer
WH40 Rain Gauge
WH32 Temp/Hum
WH57 Lightning
WH41 PM2.5 Air Quality
WH45 PM2.5/10/Co2 Air Quality
WN34S Soil temperature
WH31SM Soil Moisture

spd2612
Forecaster
Forecaster
Posts: 131
Joined: Thu Jan 23, 2020 4:00 pm
Location: Fort Myers
Station model: WS-2902A/GW1000
Software: ECOWITT Plugin
Contact:

Re: Updated ecowitt/ambient weather plugin

Post by spd2612 » Sat Oct 09, 2021 11:34 am

yes I have got https in the php
I dont think Im going to be able to make the data work on https
The whole certification process is just a PIA
My Metetemplate site has gotten pretty complex with cams coming from netcam studio and everything else

with my ambient 2902A can you tell me what to add to display battery ?

also if I select Ambient in the plugin data stops updating am I missing something there?

I am also going to be testing the new Ecowitt 1100 monday It will also do custom and has a web browser
Image

davidefa
Expert
Expert
Posts: 709
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: Updated ecowitt/ambient weather plugin

Post by davidefa » Sat Oct 09, 2021 3:59 pm

I see in your cache/apiLog.txt that you are using a gw1000 to upload data to meteotemplate. In this case set 'Input data format' ( in ecowitt plugin ) to Ecowitt .
If you want to upload data via the your ws2902 set 'Input data format' ( in ecowitt plugin ) to Ambient.

I should have mentioned that I did not test the ambient protocol, so not sure it works correctly.
If it does not work please set your ws2902 as in the following image ( it is a test server of mine, so I can work it out ), and drop a note here.



ambient_tool.png
ambient_tool.png (71.3 KiB) Viewed 4464 times

NOTE
If I get correctly you installed meteotemplate in the root directory of your server ( https://www.hurricanepub.com/indexDesktop.php ) and your icons are not shown correctly ( this is because your server redirects the icon directory to another one see this thread ).
solution 1) remove the redirect ( in server configuration )
solution 2) copy the icon directory to the redirected one
solution 3) install meteotemplate in a subfolder
Image

spd2612
Forecaster
Forecaster
Posts: 131
Joined: Thu Jan 23, 2020 4:00 pm
Location: Fort Myers
Station model: WS-2902A/GW1000
Software: ECOWITT Plugin
Contact:

Re: Updated ecowitt/ambient weather plugin

Post by spd2612 » Sat Oct 09, 2021 4:31 pm

I have the SSL all sorted out now
My index page is fine and I am forceing just the index page in php to go to https
#############################################
if(empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == "off"){
$redirect = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
header('HTTP/1.1 301 Moved Permanently');
header('Location: ' . $redirect);
exit();
#############################################
I will have to work on the Ecowitt/Ambient protocal tomorrow or Monday
I have a older GW1000 and the only way to configure it is WS View, it does not offer the Ambient Protocal
I have a new GW1100 on its way. I will try with that, the GW1100 actually has a web browser
Image

spd2612
Forecaster
Forecaster
Posts: 131
Joined: Thu Jan 23, 2020 4:00 pm
Location: Fort Myers
Station model: WS-2902A/GW1000
Software: ECOWITT Plugin
Contact:

Re: Updated ecowitt/ambient weather plugin

Post by spd2612 » Mon Oct 11, 2021 1:11 pm

Ok I have installed the Ecowitt GW 1100 and removed the GW1000, I set the plugin to Ambient and it seems to be working
I will keep and eye on what its reporting to see if it matches my console
would not work with Ambient when my 1000 was uploading, could have been the device

I do like having the web browser for the GW1100 however it works very slow in Chrome but well in firefox
ecowitt.jpg
ecowitt.jpg (35.98 KiB) Viewed 4430 times
I MAY HAVE SPOKE TO SOON
It stopped updating I will try changing it to /plugins/ecowitt/report/index.php?PASS=password

It does not update set on Ambient in the plugin however it does not go offline
It works fine set to Ecowitt


In the plugin I have my server URL set to http://hurricanepub.com/api.php
In GW1100 I now have it set to /plugins/ecowitt/report/index.php?PASS=update password
In GW1100 I have the SERVER IP set to the local Ip of the Meteotemplate server and there is a local bind set in IIS
Last edited by spd2612 on Mon Oct 11, 2021 2:16 pm, edited 1 time in total.
Image

davidefa
Expert
Expert
Posts: 709
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: Updated ecowitt/ambient weather plugin

Post by davidefa » Mon Oct 11, 2021 1:41 pm

You have to set your 'Input data format' to Ecowitt ( in the ecowitt plugin setup ) as gw1100 uploads data in ecowitt format
Image

spd2612
Forecaster
Forecaster
Posts: 131
Joined: Thu Jan 23, 2020 4:00 pm
Location: Fort Myers
Station model: WS-2902A/GW1000
Software: ECOWITT Plugin
Contact:

Re: Updated ecowitt/ambient weather plugin

Post by spd2612 » Mon Oct 11, 2021 2:20 pm

davidefa wrote: Mon Oct 11, 2021 1:41 pm You have to set your 'Input data format' to Ecowitt ( in the ecowitt plugin setup ) as gw1100 uploads data in ecowitt format
So what is the Ambient selection for ? All of Ecowitt's offsets are not the same as Ambient
Image

davidefa
Expert
Expert
Posts: 709
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: Updated ecowitt/ambient weather plugin

Post by davidefa » Mon Oct 11, 2021 4:01 pm

Quite similar, but not the same.
This is the 'ambient protocol' explained: https://help.ambientweather.net/help/advanced/
This is my post on wxforum that describes ( my understanding of ) the ecowitt protocol fields: https://www.wxforum.net/index.php?topic ... #msg429145
Moreover ecowitt parameters are 'POST' parameters, ambient parameters are 'GET'
Image

spd2612
Forecaster
Forecaster
Posts: 131
Joined: Thu Jan 23, 2020 4:00 pm
Location: Fort Myers
Station model: WS-2902A/GW1000
Software: ECOWITT Plugin
Contact:

Re: Updated ecowitt/ambient weather plugin

Post by spd2612 » Mon Oct 11, 2021 4:37 pm

davidefa wrote: Mon Oct 11, 2021 4:01 pm Quite similar, but not the same.
This is the 'ambient protocol' explained: https://help.ambientweather.net/help/advanced/
This is my post on wxforum that describes ( my understanding of ) the ecowitt protocol fields: https://www.wxforum.net/index.php?topic ... #msg429145
Moreover ecowitt parameters are 'POST' parameters, ambient parameters are 'GET'
Thank You for that
It gets very confusing I think I will just leave it on Ecowitt
Image

User avatar
Daali
Advisor
Advisor
Posts: 56
Joined: Mon Jul 26, 2021 8:06 pm
Location: Georgia, US
Station model: Ecowitt GW1002
Software: Meteobridge, FOSHKplugin
Contact:

Re: Updated ecowitt/ambient weather plugin

Post by Daali » Thu Oct 14, 2021 7:26 pm

Update:
from the ecowitt log, I pulled the update and added the ID/PASSWORD

Code: Select all

https://www.pwsweather.com/pwsupdate/pwsupdate.php?id=KTNRELIA6&PASSWORD=<my_api_key>&action=updateraw&dateutc=2021-10-14T21:13:10Z&baromin=29.158&indoortempf=78.1&indoorhumidity=63&tempf=78.1&humidity=80&winddir=170&windspeedmph=0.00&windgustmph=0.00&solarradiation=69.36&UV=0&rainin=0.000&dailyrainin=0.000&softwaretype=GW1000B_V1.6.8
and got the following error code at pwsweather:
ERROR: dateutc parameter is not in proper format: %Y-%m-%d %H:%M:%S

Removing the "T" and "Z" from the dateutc to make it dateutc=2021-10-14%2021:13:10& worked and updated pwsweather!

edited out: removing bad questions.
Last edited by Daali on Fri Oct 15, 2021 2:48 am, edited 1 time in total.
https://www.jeffersonweather.com
GW1000 gateway
WS68 Anemometer
WH40 Rain Gauge
WH32 Temp/Hum
WH57 Lightning
WH41 PM2.5 Air Quality
WH45 PM2.5/10/Co2 Air Quality
WN34S Soil temperature
WH31SM Soil Moisture

User avatar
Daali
Advisor
Advisor
Posts: 56
Joined: Mon Jul 26, 2021 8:06 pm
Location: Georgia, US
Station model: Ecowitt GW1002
Software: Meteobridge, FOSHKplugin
Contact:

Re: Updated ecowitt/ambient weather plugin

Post by Daali » Fri Oct 15, 2021 2:47 am

It seems pwsweather does not like the dateutc from WU format any longer.

I was able to add a pws option, and when that was selected use everything in the WU format except the date:

Code: Select all

		// pws format
		//if (isset($weather_data['dateutc']))        {@$weather_data_pws_forward['dateutc'] = $weather_data['dateutc'] ;}
		if (isset($weather_data['baromrelin']))     {@$weather_data_pws_forward['baromin'] = $weather_data['baromrelin'] ;}
		if (isset($weather_data['tempinf']))        {@$weather_data_pws_forward['indoortempf'] = $weather_data['tempinf'] ;}
		if (isset($weather_data['humidityin']))     {@$weather_data_pws_forward['indoorhumidity'] = $weather_data['humidityin'] ;}
		if (isset($weather_data['tempf']))          {@$weather_data_pws_forward['tempf'] = $weather_data['tempf'] ;}
		if (isset($weather_data['humidity']))       {@$weather_data_pws_forward['humidity'] = $weather_data['humidity'] ;}
		if (isset($weather_data['winddir']))        {@$weather_data_pws_forward['winddir'] = $weather_data['winddir'] ;}
		if (isset($weather_data['windspeedmph']))   {@$weather_data_pws_forward['windspeedmph'] = $weather_data['windspeedmph'] ;}
		if (isset($weather_data['windgustmph']))    {@$weather_data_pws_forward['windgustmph'] = $weather_data['windgustmph'] ;}
		if (isset($weather_data['solarradiation'])) {@$weather_data_pws_forward['solarradiation'] = $weather_data['solarradiation'] ;}
		if (isset($weather_data['uv']))             {@$weather_data_pws_forward['UV'] = $weather_data['uv'] ;}
		if (isset($weather_data['hourlyrainin']))   {@$weather_data_pws_forward['rainin'] = $weather_data['hourlyrainin'] ;}
		if (isset($weather_data['dailyrainin']))    {@$weather_data_pws_forward['dailyrainin'] = $weather_data['dailyrainin'] ;}
		if (isset($weather_data['temp1f']))         {@$weather_data_pws_forward['temp2f'] = $weather_data['temp1f'] ;}
		if (isset($weather_data['temp2f']))         {@$weather_data_pws_forward['temp3f'] = $weather_data['temp2f'] ;}
		if (isset($weather_data['temp3f']))         {@$weather_data_pws_forward['temp4f'] = $weather_data['temp3f'] ;}
		if (isset($weather_data['temp4f']))         {@$weather_data_pws_forward['temp5f'] = $weather_data['temp4f'] ;}
		if (isset($weather_data['temp5f']))         {@$weather_data_pws_forward['temp6f'] = $weather_data['temp5f'] ;}
		if (isset($weather_data['temp6f']))         {@$weather_data_pws_forward['temp7f'] = $weather_data['temp6f'] ;}
		if (isset($weather_data['temp7f']))         {@$weather_data_pws_forward['temp8f'] = $weather_data['temp7f'] ;}
		if (isset($weather_data['temp8f']))         {@$weather_data_pws_forward['temp9f'] = $weather_data['temp8f'] ;}
		if (isset($weather_data['soilmoisture1']))  {@$weather_data_pws_forward['soilmoisture']  = $weather_data['soilmoisture1'] ;}
		if (isset($weather_data['soilmoisture2']))  {@$weather_data_pws_forward['soilmoisture2'] = $weather_data['soilmoisture2'] ;}
		if (isset($weather_data['soilmoisture3']))  {@$weather_data_pws_forward['soilmoisture3'] = $weather_data['soilmoisture3'] ;}
		if (isset($weather_data['soilmoisture4']))  {@$weather_data_pws_forward['soilmoisture4'] = $weather_data['soilmoisture4'] ;}
		if (isset($weather_data['soilmoisture5']))  {@$weather_data_pws_forward['soilmoisture5'] = $weather_data['soilmoisture5'] ;}
		if (isset($weather_data['soilmoisture6']))  {@$weather_data_pws_forward['soilmoisture6'] = $weather_data['soilmoisture6'] ;}
		if (isset($weather_data['soilmoisture7']))  {@$weather_data_pws_forward['soilmoisture7'] = $weather_data['soilmoisture7'] ;}
		if (isset($weather_data['soilmoisture8']))  {@$weather_data_pws_forward['soilmoisture8'] = $weather_data['soilmoisture8'] ;}
		if (isset($weather_data['stationtype']))    {@$weather_data_pws_forward['softwaretype']  = $weather_data['stationtype'] ;}
		// remap wu fields
		foreach($remapWU as $rw)
		    { if (isset($weather_data[$rw[1]])) {@$weather_data_pws_forward[$rw[0]] = $weather_data[$rw[1]];} }

add the date to the url:

Code: Select all

                $pws_date = gmdate("Y-m-d");
		$pws_time = gmdate("H:i:s");
		@$result = file_get_contents($url  . "?id=" . $forward_username_3 . "&password=" . $forward_password_3 . "&dateutc=" . $pws_date . "%20" . $pws_time . "&action=updateraw" . $wdf);
I had to add the option to setup.php. It's working, but it's not pretty =P
https://www.jeffersonweather.com
GW1000 gateway
WS68 Anemometer
WH40 Rain Gauge
WH32 Temp/Hum
WH57 Lightning
WH41 PM2.5 Air Quality
WH45 PM2.5/10/Co2 Air Quality
WN34S Soil temperature
WH31SM Soil Moisture

davidefa
Expert
Expert
Posts: 709
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: Updated ecowitt/ambient weather plugin

Post by davidefa » Fri Oct 15, 2021 6:53 am

Thanks, I'll add in next version ( I'm also adding the new ws1900 console, updating the ecowittModules block too ).
Image

davidefa
Expert
Expert
Posts: 709
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: Updated ecowitt/ambient weather plugin

Post by davidefa » Sat Nov 27, 2021 3:37 pm

ver 2.9
- added support for wn1900
- corrected wn34 battery report
- corrected wu format date reporting-
- wu format only forward 'basic' sensors ( baromin,indoortempf,indoorhumidity,tempf,humidity,winddir,windspeedmph,windgustmph,solarradiation,UV,rainin,dailyrainin)
- added wuext format to export additional sensors ( temp2f-temp9f, soilmoisture-soilmoisture8, softwaretype )

ver 2.9a
- version 2.9 was incomplete ( forwarders were disabled )

ver 2.10a
- minor update: added evapotranspiration calculation ( calculated at 23:45 )
Attachments
ecowitt_2.10a.zip
(16.99 KiB) Downloaded 89 times
ecowitt_2.9a.zip
(12.69 KiB) Downloaded 52 times
ecowitt_2.9.zip
(12.42 KiB) Downloaded 53 times
Image

User avatar
amonphi
Observer
Observer
Posts: 45
Joined: Mon Sep 10, 2018 12:52 pm
Location: Italy
Station model: Ecowitt GW1003
Software: WU
Contact:

Re: Updated ecowitt/ambient weather plugin

Post by amonphi » Mon Jan 10, 2022 12:00 pm

davidefa wrote: Sat Nov 27, 2021 3:37 pm ver 2.9
- added support for wn1900
- corrected wn34 battery report
- corrected wu format date reporting-
- wu format only forward 'basic' sensors ( baromin,indoortempf,indoorhumidity,tempf,humidity,winddir,windspeedmph,windgustmph,solarradiation,UV,rainin,dailyrainin)
- added wuext format to export additional sensors ( temp2f-temp9f, soilmoisture-soilmoisture8, softwaretype )

ver 2.9a
- version 2.9 was incomplete ( forwarders were disabled )

ver 2.10a
- minor update: added evapotranspiration calculation ( calculated at 23:45 )
Hi Davidefa
Excuse the question, I updated the plugin to the ver 2.10a, in the part "default wind measurement height (for et0 calculation)" I am not sure what height set. Having the roof weather station at a height of about 12mt from the ground and about 2mt from roof tiles, which should I indicate? Or if it is not on grassy lawn is useless to put this value?
Image

davidefa
Expert
Expert
Posts: 709
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: Updated ecowitt/ambient weather plugin

Post by davidefa » Mon Jan 10, 2022 1:34 pm

The definition is not clear enough ( I'll change it ):
default wind measurement height = Height of anemometer ( above ground )
So you should set it at 12m
Image

User avatar
amonphi
Observer
Observer
Posts: 45
Joined: Mon Sep 10, 2018 12:52 pm
Location: Italy
Station model: Ecowitt GW1003
Software: WU
Contact:

Re: Updated ecowitt/ambient weather plugin

Post by amonphi » Mon Jan 10, 2022 3:51 pm

davidefa wrote: Mon Jan 10, 2022 1:34 pm The definition is not clear enough ( I'll change it ):
default wind measurement height = Height of anemometer ( above ground )
So you should set it at 12m
Ok now it's very clear, professional as always!
Image

spd2612
Forecaster
Forecaster
Posts: 131
Joined: Thu Jan 23, 2020 4:00 pm
Location: Fort Myers
Station model: WS-2902A/GW1000
Software: ECOWITT Plugin
Contact:

Re: Updated ecowitt/ambient weather plugin

Post by spd2612 » Sun Dec 11, 2022 10:32 pm

I have the ecowitt plugin installed but i am unable to set any forwardiing or change anything I of course upgraded this from a previos version
I enter the data and go back in and its gone Is there suppose to be a save button because when I scroll all the way down The below is all I see
so it wont take any changes am I missing something version is 2.8 I am trying to use the forward to run 2 instances of meteotemplate This image is all I can see scrolled down I have looked at it on 3 computers with same result
I think there should be a SAVE? well i got rid of the first issue by updateing the ecowitt plugin but I still cant get the forward to work after I hit save go out and back in it is not there anymore
Untitled.png
Untitled.png (206.43 KiB) Viewed 517 times
Image

Post Reply