is there any chance to abort a running timer?
Let me explain. I created some kind of a timer switch for the poweroutlet of my 3D printer. Idea behind this is that I sometimes start prints over night or while I’m at work. As I know how long the print will take I can define the time how long the printer should be powerd. Because if the print takes 3 hours and I’m in the office for 10 hours there is no need for having the printer powerd all the time.
In my sitemap I have a slider to select the time I want the poweroutlet to be on. When I start the timer (with a button in my sitemap) the poweroutlet switches to on (so printer is powerd) and a timer starts with the number of hours I defined in the sitemap. After timer ends poweroutlet switches to off. Pretty easy thing.
Here is the rule:
rule "Zeitschaltuhr 3D Drucker" when Item KGD_Draussen_Zeitschaltuhr_3D_Drucker changed to ON then Drei_D_Drucker.sendCommand(ON) KGD_Draussen_Zeitschaltuhr_3D_Drucker.sendCommand(OFF) createTimer(now.plusHours((Zeitspeicher_3D_Drucker.state as DecimalType).intValue))[| Drei_D_Drucker.sendCommand(OFF) ] end
Drei_D_Drucker = Poweroutlet of the 3D Printer
Zeitspeicher_3D_Drucker = Number item which has a slider in sitemap
KGD_Draussen_Zeitschaltuhr_3D_Drucker = Switch in the sitemap to start the timer
So far so good.
But sometimes it happens that a print breaks in the print process. So normaly before I leave or I go to bed I check the print. If a see a problem I abort the print, fix it and restart it or just restart it. But as the timer is already running in the background the printer will turn off after the selected time.
So is there any chance to abort this timer?