Automated nighttime lighting


#1

HI there, i’m a bit new to this,

Trying to figure out a system that will turn on my outside light between sunset and sunrise.

Once it has done that I would like it to look at my ring doorbell and on motion turn the light up to 70% and on press turn it up to 100% for a period of time but then return to standby at 30% until sunrise when it will reset back to waiting for sunset.

I have designed this which I’m not sure is right, i was using if instead of while but i’m not sure that will repeat and wait for the commands?


#2

I’m not a Guru but you don’t have a trigger for normal turn on/off of your light.

Does your lights turned on by themselves without motion or button press? I’d be surprised it did.

I personally would have wrote it like that (might not be most optimized solution tho)

Time happens daily at sunset
Turn on

If motion
Set level
Wait
Set level back to OG

If push
Set level
Wait
Set level back to OG

Time happens daily at sunrise
Turn off


#3

how would I do this so on motion and press it only happened at nighttime?

something like if motion and night set level?


#4

Would use condition group

If motion/press
And
Time is between sunset and sunrise


#5

Like this?

Will it continue to check after doing one loop?

Will the ‘if’ statements clash with each other?


#6

Your first block doesn’t have a lightning sign aside it, meaning it’s not a trigger but only a condition. When you select time, first bunch of options are conditions, others are triggers. You would need to select a trigger. It will then subscribe to time event.


#7

Sorry I don’t follow, how do I set the time event?


#8

New statement
If
Condition
Virtual device
Time
Happens daily at …


#9

You can get the conditions to subscribe by changing it from automatic to always.
Click on your if then the settings cog.
Now select always subscribe and save.
Also presets are available for sunset and sunrise.
When you select time, click on the word value. You will then get options. Select presets and you can pick sunset and sunrise. You can also put in offsets like 30 minutes before/after should you wish to.


#10

Right everything has a lightning, so guessing that is good?

I don’t see the option for always subscribe and the sunset and sunrise are selected from presets?

Sorry I feel like i’m being thick as this should be a very simple piston but seem to be getting confused. It would be good if there was some sort of simulator so you could adjust the time or press the button and see what happened in the GUI to test what difference changes make.


#11

Sorry for double post, wouldn’t let me post other image


#12

EDIT: I probably misled you above. I should have said the conditions/triggers within the ifs.
Every statement in yours ‘ifs’ does not have a lightning bolt.
image
Here is where the subscription and the presets are for ‘Time’.
Personally I would get rid of your ($localnow) and {$sunset and sunrise and use as per my picture.
But that’s me. Use what Adrian has already built for us.


#13

ah gotcha,

here is version 4!


#14

Fingers crossed it works. :wink:
Didn’t you fancy using the presets?

image


#15

Presets added :slight_smile:


#16

What is this about schedules? do I need to worry about that?

Think I need to take a college course in this!


#17

If you mean the penultimate line, this is just setting up a scheduled job to run for the next sunset. If you didn’t have anything else in the ‘IF’ then the piston would run.
At that time the piston will run again and the ‘Time’ conditions will now evaluate as true. If there is no motion etc. they will still be false though. Just the way things work I suppose and definitely nothing to worry about.


#18

Thanks, will this mess up the motion and push ifs if it sets the piston to run again at sunrise and doesn’t run it during the night?


#19

No. Everything will be fine.
The scheduled task will just run and evaluate the piston.


#20

Ah brilliant!

Fingers crossed!