Ambient Weather Network Support for Weather Networks Block

Post Reply
MJW
Advisor
Advisor
Posts: 60
Joined: Sun Dec 24, 2017 2:22 pm
Station model: AW WS-2000ish
Software: Meteobridge/OIP/GW-1000
Contact:

Ambient Weather Network Support for Weather Networks Block

Post by MJW » Tue Jul 31, 2018 6:31 pm

Now that Ambient Weather has added public access to their dashboards, I am attempting to add the functionality to the Weather Networks block. I can get it to work by modifying the weatherNetworksBlock.php to add the url directly, but am trying to take it a step further. I am trying to add the public station code directly to settings.php (& createConfig.php) so that I add the code on the settings page by where the Weather Underground, CWOP and others is, and have that carried over to the block. I thought I had the editing correct, however instead of giving me the URL to AW, it gives me the URL back to my site. Can someone take a look and give me a hint what I am doing wrong? Attached are the files, createConfig.php and settings.php from the Install directory, and then setup,php, weatherNetworksBlock.php and weatherNetworksConfig.txt from the weatherNetworks block directly, plus the icon I created that goes in the icons directory.

Thanks

Mike
aw.zip
(58.12 KiB) Downloaded 110 times
So many trees in NJ!

Image

User avatar
Jachym
Site Admin
Site Admin
Posts: 1686
Joined: Fri Aug 18, 2017 10:12 pm
Location: Brno, Czech Republic
Station model: WH1080
Software: Meteobridge
Contact:

Re: Ambient Weather Network Support for Weather Networks Block

Post by Jachym » Fri Aug 03, 2018 7:17 pm

If you give me more info I can add it.

I would need the URL + the unique ID in it and some link to a logo to use

User avatar
LOBWX
Forecaster
Forecaster
Posts: 104
Joined: Sun Mar 11, 2018 6:43 pm
Location: Los Osos, CA
Station model: Ambient WS 1401-IP
Software: MeteoBridge
Contact:

Re: Ambient Weather Network Support for Weather Networks Block

Post by LOBWX » Sat Aug 04, 2018 3:24 am

For what it's worth. You'll need a application key and a api key. Then it will spit something like this out. As you can see i have two devices listed.

https://api.ambientweather.net/v1/devic ... UR-API-KEY

Code: Select all

[{"macAddress":"xx:xx:xx:xx:xx","lastData":{"dateutc":1533352740000,"winddir":211,"windspeedmph":1.8,"windgustmph":4.9,"maxdailygust":17.4,"windgustdir":237,"winddir_avg2m":189,"windspdmph_avg2m":2.4,"winddir_avg10m":225,"windspdmph_avg10m":1.3,"tempf":55.2,"humidity":99,"uv":0,"solarradiation":0,"baromrelin":29.91,"baromabsin":29.81,"tempinf":76.8,"humidityin":50,"hourlyrainin":0,"dailyrainin":0,"monthlyrainin":0,"yearlyrainin":12.62,"feelsLike":55.2,"dewPoint":54.92,"lastRain":"2018-07-22T12:06:00.000Z","date":"2018-08-04T03:19:00.000Z"},"info":{"location":"LOBWX.com","name":"WEATHERBRIDGE"}},{"macAddress":"xx:xx:xx:xx:xx","lastData":{"dateutc":1533352680000,"winddir":211,"windspeedmph":1.79,"windgustmph":2.46,"maxdailygust":17.45,"tempf":55.2,"humidity":99,"hourlyrainin":0,"dailyrainin":0,"weeklyrainin":0,"monthlyrainin":0,"yearlyrainin":12.61,"totalrainin":12.61,"tempinf":76.8,"humidityin":50,"baromrelin":30.01,"baromabsin":29.87,"uv":0,"solarradiation":0,"feelsLike":55.2,"dewPoint":54.92,"lastRain":"2018-07-22T11:15:00.000Z","date":"2018-08-04T03:18:00.000Z"},"info":{"location":"6-12-2018","name":"OIP attached to WB"}}]
Just BE NICE! That's all it takes to be a decent human...

User avatar
Dehatter
Professional
Professional
Posts: 349
Joined: Sun Jan 07, 2018 5:11 am
Location: Matthews, NC, USA
Station model: Ecowitt WH80
Software: Ecowitt GW1000
Contact:

Re: Ambient Weather Network Support for Weather Networks Block

Post by Dehatter » Mon Aug 06, 2018 7:05 am

Thanks for the AW.net update. I too added it to my weather networks. Nice work!

When you select your data to be public, the site provides you the link.

The url is constant except for the last part. you could create a setup once you know the last part.

url is https://dashboard.ambientweather.net/devices/public/

id is f59317e1b28567800a30bb3035ece913 for me.

So... Complete url is https://dashboard.ambientweather.net/de ... 3035ece913

No api applied for, or given. Just made my data public under the "Devices" tab.

Created logo in B/W that works well for dark and light at http://www.tempestasvigilate.com/templa ... ark/aw.png

Tom
Image

MJW
Advisor
Advisor
Posts: 60
Joined: Sun Dec 24, 2017 2:22 pm
Station model: AW WS-2000ish
Software: Meteobridge/OIP/GW-1000
Contact:

Re: Ambient Weather Network Support for Weather Networks Block

