Rule Machine Lights On Sunset

Hello everyone, just got my HE hub set up and I'm loving it. So far I've been able some rules that I haven't been able to implement with my Wink / Stringify set up.

So I have a basic rule right now that turns on lights 60 minutes prior to sunset. I have a time trigger event with sunset and -60 for the offset. it works as expected but I want to do a little bit more and I don't know where to start.

What I'd like to happen is that the offset is determine programatically. for example, start with -60 minutes and then subtract if the sky is overcast and during shortened daylight months. I was trying to get around a complicated if else if else if else actions.

any thoughts on a way to tackle this one?

I started with the APIXU driver. Have a look here: Apixu.com worldwide weather data with outside lux. No PWS or server setup

That will give you a lot of values to play around with. Not always 100% accurate, but a good start.
You can always install your own weather station later...

You can then fine tune your rules to turn on the lamp if sunset -60 and cloudy, or illuminance < number, etc.

APIXU as suggested, or OpenWeatherMap driver is natively supported. Just install the device. For the most accurate, you can add data from your own weather station. Weewx is supported via @Cobr’s driver, or Ambient Weather branded stations are supported via a different community driver that uses their API, so Weewx is not required. You can also pull data from Weather Underground for free, as long as your also uploading data. There are a few WU drivers for HE available.

The other approach would be using luminance values from a sensor. I have been thinking about doing this as I have a Sensative Strips sensor on my front porch. I put it there to use as a temperature sensor but it also reports luminance. I was thinking of a rule something like "on at sunset or when luminance is less than 80".

I wanted to have a similar setup, but I wanted the lights to come on if it was overcast regardless of the time of day. I also wanted these lights to be the same when the Sunday set. The first rule sets a variable when the light is above or below a certain level. This allowed me to set a gap so the lights didn't bounce when I was right along the threshold.

06%20PM

The second one turns on the lights if either the variable is on or if the mode is evening.
19%20PM

I started down a similar path, first sunset -120 and then APIXU...but now, I have something like @homeauto2112, but I use A Hue outdoor motion sensor, with its Lux Threshold sent to 10 lux, which (so far) has seemingly eliminated bouncing.

Other then automating my stairwell lights this is my favorite automation method.

This is a rule 3.0 rule, I may have a 4.0 rule as well.

S.

thanks for the reply @pietsnot, using that makes sense. however i am still confused how to implement with rules engine. do i create a variable and use that in my sunset offset?

based on the reply from @homeauto2112 below, i'm thinking that is the case. i didn't think it would be possible to set a variable in 1 rule and use it in another. pretty neat!

Thanks for the reply. After reading some of the responses I wonder if a light sensor would give me a more reliable automation. it was fine through Stringify, although I needed to readjust throughout the year (after winter, the lights would come on too 'late').

any particular reason why you went with an outside vs an inside? I hadn't realized the Hue sensors worked with HE.

Yeah, I had the same problem you mentioned, in that time of day and sunset sunrise don't really capture conditions in various seasons and weather.

I put the hue outside, and then set a lux in my rules that takes into account how dark it is in my house when the Lux is that level outside.

By using that lux value, on a dark cloudy day, the lights come on, regardless of time of day (notwithstanding my restrictions).

I have noticed that I need another one or two sensors to probably get a good average lux, as at certain times of day the sensor can be shadowed, skewing the measurement. But this truly hasn't been a problem, rather just an area for improvement.

Yeah, the Hue Outdoor motion sensor is Zigbee and pairs directly with Hubitat. A bit pricey, but an excellent sensor.

I started down this path, but ran into issues with my sensors updating correctly. Seems that some sensors are more talkative than others. I created a rule to poll the sensors if motion is active.

The Hue seems bulletproof so far. It seems to obey my 10 lux threshold, and reports the changes. If anything, it probably errs on the side of overreporting rather than underreporting.

It's been outside since May 14th, and operating in mostly 85+ (F) (~30C) weather, including ~8 hours of direct sunlight with nary a glitch and 100% reported battery remaining.

1 Like

I went with the outside as it's more accurate. With the inside one, the shades could be drawn or a light could be left on. This would skew the results. I have two sensors. One is outside for the west side of the house. That's where the kitchen and family and den rooms are. I have another for the east side which is where all the bedrooms are. When it comes to overcast conditions, the lights is pretty even outside and the house is lit appropriately. When it comes to sunset, the east side of the house lights up first since there is less light.

Only one of my sensors is outside (West). The other one is mounted in the top corner of a bedroom window on the outside of the shades.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.