I use a switchable plug to turn on and of my Hot Water Boiler in the kitchen within a specified schedule. It works fine. Now I want to include a Smart-Button close to the tap which when pressed will turn on the boiler, if it is not on already and turn it off after 30minutes but leave it on if the specified time frame is still active. Everything is already created in this rule below except of the possibility not to shut off the boiler after 30min when manually activated if the specified schedule still says it should be on.
How can I acchieve this?
var Timer timerBoilerabschalten = null
rule "Boiler an mit Button 30min off"
when
Item ButtonWasserboiler_Kueche changed
then
if (Wasserboiler_Kueche.state==OFF && timerBoilerabschalten===null) {
sendCommand(Wasserboiler_Kueche, ON)
timerBoilerabschalten = createTimer(now.plusMinutes (30), [ |
{
Wasserboiler_Kueche.sendCommand(OFF)
}
timerBoilerabschalten = null
])}
end
rule "Boiler Wochenplan an"
when
//Schedule
Time cron "0 0 8,12,15,19 ? * MON,TUE,WED,THU,FRI *" or
Time cron "0 0 9,12,15,19 ? * SUN,SAT *"
then
sendCommand(Wasserboiler_Kueche, ON)// update item to switch on
end
rule "Boiler Wochenplan aus"
when
//Schedule
Time cron "0 0 10,14,17,21 ? * MON,TUE,WED,THU,FRI *" or
Time cron "0 0 11,14,17,22 ? * SUN,SAT *"
then
sendCommand(Wasserboiler_Kueche, OFF)// update item to switch on
end
MDAR
(Stuart Hanlon, UK importer of Velbus hardware)
2
So what you’re asking is that you need something to store the state in, while the override is in place?
This example might help you.
(It’s over simplified, but I hope it gives you something to ponder)
Thanks. I will give it a try. I am also still open for other solutions.
MDAR
(Stuart Hanlon, UK importer of Velbus hardware)
4
My thoughts are that you only need to extend your current rules a tiny bit, by adding in a Virtual Item / Global variable to store the state of the timer.
Which can be referenced at the end of the Manual override timer.
(I’m really trying not to just write the rule for you…)
A thought; storing “desired condition” is all very well, unless the “desired” changes while you’re running the manual timer. Example, the day/night change occurs part way through the timer.
Suggested solution, the rule(s) that usually set the real operating condition also set a copy, the “desired condition”. Even if the manual timer is running. At end of timer, resume whatever “desired” now is.
That is assuming that the usual rules also look to see if the manual timer is running before changing the real condition.
Thanks a lot @MDAR for making / sharing / linking to these videos!
I been searching around for parts of 2 days trying to figure out how to control a light on a timer, but also have a regular (not on a timer) switch on the same light simultaneously. I didn’t even know what to call that, so I been hunting around all these posts, and I was about to make a new post of my own but now I don’t have to.