Calculating washing machine costs; lost in numbers...

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
Sarcas
Posts: 86
Joined: Wednesday 11 October 2017 8:50
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1ß
Location: Friesland
Contact:

Calculating washing machine costs; lost in numbers...

Post by Sarcas »

I used the script here in the forum to read values from my device. it needed some tweaking to make it work for me, but it works now. Almost. I just can't figure out the last step, the actual costs.

After all is done, I have these numbers after a washing cycle:

Start kWh = 39599
End kWh = 39975
Used kWh = 376
Price per kWh = 0.22

The original script says

Code: Select all

MachineCost = (domoticz.data.MachineEndkWh - domoticz.data.MachineStartkWh) / 100000 * MachinePricePerkWh   -- Deviding factor might need to be adjusted
MachineUsed = (domoticz.data.MachineEndkWh - domoticz.data.MachineStartkWh) / 1000                          -- Deviding factor might need to be adjusted
And then my brain freezes trying to figure out what to change :( And as important, why.

Thanks for any help here!

S.
--

Domoticz on rPi4 - RFXCOM RFXtrx433 USB - ZW090 Z-Stick Gen5 EU - IKEA Tradfri - Philips HUE - YouLess meter - SolarEdge
User avatar
waltervl
Posts: 5846
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Calculating washing machine costs; lost in numbers...

Post by waltervl »

The original script will also show the cost per wash cycle. Does it too in your script?

So what is not correct in your version of the script?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
willemd
Posts: 648
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

Re: Calculating washing machine costs; lost in numbers...

Post by willemd »

Sarcas wrote: Wednesday 21 September 2022 21:26 Start kWh = 39599
End kWh = 39975
Used kWh = 376
Price per kWh = 0.22
If those numbers would be real kWh as shown then it is a simple multiplication without dividing factor.
But my guess is that there should be a comma in the start-, end- and used-kWh, otherwise you have a very expensive washing machine !!
And you just need to apply the same factor in your calculation
So if the real usage is 0.376 kWh but your variable contains 376 you apply a factor 1000.

Is that what you were looking for?

Or you do:

MachineUsed = (domoticz.data.MachineEndkWh - domoticz.data.MachineStartkWh) / 1000 -- Deviding factor might need to be adjusted
MachineCost = MachineUsed * MachinePricePerkWh
Sarcas
Posts: 86
Joined: Wednesday 11 October 2017 8:50
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1ß
Location: Friesland
Contact:

Re: Calculating washing machine costs; lost in numbers...

Post by Sarcas »

Those are the numbers Domoticz reads from my TKB TZ-69E smart energy plug in.

Code: Select all

domoticz.devices(idxVerbruikWasmachine).WhTotal
Oh hold on... WhTotal. Not kWh... Kilo... Kilo = 1000...

The fog starts to clear up ;)

So / 1000 will give me kWh from Wh!


MachineUsed = (domoticz.data.MachineEndkWh - domoticz.data.MachineStartkWh) / 1000
MachineUsed = (39975 - 39599) / 1000 = 0,376

MachineCost = MachineUsed * MachinePricePerkWh
MachineCost = 0,376 * 0,22 = 0,08272

That is way less than I expected.

Thanks for helping out!

S.
--

Domoticz on rPi4 - RFXCOM RFXtrx433 USB - ZW090 Z-Stick Gen5 EU - IKEA Tradfri - Philips HUE - YouLess meter - SolarEdge
willemd
Posts: 648
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

Re: Calculating washing machine costs; lost in numbers...

Post by willemd »

0.376 kWh sounds very low for a complete washing cycle. You have a heating element and a motor to drive. Depends of course on the temperature and the type of cycle.

But I recently measured how much it takes to boil 1 liter of water and that wa approx. 0.1 kWh. Lower temperature takes of course less, but then you use more water in a washing machine. Let's say you increase by 20 degrees instead of 80, then you could heat 4 liters with 0.1 kWh, 12 with 0.3 kWh and use the rest for the motor ?

I will do some measurement as well.
willemd
Posts: 648
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

Re: Calculating washing machine costs; lost in numbers...

Post by willemd »

I did a measurement as well: 0.474 kWh for a washing cycle of 1 h 26 minutes at 40 degrees.
I see a spike at the beginning to heat up the water and a much lower spike later for the rinse and an even lower for the spinning cycle at the end.
willemd
Posts: 648
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

Re: Calculating washing machine costs; lost in numbers...

Post by willemd »

And 0.292 KWh for a 30 minute mini-wash cycle at 40 degrees
And 0.321 KWh for a long cycle but then at 30 degrees

So you can save 33% of electricity by lowering the temperature with 10 degrees
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest