OH3 dynamic timing events


how to run the code below in openhab 3?

I would like to be able to manually change the event time in my interface.

rule "Vaillant Timer"
		Time cron "0 0/1 * * * ?" //Seconds, Minutes, Hours, Day-of-Month, Month, Day-of-Week, Year (optional field)
		if(Urlaub.state == OFF){
			var sollMinuteTag = (Vaillant_Tag_M.state as DecimalType).intValue
			var sollStundeTag = (Vaillant_Tag_H.state as DecimalType).intValue
			var sollMinuteNacht = (Vaillant_Nacht_M.state as DecimalType).intValue
			var sollStundeNacht = (Vaillant_Nacht_H.state as DecimalType).intValue

			if (sollMinuteTag == now.getMinute && sollStundeTag == now.getHour) {
				if(Vaillant_Urlaub.state == OFF){
			if (sollMinuteNacht == now.getMinute && sollStundeNacht == now.getHour) {
				if(Vaillant_Urlaub.state == OFF){

Thank you

Search “Alarm clock” examples. It’s better to set up a timer when your Item changes, or at midnight, than to run a rule unnecessarily 1439 times a day.

Look in the Marketplace (Settings → Automation). There is an Alarm Clock Rule template you can install and instantiate rules from. You only need the one DateTime Item. There are also widgets published to the Marketplace to manually set a DateTime Item (Settings → User Interfaces). To move the DateTime Item to the next day there is also a To Today rule template.

See Creating Capabilities with Rule Templates: Time of Day for a full tutorial.