I have connected my Washingmachine to a plug that measures Wh. You can use any, i have one homematic and a tasmota. The tasmota has a bigger variance, i might replace it at some point. You need to monitor the consumption for the states and set the parameters in a rule. You also need to check how much timer you need in case the machine stops and starts the program again depending on the program. i am using 5 min. I am currently using the below rule, although i disabled the mode standby as this was not reliable and not needed as well. There is a pretty large thread here in the forum as well. Just look for washing machineā¦
val MODE_OFF = 0
val MODE_STANDBY = 1
val MODE_ACTIVE = 2
val MODE_FINISHED = 3
var Timer tWashing_Machine = null
rule "Washingmachine Consumption State Machine"
when
Item Washingmachine_Power changed
then
if(!(Washingmachine_Power.state instanceof Number)) {
logWarn("washing","Can't get valid power! {}",Washingmachine_Power.state)
return;
}
val nPower = (Washingmachine_Power.state as Number).floatValue
// logInfo("washing", "Washing Machine rule initiated.")
if (nPower < 0.21 && Washingmachine_OpState2.state != MODE_OFF) {
Washingmachine_OpState2.postUpdate(MODE_OFF)
logInfo("washing", "Washing Machine OFF.")
} else if(nPower > 15 && Washingmachine_OpState2.state != MODE_ACTIVE) {
Washingmachine_OpState2.postUpdate(MODE_ACTIVE)
logInfo("washing", "Washing Machine ACTIVE.")
if(tWashing_Machine !== null) {
tWashing_Machine.cancel
logInfo("washing", "Timer cancelled.")
} else {
logInfo("washing", "Timer not cancelled due to it being null.")
}
} else if (nPower < 3.5) {
// if(Washingmachine_OpState2.state == MODE_OFF) {
//
// Washingmachine_OpState2.postUpdate(MODE_STANDBY)
// logInfo("washing", "Washing Machine STANDBY")
//
// } else
if (Washingmachine_OpState2.state == MODE_ACTIVE) {
if(tWashing_Machine === null) {
logInfo("washing", "Timer created.")
tWashing_Machine = createTimer(now.plusMinutes(5), [ |
Washingmachine_OpState2.postUpdate(MODE_FINISHED)
logInfo("washing", "Timer expired. Washing Machine FINISHED.")
tWashing_Machine = null
])
}
}
}
end
Hi,
first off all awsome work on the widget and thank you for sharing. Implimenetation worked great just one part I am strunggling with:
State: Can be one of OFF, RUNNING or FINISHED and should be filled in via an expression as well depending on the current state of your machine
Canāt get the expression to work. I use an item to represent the status auf the washing machine (Washer_OpState_CE_Utilityroom). The state is given by a numeric value (0-3) that translate to/ repersent the staes: Off, Standby, Active and Finished.
Now my question, what expression to use to get the widget state to OFF, RUNNING, FINISHED? Maybe someone can point me in the right direction.
i believe you are almost there. I also work with a numbers item that represents the state of my washing machine as you can also see in the rule i posted, so i changed the YAML file from @DrRSatzteil to replace the values OFF, RUNNING etc. with my numbers like this:
Yes I think your solution is simple and would work just like my more complicated rule. Thanks for sharing!
When you set the runtime to 0 is more a matter of taste in my opinion. I set it to 0 when the machine is starting so I am able to see how long the last washing was running after the washing is finished. However I agree that this information is pretty useless so it does not really matter
I use it with the Siemens/Bosch HomeConnect Binding.
I did some small modifications today to implement some parameters provided by the HomeConnect Binding for Washer and Dryer.
I replaced the ādummyā buttons with the āRemainingTimeā used from the binding.
The following parameters are added to your wonderful widget as well.
Progress (used in a progress)
SpinSpeed
Temperatur
ProgramMode
When the Widget is set in āDryerā mode, then the colors are changing from blue to red.
I also canāt get the expression to work. I am very new to openHab and donāt have an idea how to implement the expression for OFF, RUNNING, etc.
I have the rule implemented that you posted above. This is working fine. I have an Item āWaschmaschine_Statusā which gets values from 0-3.
I have also changed the YAML file as you described it.
But when I write Waschmaschine_Status in the state props field nothing happens.
Can you please give me a hint what I am doing wrong?
Thank you!
sorry guys, but I donĀ“t get where I have to let the widget know what device/item IĀ“m talking about. I can configure the states but still the widget wonĀ“t know which item it should watch.
I made an update to the first post: The look and feel of the washing machine will now be the same on android and iOS devices. Thanks goes to @Nico_R who created this custom component for the dishwasher status widget.
I get the following error on the UI when trying to install this widget and the Dishwasher Status :
Installation of add-on 116621 failed
On the Karaf console I get the following:
12/26/2022 20:45:52.656 [ERROR] [mmunity.CommunityUIWidgetAddonHandler] - Widget from marketplace is invalid: Couldn't find the widget in the add-on entry
I installed other widgets from Rich Koshak and Thomas Lauterbach without problems.
Iām running OpenHAB 3.2 (stable) on a Raspberry Pi 4B with CentOS 8 (64bits).
Maybe my post is in the wrong format!? The post is older than the community marketplace so this might be the case. I donāt find a lot of time during the holidays but I will check asap whether this could be the problem.
Could you please try again to install the widget from the marketplace? I just updated the first post so that it matches the required structure. Thank you!