Motion light time based day & night


#1

Very new here.
Trying to create a Piston that will turn on lights with motion. During time frame 1 set to 100% and time frame 2 set to 20%. Can I do this in 1 Piston?

Between the hours of 6AM to 11PM turn on lights to 100%
Between the hours of 11:01PM to 5:59AM turn on lights to 20%

I am using a standard motion piston with active turn lights on, inactive wait and turn lights off.
I need help modifying to if between this do A and between this do B.


#2

This is my first stab at time conditions as described.


#3

You were on the right track… I modified it a bit to give you better results:

The main changes are line 33 above no longer spans midnight.
and
I removed the 1 minute gaps you had, so it should work 24 hours a day now…
and
line 44 has been changed to prevent your guests from sitting in the dark, LOL

You can import this piston using the code: krhga


#4

Thank you.
Digesting it now.


#5

Love your approach.
Making all my Pistons better…


#6

Let me be the first to welcome you to our community…


#7

Something is a little whack here.
Motion kicks the lights to day setting and the quickly within a second to the night setting.


#8

You may notice that once a day… (the first run after 7:30pm)

The reason is because most bulbs remember their previous setting…
When the bulbs first come on, they come on at their last brightness level…


#9

Not all bulbs can do this, but with Philips Hue bulbs, you can delete both Turn ON commands…
Those bulbs (and maybe others) will actually turn on when it sees a “Set level to X%” command.

This also makes the “flashing” barely noticeable…


#10

This works OK for me.


#11

I would make one small change. Instead of doing the on function and the set level function you can go directly to the set level function. This might avoid some of the issues you’re seeing with the bulbs coming on at their old settings. Since you are issuing the On command, that’s the setting they’ll use. This should be less pronounced if you just issue the set level.