put my weather station data into Indigo

Posted on
Fri Apr 02, 2021 12:38 pm
Dual offline
Posts: 257
Joined: Feb 05, 2019

put my weather station data into Indigo

I have two weather stations. One reports to WeatherUnderground. The other reports to both WeatherFlow and WeatherUnderground. I have api access to both. When I enter the URL into a browser I get the info below. How do get this info into Indigo variables? Is there a plugin that can do this? Or sample python code?

From swd.weatherflow.com:
Code: Select all
{"station_id":99999,"station_name":"xxxxx","public_name":"xxxxx","latitude":99.99999,"longitude":99.99999,"timezone":"xxxxx","elevation":839.02294921875,"is_public":true,"status":{"status_code":0,"status_message":"SUCCESS"},"station_units":{"units_temp":"f","units_wind":"mph","units_precip":"in","units_pressure":"inhg","units_distance":"mi","units_direction":"cardinal","units_other":"imperial"},"outdoor_keys":["timestamp","air_temperature","barometric_pressure","station_pressure","pressure_trend","sea_level_pressure","relative_humidity","precip","precip_accum_last_1hr","precip_accum_local_day","precip_accum_local_yesterday_final","precip_minutes_local_day","precip_minutes_local_yesterday_final","wind_avg","wind_direction","wind_gust","wind_lull","solar_radiation","uv","brightness","lightning_strike_last_epoch","lightning_strike_last_distance","lightning_strike_count","lightning_strike_count_last_1hr","lightning_strike_count_last_3hr","feels_like","heat_index","wind_chill","dew_point","wet_bulb_temperature","delta_t","air_density"],"obs":[{"timestamp":1617387929,"air_temperature":27.3,"barometric_pressure":915.1,"station_pressure":915.1,"sea_level_pressure":1012.5,"relative_humidity":14,"precip":0.0,"precip_accum_last_1hr":0.0,"precip_accum_local_day":0.022484,"precip_accum_local_yesterday":0.0,"precip_accum_local_yesterday_final":0.0,"precip_minutes_local_day":2,"precip_minutes_local_yesterday":0,"precip_minutes_local_yesterday_final":0,"precip_analysis_type_yesterday":1,"wind_avg":0.0,"wind_direction":0,"wind_gust":0.0,"wind_lull":0.0,"solar_radiation":787,"uv":2.7,"brightness":94489,"lightning_strike_last_epoch":1617367111,"lightning_strike_last_distance":25,"lightning_strike_count":0,"lightning_strike_count_last_1hr":0,"lightning_strike_count_last_3hr":0,"feels_like":27.3,"heat_index":27.3,"wind_chill":27.3,"dew_point":-2.5,"wet_bulb_temperature":12.3,"delta_t":15.0,"air_density":1.06103,"pressure_trend":"steady"}]}


From api.weather.com:
Code: Select all
{"observations":[{"stationID":"xxxxx","obsTimeUtc":"2021-04-02T18:27:29Z","obsTimeLocal":"2021-04-02 12:27:29","neighborhood":"xxxxx","softwareType":"Weather logger V3.0.5","country":"xx","solarRadiation":305.8,"lon":99.999999,"realtimeFrequency":null,"epoch":1617388049,"lat":99.9999999,"uv":4.0,"winddir":258,"humidity":31,"qcStatus":1,"imperial":{"temp":51,"heatIndex":51,"dewpt":21,"windChill":51,"windSpeed":0,"windGust":0,"pressure":26.95,"precipRate":0.00,"precipTotal":0.00,"elev":2972}}]}

Posted on
Fri Apr 02, 2021 1:31 pm
FlyingDiver offline
User avatar
Posts: 7210
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: put my weather station data into Indigo

I think GhostXML will do that for you. Into device states, anyway, which is just as useful.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Fri Apr 02, 2021 2:18 pm
DaveL17 offline
User avatar
Posts: 6751
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: put my weather station data into Indigo

Yes, GhostXML should be able to handle that JSON payload no problem.

The trickiest bit--and it shouldn't be too tricky--is to set up any needed authentication.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Fri Apr 02, 2021 3:53 pm
Korey offline
User avatar
Posts: 813
Joined: Jun 04, 2008
Location: Henderson, NV

Re: put my weather station data into Indigo


--
Korey

Posted on
Sat Apr 03, 2021 8:35 pm
Dual offline
Posts: 257
Joined: Feb 05, 2019

Re: put my weather station data into Indigo

Thanks Joe and Dave and Korey. I implemented both GhostXML and the WeatherFlow plugin for now. Both work well. Very different approaches and devices created. Authentication was not required since my API token is built into the URL.


Sent from my iPhone using Tapatalk

Posted on
Sun Apr 04, 2021 5:38 am
DaveL17 offline
User avatar
Posts: 6751
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: put my weather station data into Indigo

Cool beans. Thanks for reporting back. Good luck, and please let me know if you have any questions.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest

cron