Hey all,
I created a rule to alarm me as soon as my washing machines program has finished. Its based on the energy usage of the machine. But my machine is a bit difficult to “read”. My rule basically works but its alarming me sometime even when the machine is not finished yet. And my rule alarms me several times and not only once. But I already added something to get ride of that issue but didnt checked if its working yet. And I guess my code is not really “comfortable”.
Let me show you the watts of the machine in a standard program. Looks little different in other washing programs but quite similar. Watts go up to 2.000 in the beginning (heating I guess). Than it jumps in the lower watt area and nearly before done it goes up about 500 ones when it starts a final fast spin to dry the clothes. Unfortunately in the time between heating and the final spin sometimes it goes down to a very low energy usage too. So I already added the final spin into my rule. Only if this has happend the rule may even start. Its called “ZSpeicher_Waschmaschine_Schleudert”.
If the rule have all triggers positive it starts a 5 minute timer to check if the energy usage is still low. But even if the machine is ready sometime the energy usage goes up a bit. If the 5 minutes are over in exactly that moment rule won’t run.
I guess the best thing would be to check the average energy usage in the last 5 minutes instead of that exact moment but I have no idea how to do that.
Energy usage of the whole washing program
Final hour of the washing program with
My current rule:
rule "Waschmaschine fertig"
when
Item Waschmaschine_Verbrauch changed
then
if ((Waschmaschine_Verbrauch.state) < (20.0) && (ZSpeicher_Waschmaschine_Laeuft.state == ON) && (ZSpeicher_Waschmaschine_Schleudert.state == ON) && (rulerunning_waschmaschine != "1")){
sendCommand(rulerunning_waschmaschine, "1")
createTimer(now.plusMinutes(5)) [|
if ((Waschmaschine_Verbrauch.state) < (20.0)) {
val telegramAction = getActions("telegram","telegram:telegramBot:Telegram_Bot")
telegramAction.sendTelegram(273100007L, "Die Waschmaschine ist fertig.")
Echo_Buero_TTS.sendCommand('Die Waschmaschine ist fertig.')
Echo_Kueche_TTS.sendCommand('Die Waschmaschine ist fertig.')
Echo_Flur_TTS.sendCommand('Die Waschmaschine ist fertig.')
Echo_Fitness_TTS.sendCommand('Die Waschmaschine ist fertig.')
sendCommand(ZSpeicher_Waschmaschine_Laeuft, OFF)
sendCommand(ZSpeicher_Waschmaschine_Schleudert, OFF)
sendCommand(rulerunning_waschmaschine, "0")
if ((Tagesart.state == "Wochentag" || Tagesart.state == "Homeoffice") && (((now.getHour() * 60 + now.getMinute()) <= 1260) && ((now.getHour() * 60 + now.getMinute()) >= 420))){
Echo_Schlafzimmer_TTS.sendCommand('Die Waschmaschine ist fertig.')
}
if ((Tagesart.state == "Wochenende" || Tagesart.state == "Urlaub") && (((now.getHour() * 60 + now.getMinute()) <= 1320) && ((now.getHour() * 60 + now.getMinute()) >= 660))){
Echo_Schlafzimmer_TTS.sendCommand('Die Waschmaschine ist fertig.')
} }
]
}
end
Any suggestions?