I'm new with Domoticz and LUA.
I want to monitor my wall plug for the washing machine to tell me if the laundry is done.
Below is a LUA script from a fibaro froum. 161 is the id for the wall plug in the fibaro system. 45 for the smartphone.
How does the script has to look like for Domoticz and will it be possible to do that.
sorry for my bad english
thanks and regards
Alex
Code: Select all
<code>--[[
%% properties
161 value
%% globals
--]]
local sourceTrigger = fibaro:getSourceTrigger();
if (sourceTrigger[&'type'] == 'property') -- Trigger wall plug
then
fibaro:sleep(600000); -- 10 min delay
local wallplug = (tonumber(fibaro:getValue(161, 'value')) > 0 ); -- get wall plug status
if (Wallplug)
then
while true do
local PushOff = (tonumber(fibaro:getValue(161, 'valueSensor')) < 8 ); -- Wallplus < then 8 watt
if (PushOff) then
fibaro:call(45, 'sendPush', 'laundry is done'); -- send push message tosmartphone
fibaro:sleep(600000); -- 10 min delay
fibaro:call(45, 'sendPush', 'wall plug will turn off'); -- send push message tosmartphone
fibaro:call(161, 'turnOff'); -- wallplug off
break;
end
fibaro:sleep(60000);
end
end
end
</code>