Switch timer

trying to turn on and off my room light using Time. I’m using raspberry pi3 running openhab2 connected to 16 channels relay.
I looked online but to many scripts i don’t understand and i don’t know how to make it work …
i need a simple script to turn on my light lets say at 6am and turn off at 7pm. my items configuration is like this : Switch RoomLIGHT{ gpio=“pin:16” }

please, how to ??

Are you able to switch ON and OFF this ligth from a GUI?
If not, I suggest you start with this functionality.

If yes, look into rules with a Caron trigger.

Yes i can get it to switch on and off but not sure how to add time the script that i have

It would be helpful if you also showed your script to us! Then maybe we could tell you what you need to change :wink:

If you would look through the docs, you can find examples which you can adjust to your needs.

rule "Switch on in the morning"
    Time cron "0 0 6 * * ?"

I hope you can go on from here alone.

I dont have timeing script i only have switch script in my items

i don’t have timing script, the only script I have is the switch in my items which I post earlier

Okay … that is no Script or Rule … that is an ITEM File :wink:

Thank u, i will try it and see and post back the news

it worked, I had to read little bit about CRON and how to use and I set the time and now its working :sunglasses::smiley: