Script your Dryer or Washing Machine in Domoticz

Intro

You can buy smart washing machines and dryers, but for a small amount and a little script, you can make your current machines smarter in Domoticz. Get a notification when the machine is ready with this Washing machine script. That’s nice if the machines are not within hearing range. This script can also be used for similar electrical appliances (dryers or even a toaster) because the logic is the same: If power consumption gets low after a high period then the machine is finished, simple!

Installation

Get yourself a power plug that can measure power consumption, like this one:

GC00AM NAS – WR01ZE Z-Wave Smart Socket – EU PLUG WHITE

The only reason we use this plug is that is cheap and has a power consumption meter. That info is needed for the script. we don’t use the on/off function.

create user-variables in Domoticz

washingmachine_status integer

washingmachine_counter integer

Lua script

Copy this script and adjust the names of the devices.
Wasmachine_Usage Name of Z-Wave plug that contains actual consumption of washing machine (in Watts).
I thank Thinkpad for his script!

Click on Setup > More options > Events
click New and choose LUA, type in a name for your script.

-- Variablelocal washer_status_uservar ='washingmachine_status'local energy_consumption ='Wasmachine_Usage'--Name of Z-Wave plug that contains actual consumption of washingmachine (in Watts)local washer_counter_uservar ='washingmachine_counter'--Name of the uservariable that will contain the counter that is neededlocal idle_minutes =5--The amount of minutes the consumption has to stay below the 'consumption_lower' valuelocal consumption_upper =20--If usage is higher than this value (Watts), the washingmachine has startedlocal consumption_lower =4.3--If usage is lower than this value (Watts), the washingmachine is idle for a moment/done washing-- sWatt, sTotalkWh = otherdevices_svalues['Clothes Washer Power Usage']:match("([^;]+);([^;]+)")-- washer_usage = tonumber(sWatt)
washer_usage =tonumber(otherdevices_svalues[energy_consumption])