Rule Machine - Add "Time" as a Variable Type for GV's

Add "Time" (e.g. HH:MM) as a Variable Type

Use case: I would use this in my Lighting automations and within rule restrictions (I don't use sunset or sunrise as these rely on cloud). This would be super useful particularly in the UK where we observe daylight saving times each year. If such a feature existed I could change one GV value instead of editing many rules twice a year.


FYI @bravenel

No, these don't rely on cloud. There is a built-in astronomical clock. If you don't have an internet connection then your hub clock will drift and need to be manually set. But, if you do have an internet connection it stays with the correct time. In any event, sunrise and sunset times are calculated based upon your location.

Ha! In the US we also observe daylight saving time each year, so you're not alone in that. Except in a few places, including Arizona where I am, we do not change our clocks at all. Having lived with both, I greatly prefer no daylight savings time change.

Adding a time GV would be quite messy and I'm not inclined to want to do this at this time, especially since your need for it is not a true need, but based on a misunderstanding.

Thanks for the quick follow-up @bravenel.

Well I never knew that! This greatly changes my approach to timings in my rules.

I'm jealous! If I were in charge of such things I would make the UK stop observing this.

Agreed - Thank you for the education, I'm going through all my Simple Lighting and RM rules swapping the fixed times for Sunset and Sunrise!

All the best,

Just an update on this: Unfortunately using the hubs Sunset and Sunrise in this scenario hasn't been working out but I wanted to share my simple workaround.

Usually due to cloud cover (that's clouds in the sky... not data centers!) it's sometimes dark enough in the house to warrant motion lighting activating, but due to the "official" Sunset time it can be another 1-3 hours before things kick in. (Note: I have attempted to use offsets and I do not utilise any illuminance sensors).

Quite simply, my workaround to achieve setting custom Sunset and Sunrise times was to use Rule Machine to schedule Evening mode between two manually set times, then go through each Simple Lighting rule and apply the Mode restriction to it.

You could use a lux sensor.
Either a device like the Fibaro for example or use your local weather station.
Do a search for Apiwx.

Care to explain why?

Or weatherflow PWS + node.js. :slight_smile:

I have something similar in a Rule I name: Gloomy Day. It sets a virtual switch. Then that gets used in Rules too in rooms that could benefit.

Hi @bravenel I should of stated it's not working out in this particular scenario usually due to the local weather - There is nothing wrong with Sunset and Sunrise times coming through :slight_smile:

Cheers @bobbles and @JasonJoel, I will check those options out but I wanted to keep these functions of the house as Local as possible.

I might just rename Evening mode to Gloomy @csteele! :smile:

1 Like

Sounds to me that an illuminance sensor is the way to go.


Any recommendations? My poor wallet...

FYI I have tried the Philip's Hue Motion Sensor and found it slightly slower for motion than the SmartThings 2015 one.

I have 14 Motion Sensors that include LUX and I use those to average upstairs vs downstairs. One is even outside facing my front door. Then I toss in APIXu's lux for good measure...

Dome and Aeon are my two motion sensor devices that include Lux.

Apixu is free but is cloud based.
Why not give it a try.
Nothing to lose.

1 Like

Am I right in thinking this feature request is now live in the latest release?