IFTTT and Weather

Before I try to reinvent the wheel, I’m checking to see if someone already has a simple solution.

I want… A tile that shows a single numerical value (e.g UV index number, Temperature, etc).

I have… An Ambient Weather 5000 station that pushes data to AmbientWeather.net and Wunderground.com. I have an IFTTT Pro subscription and can use that to turn on/off devices in SmartThings.

I’ve been playing around with IFTTT, but it only triggers (switch on/off) if a value Rises Above or Falls Below a value. I found the SmartThings Edge weather driver but it doesnt appear to collect UV
and multiple temps (I use three outdoor temp sensors). Ideas on how to get a SharpTools tile to show the current temperature with these limitations?

Do any of those solutions offer a way to post data to an HTTP endpoint (eg. “webhook”)?

If IFTTT is already getting the data you need from Ambient Weather / Wunderground, you could use their ‘Webhooks’ action to post the data over to a SharpTools rule via an HTTP Trigger:

Or if you can’t push the data to a desired location, but one of those options has an API, you could use an HTTP Action within a rule to periodically query for the data.

Well, I’m halfway there so far using either the IFTTT webhook or the pull method.

I have the apiKey and apiApplication IDs for my weather station. When I browse to that URL my browser displays all the info I’m looking for ([{“tempinf”:74.5,“uv”:8}]). So that’s great.

If I use IFTTT then I can run a IFTTT rule that runs every 15 minutes that triggers the SharpTool rule. But I havent figured out how to pass the data I’m getting from my weather station to SharpTools.

I tried using SharpTools without IFTTT, but again havent been able to figure out how to capture any of the data from my weather station.

Here’s the full output of https://rt.ambientweather.net/v1/devices/?apiKey=XXXXXXX&applicationKey=YYYYYYYY if that helps:

[{"macAddress":"XX:XX:XX:XX:XX","lastData":{"dateutc":1676579820000,"tempinf":75.2,"humidityin":59,"baromrelin":29.926,"baromabsin":29.926,"tempf":83.1,"humidity":55,"winddir":140,"winddir_avg10m":136,"windspeedmph":0,"windspdmph_avg10m":1.8,"windgustmph":3.8,"maxdailygust":13,"hourlyrainin":0,"eventrainin":0,"dailyrainin":0,"weeklyrainin":0.047,"monthlyrainin":1.409,"yearlyrainin":55.571,"lightning_day":0,"lightning_time":1675995602000,"lightning_distance":3.11,"batt_lightning":0,"solarradiation":167.8,"uv":1,"soilhum1":28,"soilhum2":41,"temp1f":76.8,"temp2f":76.3,"feelsLike":84.99,"dewPoint":65.23,"feelsLikein":75.2,"dewPointin":59.9,"lastRain":"2023-02-12T09:04:00.000Z","lightning_hour":0,"tz":"America/New_York","date":"2023-02-16T20:37:00.000Z"},"info":{"name":"myStation","coords":{"coords":{"lon":-81,"lat":28},"address":"my Home","location":"my City","elevation":40,"geo":{"type":"Point","coordinates":[-81,28]}}}}]

I’m still stuck here. Other than trying a bunch of different things to see what sticks, I havent made any more progress. So far, I can browse to my Ambient Weather webpage and see a dump of all its data (above post). I cannot, for the life of me, figure out how to get SharpTools to “read” any of the specific values returned.

I’ve searched Ambient Weather’s site and GitHub and none of it references PUT, GET, POST, etc.

Here’s one of my failed attempts to get the value “UV” from Ambient Weather into my variable $UVIndex.

Anything obvious here that I’m missing?

Sometimes it’s helpful to take the JSON output and put it into a JSON formatter to make it easier to see how things are nested.

image

In your case, the data is an object nested within an array. And that object has a property called lastData which is what contains the uv property. There’s a short primer on JSON data formats here.

So the key to access your uv value would be:

[0].lastData.uv

In other words, the final fully formatted variable name would look like:

$context.response.data[0].lastData.uv

All that being said, did I understand correctly that the weather data gets pushed from your Weather Station (and its service) to IFTTT? If it’s pushed to IFTTT, you could use that to push the data over to SharpTools so you don’t have to poll for it.

YES! It’s all good now - thank you. With you setting me straight on the variable format (thanks again), I don’t need to use IFTTT.

Maybe? I had two applets in IFTTT. The 1st applet was triggered when my weather station’s UV Index (connected to Ambient Weather’s network) reached 5. Then I could trigger a rule within SharpTools. Very cludgy.

The 2nd applet ran every 15 minutes, made a web request, and then I didnt know what to do after that to get the data into SharpTools.