Wunderground webhook

Hello Everyone,
Hoping someone can help point me in the correct direction.
I’m using a sparkfun weathershield, electron, and trying to upload various weather values to a pws onwunderground. I’m also trying to incorporate particles webhook functionality to ‘GET’ the values to my PWS. I’ve searched and gone through some older posts, but those webhooks seemed to be more about pulling values from wunderground.

Note: I’m trying to do this all through the web based tools (Integrations->webhook & Web IDE (build)). I don’t really want to use the particle CLI to create the json (webhooks).

I’ve got to the point where the firmware is pulling values, the webhook is ‘successful’, but the values are not being ‘uploaded’/pushed to wunderground.

Webhook response:

Event
The source event that triggered the webhook
{
“name”: “pushtowunderground”,
“data”: “72.4°F, 26%, 100.79 kPa, 0.00 in, Avg:0mph, Gust:0mph, Dir:0°.”,
“ttl”: 60,
“published_at”: “2018-10-22T22:15:43.613Z”,
“coreid”: “xxxxxxxxxxxxxxxxxxxxx”
}

______________________________________________–
Request
The HTTP request sent to the webhook url
GET /weatherstation/updateweatherstation.php?event=pushtowunderground&data=72.4%C2%B0F%2C%2026%25%2C%20100.79%20kPa%2C%200.00%20in%2C%20Avg%3A0mph%2C%20Gust%3A0mph%2C%20Dir%3A0%C2%B0.&published_at=2018-10-22T22%3A15%3A43.613Z&coreid=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx&ID=xxxxxxx&PASSWORD=xxxxxxxx&dateutc=now&dewptf=&humidity=&baromin=&winddir=&windspeedmph=&winddir_avg2m=&windspdmph_avg2m=&windgustdir=&windgustmph=&windgustdir_10m=&windgustmph_10m=&rainin=&dailyrainin=&softwaretype=Particle-Photon&action=updateraw&realtime=1&rtfreq=5 HTTP/1.1
User-Agent: ParticleBot/1.1 (https://docs.particle.io/webhooks)
host: rtupdate.wunderground.com
Connection: keep-alive


Webhook from particle integration: (as seen from the ‘custom template’ view)

{
“event”: “pushtowunderground”,
“responseTopic”: “hook/wu/success”,
“errorResponseTopic”: “hook/wu/error”,
“url”: “http://rtupdate.wunderground.com/weatherstation/updateweatherstation.php”,
“requestType”: “GET”,
“noDefaults”: false,
“rejectUnauthorized”: false,
“query”: {
“rtfreq”: “5”,
“realtime”: “1”,
“action”: “updateraw”,
“softwaretype”: “Particle-Photon”,
“dailyrainin”: “{{d.8.3.1}}”,
“rainin”: “{{d.8.0.1}}”,
“windgustmph_10m”: “{{d.7.2.3}}”,
“windgustdir_10m”: “{{d.7.2.0}}”,
“windgustmph”: “{{d.7.2.3}}”,
“windgustdir”: “{{d.7.2.0}}”,
“windspdmph_avg2m”: “{{d.7.1.3}}”,
“winddir_avg2m”: “{{d.7.1.0}}”,
“windspeedmph”: “{{d.7.0.3}}”,
“winddir”: “{{d.7.0.0}}”,
“baromin”: “{{d.4.1}}”,
“humidity”: “{{d.2}}”,
“dewptf”: “{{d.1.1}}”,
“dateutc”: “now”,
“PASSWORD”: “xxxxxxxx”,
“ID”: “xxxxxxxxx”
}
}

I’m not going to lie I pulled alot of this from various web sources. I thought I could be clever, and try and build into the url push the tempf=‘x’,by turning this into a string format…but that did not work.
Any help would be great!
Thanks in advance!
Clayton

FYI the Weather Underground free API service is shutting down and switching over to a paid only service. They say they will allow weather providers to still work for free but the details are still being worked out on that.

@cwrisley,

I was able to do what you wanted using the Weather Underground APIs, WebHooks and a response template. Please take a look here for complete project documentation,.

AquaMaster - Photon-based watering system

That said, Ryan is right and I am already looking for a replacement service. Still, hope this approach helps.

Chip

1 Like

Let me know what you end up switching over to. Sucks cause I have my code all perfect for pulling weather, sun, and moon data.

Thanks, I was aware of the ‘pulling’ and the change at wunderground and the api with all of the reading I’ve done trying to fix this. That change might impact the pushing of data to wunderground, but I don’t think the API in this context is the same. My scenario was more about ‘pushing’ the data to wunderground. To upload data to a pws ‘hosted’ on wunderground. And using the webhook to push data to wunderround. (not so much have the particle retrieve data from wunderground)
Hope that helps!
Thanks,
Clayton