Post by MJW » Mon Aug 06, 2018 2:04 pm

Pulling the data via api would be a very nice addition overall, but that is not what I was trying to do. Like Dehatter (Tom) said and I explained in my first post, I have my weather networks block manually linking to the public portion of my AW dashboard, I am just trying to replicate how WU is added via settings.php so that it can be automatically linked to in the weather networks block without the manual editing we have to do now. I tried as best I could, but never could get it to work. The zip I attached have the php files I modified, that show what I am trying to do, but don't work.

thx

Mike
LOBWX wrote: Sat Aug 04, 2018 3:24 am For what it's worth. You'll need a application key and a api key. Then it will spit something like this out. As you can see i have two devices listed.

https://api.ambientweather.net/v1/devic ... UR-API-KEY

So many trees in NJ!

Image

User avatar
Dehatter
Professional
Professional
Posts: 349
Joined: Sun Jan 07, 2018 5:11 am
Location: Matthews, NC, USA
Station model: Ecowitt WH80
Software: Ecowitt GW1000
Contact:

Re: Ambient Weather Network Support for Weather Networks Block

Post by Dehatter » Tue Aug 07, 2018 7:22 pm

Well some success....
MJW wrote: Mon Aug 06, 2018 2:04 pm The zip I attached have the php files I modified, that show what I am trying to do, but don't work.
I can get Main Setup to ask for AW Station Id by adding this to setup:

Code: Select all

					<tr>
						<td>
							AW
						</td>
						<td>
							<input id="awStationID" size="35" name="awStationID" value="<?php echo $awStationID?>">
						</td>
					</tr>
And I can get the icon to open the AW dashboard using the variable by adding this to weatherNetworksBlock:

Code: Select all

if($showAW){
			?>
					<div class="networkDivWeather">
						<a href="https://dashboard.ambientweather.net/devices/public/<?php echo $awStationID?>" target="_blank">
							<img src="homepage/blocks/weatherNetworks/icons/<?php echo $theme?>/aw.png" class="logo tooltip" style="border-radius:5px" alt="" title="Ambient Weather">
						</a>
					</div>
But I cannot get setup to automatically add $awStationID to the config file when you click 'Save'...so I ended up having to manually add it. :?

Code: Select all

$awIcon = true;
$awStationID = 'f59317e1b28567800a30bb3035ece913';
I am close!!

Tom
Image

User avatar
Dehatter
Professional
Professional
Posts: 349
Joined: Sun Jan 07, 2018 5:11 am
Location: Matthews, NC, USA
Station model: Ecowitt WH80
Software: Ecowitt GW1000
Contact:

Re: Ambient Weather Network Support for Weather Networks Block

Post by Dehatter » Tue Aug 07, 2018 7:55 pm

I got it.

The complete solution is rather complex to explain but simple to deploy, so If anyone wants it just PM me.

Tom
Image

andyk1
Professional
Professional
Posts: 431
Joined: Tue Feb 27, 2018 10:56 pm
Location: OKLAHOMA, USA
Station model: Ecowitt WS90
Software: Meteobridge/GW2000B
Contact:

Re: Ambient Weather Network Support for Weather Networks Block

Post by andyk1 » Wed Aug 22, 2018 4:10 am

Yes I saw this when they opened up the public link. It did seem simple when I read it as they provided a simple link such as
https://dashboard.ambientweather.net/de ... 90aacbfef7 for my station and then a more complex method that seemed simple enough but I haven't got around to adding it yet myself.
Sure Tom I'm all ears...

Andy
Image

User avatar
Dehatter
Professional
Professional
Posts: 349
Joined: Sun Jan 07, 2018 5:11 am
Location: Matthews, NC, USA
Station model: Ecowitt WH80
Software: Ecowitt GW1000
Contact:

Re: Ambient Weather Network Support for Weather Networks Block

Post by Dehatter » Sat Sep 01, 2018 4:29 am

Booo on me. I just saw your post. I will set it up tomorrow night when I get home for you to download.

Tom
Image

User avatar
Dehatter
Professional
Professional
Posts: 349
Joined: Sun Jan 07, 2018 5:11 am
Location: Matthews, NC, USA
Station model: Ecowitt WH80
Software: Ecowitt GW1000
Contact:

Re: Ambient Weather Network Support for Weather Networks Block

Post by Dehatter » Sun Sep 02, 2018 6:46 pm

andyk1 wrote: Wed Aug 22, 2018 4:10 am Yes I saw this when they opened up the public link. It did seem simple when I read it as they provided a simple link such as
https://dashboard.ambientweather.net/de ... 90aacbfef7 for my station and then a more complex method that seemed simple enough but I haven't got around to adding it yet myself.
Sure Tom I'm all ears...
Andy has successfully added AW and you can too! Just send me a PM and I will get you set up!

Tom
Image

andyk1
Professional
Professional
Posts: 431
Joined: Tue Feb 27, 2018 10:56 pm
Location: OKLAHOMA, USA
Station model: Ecowitt WS90
Software: Meteobridge/GW2000B
Contact:

Re: Ambient Weather Network Support for Weather Networks Block

Post by andyk1 » Sun Sep 02, 2018 11:51 pm

Yep sure did. It was actually painless as Tom's direction where spot on and he actually did most of the work for me. Again Thank you Tom.
Image

Post Reply