Weather/Temp from online source

I’d like to move from a custom app to Rule Machine to control my irrigation system. Can WU give me historical precipitation for yesterday and the day before? And forecast for today and tomorrow?

@mattw
Do you have a version for centigrade?
How easy is it to convert?

Andy

@mattw
No problems… sorted it :slight_smile:

Andy

1 Like

Currently Rule Machine does not support custom attributes, only custom commands. This is the same issue as @homeauto2112 using the forecast attribute. Right now the options are: custom app, webCoRE, multiple WU devices changing the temperature mapping, or writing a service manager that creates multiple devices for each attribute. Both those options will clutter up the device list. Custom app right now seems like the best option.

3 day forecast is included with the free API. Yesterday's weather is only included in their top paid API plan. You can check out the features included in each plan here.

Yeah sorry, I hard coded everything for those fahrenheit freedom units. :smile: The precipitation, visibility, pressure, etc can be changed to metric too.

2 Likes

Actually… like most ‘old’ folk in the UK
I use Celsius for temp but ‘imperial’ for speed etc. :slight_smile:

so easy to convert just those few settings

Andy

1 Like

One option for the data (though as @mattw mentioned you’ll still need an app) is Darksky. They offer precip info and include historical as well in their API

https://darksky.net/dev/docs

They offer 1,000 calls per day for free

I hacked it a bit and hijacked the humidity and illuminance attributes in @mattw device code. I set the humidity to the forecast high and the illuminance to the forecast low. This allowed me to create a couple of virtual switches and turn them on/off at 6:00 AM to drive my other rules.

I hacked it a bit more.. :slight_smile:

As I'm in the UK, we tend to use Celsius rather than Fahrenheit
So... I made it switchable between the two
It's here in case anyone else finds it useful..

https://github.com/CobraVmax/Hubitat/tree/master/Drivers/Weather

This is really useful - Thanks @mattw for creating this.

Andy

1 Like

Guys
I’m thinking of writing a little custom app for this driver.
I would like the ability to use the data properly
E.g. If the wind is too high I want to turn on/off a switch which controls my conservatory skylight windows.
Or as @homeauto2112 turn on/off a switch at forecast high/low thresholds

Would anyone else find this useful?

Andy

I would. I have to keep some notes around regarding the hijacking I did and a little app would help with that!

What have people put in for zip code in the UK.
I’ve got an API key put it in to the device but don’t get anything.

Lat & long separated by a comma
Like this...

26-03-2018%2016-33-45

You can find that by using google maps :slight_smile:

Andy

Brilliant thanks.

Bump.
OK. I have this installed and I’m getting data.
What I would like to do is extract the ‘solarradiation’ value into a variable in webCoRE.
Does anyone know how I can extract the data?
Thanks.

I’m not getting solar radiation or illuminace. Is this area specific?

The built-in Hubitat Weather Device does not currently expose any of the WU data as ‘Illuminance’. Others must be using custom code.

Yes. I was using the custom WU device posted above. I’d really love to get illumice. I had a few automations that used that vs sunset

1 Like

So is there a way to set a weather station? I found one that has SolarRadiation.

You set your weather station in the settings after you create the device.