There's a couple of routes you could use here. There is a built-in Weather Underground driver available (create a virtual device of the type WeatherUnderground. You'll need an API key for it though.).
You could also use the APIXU driver for weather: Apixu.com worldwide weather data with outside lux. No PWS or server setup
However, you'll also need WATO ([RELEASE] WATO - When any Attribute Then this cmd Otherwise that cmd) for the trigger from Rule Machine (if you want to go that route). From code, I believe you could just query the attributes directly.