Please help me write an order for timing the lights on

I want to turn on the lights automatically at 6 pm and turn off at 12 am.
Please help me write an instruction.

Please show us what you already tried. We are not writing the rules for you.
You can find many examples for such rules using the search function.

search for “Time cron”.

And does the light turn to on in case you click on the play button on top ?
Does it turn on waiting for 18:00 or does it turn on at an other time ( offset between the system time and your local time ) ?

So for me it is not clear what the question is:
a) the light does not turn on
b) the light turns on at a wrong time
c) you do not know how to turn the light off ( which would be a second rule )
d) …

1 Like

when i click the play button on top the light turn on now. it doesn’t open on time 18:00.
the light turns on at a wrong time.
I want to turn off the lights on time.

In this case your systemtime does not match your localtime, the light will most probably be switched on at 18:00 systemtime.
How the systemtime is changed depends on the OS of your system.

check the content of openhab.log/events.log file.
Is there a difference between the logentries timestamp and your localtime ?
Is the time displayed in your system matching the time in your timezone ?
Did you set the correct timezone in the UI ?

I don’t know how to set the time.

Then you should check the instructions for your OS how to set the correct Time/TimeZone.
This is not openHAB related.

set timezone in raspberry pi right?

If you are using a raspberry pi, yes.

I finished setting the time zone. Can I use the rules pictured above?
Am I writing right?

Use the rule you have and change the time to a few minutes before your current time is now.
Example: If the time now is 15:05 then change your rule time to 15:07 and see if it runs at 15:07. If it does then it should also run if you change it to 18:00 (the time you want)

2 Likes

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