Pushnotification when dishwasher/washing machine is ready?
Moderator: leecollings
-
- Posts: 722
- Joined: Friday 02 October 2015 12:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Finland
- Contact:
Re: Pushnotification when dishwasher/washing machine is ready?
Hard to say anything just based on this info. I suggest adding more debug lines ( = print more stuff to log) on the script to see where it goes wrong. With just a quick look I noticed something that might play a role:maomanna wrote:anyone?
Code: Select all
local energy_consumption = 'verbruik wasmachine' --Name of Z-Wave plug that contains actual consumption of washingmachine (in
-- sWatt, sTotalkWh = otherdevices_svalues['Clothes Washer Power Usage']:match("([^;]+);([^;]+)")
-- washer_usage = tonumber(sWatt)
washer_usage = tonumber(otherdevices_svalues[energy_consumption])
-
- Posts: 168
- Joined: Monday 22 June 2015 10:48
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: The Netherlands
- Contact:
Re: Pushnotification when dishwasher/washing machine is ready?
You're free to do it however you like.gordonb3 wrote:Considering the various operating modes of the targeted devices that I own, I doubt that measuring power consumption and issuing an alarm/notification after X seconds of ample usage is very reliable. And of course this requires acquiring hardware that can measure the power usage of such devices and this will need to be quality hardware as the targeted devices will typically have a peak power rating (far) above 2000 Watts. Which doesn't seem like a very good investment as I can already deduce the power usage of these devices from my P1 reports. I'd guess it would be far cheaper and exact to get yourself a light monitoring device to detect whether the control light on the dishwasher/washing machine is on. Or to stay with the subject: signal when it turns off.
I use a Tp-link hs110, rated for 3500w, and the script works flawlesly for my washing machine.
With P1 you will only know the total power usage, so that won't work.
-
- Posts: 94
- Joined: Monday 30 November 2015 16:21
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Pushnotification when dishwasher/washing machine is ready?
this is my device:Nautilus wrote:Hard to say anything just based on this info. I suggest adding more debug lines ( = print more stuff to log) on the script to see where it goes wrong. With just a quick look I noticed something that might play a role:maomanna wrote:anyone?Is your device "verbruik wasmachine" such it only reports Watts? If it reports energy (W & kWh) then you need the split which you have now commented out (and use correct device name there.Code: Select all
local energy_consumption = 'verbruik wasmachine' --Name of Z-Wave plug that contains actual consumption of washingmachine (in -- sWatt, sTotalkWh = otherdevices_svalues['Clothes Washer Power Usage']:match("([^;]+);([^;]+)") -- washer_usage = tonumber(sWatt) washer_usage = tonumber(otherdevices_svalues[energy_consumption])
and this is the editted script:
Code: Select all
--script_time_washingmachine.lua
--Change the values below to reflect to your own setup
local washer_status_uservar = 'washingmachine_status'
local energy_consumption = 'wasmachine' --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 needed
local idle_minutes = 5 --The amount of minutes the consumption has to stay below the 'consumption_lower' value
local consumption_upper = 20 --If usage is higher than this value (Watts), the washingmachine has started
local 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['wasmachine']:match("([^;]+);([^;]+)")
-- washer_usage = tonumber(sWatt)
washer_usage = tonumber(otherdevices_svalues[energy_consumption])
commandArray = {}
--Virtual switch is off, but consumption is higher than configured level, so washing has started
if (washer_usage > consumption_upper) and uservariables[washer_status_uservar] == 0 then
commandArray['Variable:' .. washer_status_uservar]='1'
print('Current power usage (' ..washer_usage.. 'W) is above upper boundary (' ..consumption_upper.. 'W), so washing has started!')
commandArray['SendNotification']='Wasmachine is gestart!'
commandArray['Variable:' .. washer_counter_uservar]=tostring(idle_minutes)
end
--Washing machine is not using a lot of energy, check the counter
if (washer_usage < consumption_lower) and uservariables[washer_status_uservar] == 1 then
commandArray['Variable:' .. washer_counter_uservar]=tostring(math.max(tonumber(uservariables[washer_counter_uservar]) - 1, 0))
print('Current power usage (' ..washer_usage.. 'W) is below lower boundary (' ..consumption_lower.. 'W), washer is idle or almost ready')
print('Subtracting counter, old value: ' ..uservariables[washer_counter_uservar].. ' minutes')
elseif ((uservariables[washer_counter_uservar] ~= idle_minutes) and uservariables[washer_status_uservar] == 1) then
commandArray['Variable:' .. washer_counter_uservar]=tostring(idle_minutes)
print('Resetting Washing Machine Timer')
end
--Washingmachine is done
if ((uservariables[washer_status_uservar] == 1) and uservariables[washer_counter_uservar] == 0) then
print('Washingmachine is DONE')
print('Current power usage washingmachine ' ..washer_usage.. 'W')
print('Washingmachine is done, please go empty it!')
commandArray['SendNotification']='Cycle Ended: Washing Machine#The load in the washing machine has finsihed, please move it to the dryer!#0'
commandArray['Variable:' .. washer_status_uservar]='0'
end
return commandArray
Code: Select all
2017-05-31 22:46:00.230 LUA: Resetting Washing Machine Timer
2017-05-31 22:46:00.230 EventSystem: Script event triggered: Wasmachine
2017-05-31 22:47:00.247 LUA: Resetting Washing Machine Timer
2017-05-31 22:47:00.247 EventSystem: Script event triggered: Wasmachine
2017-05-31 22:48:00.264 LUA: Resetting Washing Machine Timer
2017-05-31 22:48:00.265 EventSystem: Script event triggered: Wasmachine
2017-05-31 22:49:00.280 LUA: Resetting Washing Machine Timer
2017-05-31 22:49:00.280 EventSystem: Script event triggered: Wasmachine
-
- Posts: 722
- Joined: Friday 02 October 2015 12:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Finland
- Contact:
Re: Pushnotification when dishwasher/washing machine is ready?
So based on your screenshot the device shows both W and kWh so you need to change these lines:
to
That is, uncomment first two and remove third. If it does not work, please try to add more debug lines as suggested. Start with something as simple as:
Code: Select all
-- sWatt, sTotalkWh = otherdevices_svalues['wasmachine']:match("([^;]+);([^;]+)")
-- washer_usage = tonumber(sWatt)
washer_usage = tonumber(otherdevices_svalues[energy_consumption])
Code: Select all
sWatt, sTotalkWh = otherdevices_svalues['wasmachine']:match("([^;]+);([^;]+)")
washer_usage = tonumber(sWatt)
Code: Select all
sWatt, sTotalkWh = otherdevices_svalues['wasmachine']:match("([^;]+);([^;]+)")
washer_usage = tonumber(sWatt)
print('Current washer usage is '..washer_usage..'W')
-
- Posts: 94
- Joined: Monday 30 November 2015 16:21
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Pushnotification when dishwasher/washing machine is ready?
i get this error:Nautilus wrote:So based on your screenshot the device shows both W and kWh so you need to change these lines:toCode: Select all
-- sWatt, sTotalkWh = otherdevices_svalues['wasmachine']:match("([^;]+);([^;]+)") -- washer_usage = tonumber(sWatt) washer_usage = tonumber(otherdevices_svalues[energy_consumption])
That is, uncomment first two and remove third. If it does not work, please try to add more debug lines as suggested. Start with something as simple as:Code: Select all
sWatt, sTotalkWh = otherdevices_svalues['wasmachine']:match("([^;]+);([^;]+)") washer_usage = tonumber(sWatt)
Code: Select all
sWatt, sTotalkWh = otherdevices_svalues['wasmachine']:match("([^;]+);([^;]+)") washer_usage = tonumber(sWatt) print('Current washer usage is '..washer_usage..'W')
Code: Select all
2017-06-14 20:39:00.208 Error: EventSystem: in Wasmachine: [string "--script_time_washingmachine.lua ..."]:13: attempt to concatenate global 'washer_usage' (a nil value)
-
- Posts: 722
- Joined: Friday 02 October 2015 12:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Finland
- Contact:
Re: Pushnotification when dishwasher/washing machine is ready?
Means the variable is nil, i.e. it does not get any value. What do you get if you put
in the beginning of the script?
Code: Select all
print(otherdevices_svalues['wasmachine'])
-
- Posts: 94
- Joined: Monday 30 November 2015 16:21
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Pushnotification when dishwasher/washing machine is ready?
Nautilus wrote:Means the variable is nil, i.e. it does not get any value. What do you get if you putin the beginning of the script?Code: Select all
print(otherdevices_svalues['wasmachine'])
Code: Select all
--script_time_washingmachine.lua
--Change the values below to reflect to your own setup
local washer_status_uservar = 'washingmachine_status'
local energy_consumption = 'wasmachine' --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 needed
local idle_minutes = 5 --The amount of minutes the consumption has to stay below the 'consumption_lower' value
local consumption_upper = 20 --If usage is higher than this value (Watts), the washingmachine has started
local 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['wasmachine']:match("([^;]+);([^;]+)")
washer_usage = tonumber(sWatt)
print('Current washer usage is '..washer_usage..'W')
print(otherdevices_svalues['wasmachine'])
commandArray = {}
--Virtual switch is off, but consumption is higher than configured level, so washing has started
if (washer_usage > consumption_upper) and uservariables[washer_status_uservar] == 0 then
commandArray['Variable:' .. washer_status_uservar]='1'
print('Current power usage (' ..washer_usage.. 'W) is above upper boundary (' ..consumption_upper.. 'W), so washing has started!')
commandArray['SendNotification']='Wasmachine is gestart!'
commandArray['Variable:' .. washer_counter_uservar]=tostring(idle_minutes)
end
--Washing machine is not using a lot of energy, check the counter
if (washer_usage < consumption_lower) and uservariables[washer_status_uservar] == 1 then
commandArray['Variable:' .. washer_counter_uservar]=tostring(math.max(tonumber(uservariables[washer_counter_uservar]) - 1, 0))
print('Current power usage (' ..washer_usage.. 'W) is below lower boundary (' ..consumption_lower.. 'W), washer is idle or almost ready')
print('Subtracting counter, old value: ' ..uservariables[washer_counter_uservar].. ' minutes')
elseif ((uservariables[washer_counter_uservar] ~= idle_minutes) and uservariables[washer_status_uservar] == 1) then
commandArray['Variable:' .. washer_counter_uservar]=tostring(idle_minutes)
print('Resetting Washing Machine Timer')
end
--Washingmachine is done
if ((uservariables[washer_status_uservar] == 1) and uservariables[washer_counter_uservar] == 0) then
print('Washingmachine is DONE')
print('Current power usage washingmachine ' ..washer_usage.. 'W')
print('Washingmachine is done, please go empty it!')
commandArray['SendNotification']='Cycle Ended: Washing Machine#The load in the washing machine has finsihed, please move it to the dryer!#0'
commandArray['Variable:' .. washer_status_uservar]='0'
end
return commandArray
2017-06-15 11:53:00.198 Error: EventSystem: in Wasmachine: [string "--script_time_washingmachine.lua ..."]:15: attempt to concatenate global 'washer_usage' (a nil value)
-
- Posts: 722
- Joined: Friday 02 October 2015 12:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Finland
- Contact:
Re: Pushnotification when dishwasher/washing machine is ready?
As mentioned, please put it in the beginning of the script, it does not continue after the error anymore and you have it now after the error line (13).
-
- Posts: 94
- Joined: Monday 30 November 2015 16:21
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Pushnotification when dishwasher/washing machine is ready?
it look liked i had 2 devices names "wasmachine" 1 the switch and 1 the power usage.Nautilus wrote:As mentioned, please put it in the beginning of the script, it does not continue after the error anymore and you have it now after the error line (13).
now i get this output
Code: Select all
2017-06-15 14:31:00.459 LUA: 0.000;14571.000
2017-06-15 14:31:00.459 LUA: Current washer usage is 0W
2017-06-15 14:31:00.459 LUA: 50
Thanks so far!
Last edited by maomanna on Thursday 15 June 2017 14:59, edited 2 times in total.
-
- Posts: 722
- Joined: Friday 02 October 2015 12:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Finland
- Contact:
Re: Pushnotification when dishwasher/washing machine is ready?
Yes, two devices with the same name will lead to trouble in this kinds of situations
In any case, seems the script now reads correctly the current usage (0W) so I think you have good changes to get it working this evening!
In any case, seems the script now reads correctly the current usage (0W) so I think you have good changes to get it working this evening!
-
- Posts: 94
- Joined: Monday 30 November 2015 16:21
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Pushnotification when dishwasher/washing machine is ready?
cause the powerusage was below the minimum, the timer counted.
When the counter ended, i recieved a notification over telegram!
thanks for your help!
When the counter ended, i recieved a notification over telegram!
thanks for your help!
-
- Posts: 79
- Joined: Thursday 17 March 2016 14:58
- Target OS: Linux
- Domoticz version:
- Location: Pijnacker, the Netherlands
- Contact:
Re: Pushnotification when dishwasher/washing machine is ready?
Hi guys, i tried the script as posted here in this topic
(changed some names in the script, as seen below)
I have added the two uservars (“washingmachine_status” and “washingmachine_counter”) , as a integer and with the value 0.
I also changed the name of the “wasmachine” to “WattWasmachine” because the watt counter has this name in my system.
But I get the error below.
What is going wrong?
(changed some names in the script, as seen below)
Code: Select all
--script_time_washingmachine.lua
--Change the values below to reflect to your own setup
local washer_status_uservar = 'washingmachine_status'
local energy_consumption = 'WattWasmachine' --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 needed
local idle_minutes = 5 --The amount of minutes the consumption has to stay below the 'consumption_lower' value
local consumption_upper = 20 --If usage is higher than this value (Watts), the washingmachine has started
local 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['WattWasmachine']:match("([^;]+);([^;]+)")
washer_usage = tonumber(sWatt)
print('Current washer usage is '..washer_usage..'W')
print(otherdevices_svalues['WattWasmachine'])
commandArray = {}
--Virtual switch is off, but consumption is higher than configured level, so washing has started
if (washer_usage > consumption_upper) and uservariables[washer_status_uservar] == 0 then
commandArray['Variable:' .. washer_status_uservar]='1'
print('Current power usage (' ..washer_usage.. 'W) is above upper boundary (' ..consumption_upper.. 'W), so washing has started!')
commandArray['SendNotification']='Wasmachine is gestart!'
commandArray['Variable:' .. washer_counter_uservar]=tostring(idle_minutes)
end
--Washing machine is not using a lot of energy, check the counter
if (washer_usage < consumption_lower) and uservariables[washer_status_uservar] == 1 then
commandArray['Variable:' .. washer_counter_uservar]=tostring(math.max(tonumber(uservariables[washer_counter_uservar]) - 1, 0))
print('Current power usage (' ..washer_usage.. 'W) is below lower boundary (' ..consumption_lower.. 'W), washer is idle or almost ready')
print('Subtracting counter, old value: ' ..uservariables[washer_counter_uservar].. ' minutes')
elseif ((uservariables[washer_counter_uservar] ~= idle_minutes) and uservariables[washer_status_uservar] == 1) then
commandArray['Variable:' .. washer_counter_uservar]=tostring(idle_minutes)
print('Resetting Washing Machine Timer')
end
--Washingmachine is done
if ((uservariables[washer_status_uservar] == 1) and uservariables[washer_counter_uservar] == 0) then
print('Washingmachine is DONE')
print('Current power usage washingmachine ' ..washer_usage.. 'W')
print('Washingmachine is done, please go empty it!')
commandArray['SendNotification']='Cycle Ended: Washing Machine#The load in the washing machine has finsihed, please move it to the dryer!#0'
commandArray['Variable:' .. washer_status_uservar]='0'
end
return commandArray
I also changed the name of the “wasmachine” to “WattWasmachine” because the watt counter has this name in my system.
But I get the error below.
Code: Select all
2017-09-17 12:19:00.302 Error: EventSystem: in Wasmachine melding: [string "--script_time_washingmachine.lua..."]:15: attempt to concatenate global 'washer_usage' (a nil value)
What is going wrong?
- jvdz
- Posts: 2189
- Joined: Tuesday 30 December 2014 19:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.107
- Location: Netherlands
- Contact:
Re: Pushnotification when dishwasher/washing machine is ready?
Looks like the device WattWasmachine doesn't contain the right values. What is the exact content shown in the devices tab for it?
EDIT: This statement expect the svalue to contain "Current usage;Total kWh usage":
Likely your device only has the current usage?
If so just modify the script to:
Jos
EDIT: This statement expect the svalue to contain "Current usage;Total kWh usage":
Code: Select all
sWatt, sTotalkWh = otherdevices_svalues['WattWasmachine']:match("([^;]+);([^;]+)")
If so just modify the script to:
Code: Select all
--sWatt, sTotalkWh = otherdevices_svalues['WattWasmachine']:match("([^;]+);([^;]+)")
--washer_usage = tonumber(sWatt)
washer_usage = tonumber(otherdevices_svalues['WattWasmachine'])
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
-
- Posts: 79
- Joined: Thursday 17 March 2016 14:58
- Target OS: Linux
- Domoticz version:
- Location: Pijnacker, the Netherlands
- Contact:
Re: Pushnotification when dishwasher/washing machine is ready?
I wilbtry this tomorrow. I think you are right. The wattwasmachine is only current usage. No total count. I am using the coolcam neo powerplugs.
Hope this will work
Hope this will work
-
- Posts: 69
- Joined: Monday 08 August 2016 22:55
- Target OS: Linux
- Domoticz version: Stable
- Location: Netherlands, Alphen aan den Rijn
- Contact:
Re: Pushnotification when dishwasher/washing machine is ready?
I've had the same idea a little while ago, and this is how i solved it.
I'm using a Fibaro Wall Plug to measure its power consumption, when it uses 300watt or more a variable sets to on and writes it to the log.
Next it's waiting until the power consumption becomes 1.3 watt (ready, but the display on the washing machine still lid, 15 minutes later the display will turn off and power consumption will be 1 watt)
Then send a message, and turn on the most left light above the dining table.
Works like a charm and has a huge WAF (Wife Acceptance Factor)
I'm using a Fibaro Wall Plug to measure its power consumption, when it uses 300watt or more a variable sets to on and writes it to the log.
Next it's waiting until the power consumption becomes 1.3 watt (ready, but the display on the washing machine still lid, 15 minutes later the display will turn off and power consumption will be 1 watt)
Then send a message, and turn on the most left light above the dining table.
Works like a charm and has a huge WAF (Wife Acceptance Factor)
Over 50 Z-Wave Devices (Fibaro and Neo), 4xLogitech Hub, 2xPhilips Hue Bridge+55 Lights, 1x Nest Thermostat, 2xNetatmo Weather Station, 1xSkybell v1 Doorbell, 3 Kwikset KEVO Doorlocks and Domoticz running on a Intel NUC
-
- Posts: 79
- Joined: Thursday 17 March 2016 14:58
- Target OS: Linux
- Domoticz version:
- Location: Pijnacker, the Netherlands
- Contact:
Re: Pushnotification when dishwasher/washing machine is ready?
Thanks for sharring.Goldwing1973 wrote: ↑Sunday 17 September 2017 21:49 I've had the same idea a little while ago, and this is how i solved it.
I'm using a Fibaro Wall Plug to measure its power consumption, when it uses 300watt or more a variable sets to on and writes it to the log.
Next it's waiting until the power consumption becomes 1.3 watt (ready, but the display on the washing machine still lid, 15 minutes later the display will turn off and power consumption will be 1 watt)
Then send a message, and turn on the most left light above the dining table.
Works like a charm and has a huge WAF (Wife Acceptance Factor)
Domoticz Wasmachine.png
If the script doesn't work for me I can always try your Blocky. Blocky is more my language then LUA
-
- Posts: 79
- Joined: Thursday 17 March 2016 14:58
- Target OS: Linux
- Domoticz version:
- Location: Pijnacker, the Netherlands
- Contact:
Re: Pushnotification when dishwasher/washing machine is ready?
This did the trick it works now.jvdz wrote: ↑Sunday 17 September 2017 13:05 Looks like the device WattWasmachine doesn't contain the right values. What is the exact content shown in the devices tab for it?
EDIT: This statement expect the svalue to contain "Current usage;Total kWh usage":Likely your device only has the current usage?Code: Select all
sWatt, sTotalkWh = otherdevices_svalues['WattWasmachine']:match("([^;]+);([^;]+)")
If so just modify the script to:JosCode: Select all
--sWatt, sTotalkWh = otherdevices_svalues['WattWasmachine']:match("([^;]+);([^;]+)") --washer_usage = tonumber(sWatt) washer_usage = tonumber(otherdevices_svalues['WattWasmachine'])
Now only to tweek it to the right value's
Who is online
Users browsing this forum: No registered users and 1 guest