Weather/Temp from online source

How about solorradiation which could be used as a simulated LUX sensor.

Can you point me to the right direction on how you can tie solorradiation from WeatherUnderground to a simulated Lux sensor?

Thanks for pointing out the solarradiation value! I didn't know that was available on Weather Underground. So with the built in driver the weatherCache state variable isn't accessible outside the driver making it not a possibility to parse out solarradiation. I made a quick driver to access the API and pull this data until it's available in the built in driver. I plan on using this to help turn on lights before sunset and set dimmer levels possibly. I'll post a link to github with the driver once I get it cleaned up and add in some additional state data if anyone is interested.

2 Likes

I do this in WebCoRE now for ST. If you live in a populated area then you can use solar radiation as the lux value. Very reliable.

1 Like

I can help you test. Really want to get this working for my replacement of ST. I am SO close. Just need BigTalker2 and I can be off of ST.

Here’s the current version. There’s a few settings for polling:
Automatically Poll: Enable this to automatically poll every x minutes.
Poll Interval: Prevents polling run more than once during this interval. Clicking Force Poll will force an update. Automatically poll by this interval, if enabled.

Right now illuminance is directly mapped to solarradiation. I’m not sure how it worked on webCoRE. Is there a formula to convert W/M2 to lux?

1 Like

I hope to have this ported soon. I was able to move the code over, but there seems to be a variable passing/communication issue between child/parent apps which may require Hubitat support team/firmware involvement.

I updated the WeatherUndergroundCustom driver to include some additional current observation attributes and basic forecast information (high, low, conditions). This is done in the same API call so it won’t affect API call limits. Also fixed the auto poll interval to use the built in intervals. Poll interval limit is to protect API call limits in case anything else is calling poll().

Here are the updated attributes:
  • UV : 1.0
  • dewpoint_f : 21
  • feelsLike : 48
  • forecastConditions : Partly Cloudy
  • forecastHigh : 48
  • forecastLow : 20
  • humidity : 38%
  • illuminance : 409
  • observation_time : Last Updated on March 22, 4:12 PM CDT
  • precip_1hr_in : 0.00
  • precip_today_in : 0.00
  • pressure_in : 30
  • solarradiation : 209
  • temperature : 48.2
  • visibility_mi : 10.0
  • weather : Clear
  • wind_mph : 0.0
  • wind_string : Calm

Updated Github with the changes

2 Likes

So referring back to an earlier post, does an app have to be created to access his info? For example, what if I would like to flip a switch if the high for the day was above 85 degrees?

You could use the built in stuff like rule machine or simple lighting to do that

Can you give me a quick example. Since there isn’t a “capability” for weather forecast, I’m lost as to how to create a rule to pull the forecast info in.

Sorry misread your post. I thought you were asking to do something of the temp hit 85 not the forecast high. In that case you’d need a custom app,

The other option might be to create another device with capability temperature that only tracks the forecast high and sends it as temperature

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.

Download the Hubitat app