Because everything is normalized in OH to a small set of Items and events, I would think it works be easier to pretty to another plug as OH rules don’t care if it’s a Sonoff, Zigbee, MQTT, Shelly, etc. It see a switch and know a switch can receive ON or OFF command.
Typically in an OH configuration, The natural place to put something like this is OH because OH is in the middle. If you hard code the times on the Sonoff, if you ever want to change those times you have to change it on the Sonoff. Of you use DateTime items in OH and Rule, you can set the start time using anything in OH: Astro, iCalendar, time pickers in Sitemaps or MainUI, etc.
You have a lot more flexibility.
The rule is simple as well. Assuming a managed rule with JS Scripting, add a script condition:
time.toZDT().isBetweenTimes(items.StartTime, items.EndTimes);
Or if you don’t use Items you can use a Time condition to define the start and end time. Or as a script condition:
time.toZDT().isBetweenTimes("6:00 pm", "9:00 am');
You can even mix and match, for example stop at sunset and start at 9 am and stuff like that.
The rule triggers on changes to the MQTT Item and the action forwards the change as a command to the Sonoff. The condition will prevent the action from executing of us outside of the allowed times.
As for how to do it on the Sonoff itself, if you don’t get a good answer here you may need to go to their support for help. We probably have a few users of this device but may not have someone with that shirt if expertise.