Simple lighting

this is a really silly one, I have porch lights that I would like to turn on at sunset and to turn off at 8pm the trouble is sunset isn't until 8.58pm at the moment so with my old automation its triggering without realising is beyond is time to switch and then doest turn off as its already gone before its time. this is what I have come up with at the moment

Flick a virtual switch at 8pm and use that as a restriction in the rule. E.g. turn the virtual switch off at 8pm, but place a restriction on the rule that the switch must be on. Make sure you turn the switch back on overnight.

1 Like

it sounds like a really simple automation but this one has me lost

will this do just without the virtual switch, I think its close

I am going to ask a silly question, but why off at 8 PM? That seems like at best, it would be on for an extremely short length of time most of the year. And at worst the logic is messy and won't work, like it is now.

Edit to say: I think you need more thought into what this rule should really be doing.

1 Like

Create a new device, select Virtual, choose the virtual switch type (driver)
Setup a new rule to turn the switch on at let's say 11pm
Replace the required expression for your existing rule, staring the virtual switch needs to be on
Setup another rule to turn the virtual switch off at 8pm

The wait for event won't happen if triggered after 8pm

1 Like

I like to turn the light off on the porch at 8pm just to let people know they our not welcome to knock on my door un invited after this time. England can have long dark winters and it will be on for a greater time during this period. With this Automation it will only work when its dark maybe 6 months of the year also saving a few pennies hopefully

is there no way to do it without a virtual switch as I like the random colours

Not sure what you mean? The virtual switch is just used to control whether the rule runs or not?

1 Like

ok sorry I am still learning, I am a bit of a slow learner. I will try and put something together now and see what you think

I get this, I am in Michigan, which is south of you latitude-wise, and our winters are long and dark.

Ok, so I think this is your clue to work from. If you only want this to work in the darker months, and not in later spring, summer, or early fall, then restrict this to only be active in the winter months. Then the rest of your logic, from sunset to 8 PM would work correctly. The triggers would be sunset and 8 PM.

1 Like

No worries, we've all been through this phase, so more than happy to help out

1 Like

Just for fun, I looked around and found this sunset calendar. I just picked London for an easy reference here, but you can change that.

https://sunrise-sunset.org/calendar?location=London%2C+Greater+London%2C+England%2C+United+Kingdom&month=April&year=2022

I would rather have something that was a Little better as some days our darker then others, It doesn't seem too complicated to what something to know the time and to only turn on if its dark at a curtain time. the things this hub can do, this seems like a really simple one

this is taking all the smart out of smart hub lol

That is a different requirement than you outlined originally. This isn't intended to sound mean, but like I said above, I think you need to put more thought into this automation.

But with that new requirement, you would need a Lux sensor to determine light levels, and trigger from that.

1 Like

I will keep it simple and lose the random colours, its a simple automation with HomeKit , I would of like all my automations or most of them to be on here but this one loses me

all I want is set times sunset when its dark to turn on but not after 8pm is it really that hard

Actually, could we not do away with the restriction and just wrap the action in a conditional (IF) that check the time?

1 Like

Download the Hubitat app