Welcome to Smart Home Forum by FIBARO
Dear Guest,
as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.
As a member you can:
- Start new topics and reply to others
- Follow topics and users to get email updates
- Get your own profile page and make new friends
- Send personal messages
- ... and learn a lot about our system!
Regards,
Smart Home Forum by FIBARO Team

Question
KristianO 15
Hi,
I was thinking of a scene that is triggered upon power consumption in a wall plug.
I got one connected to my coffemachine and was thinking that if the power consumption goes above threshold value a timer would start and check the power once more after 1h.
If its still on... its forgotten, send push and turn it off... But I'm stuck!
Please login or register to see this image.
/emoticons/default_smile.png" alt=":)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />--[[
%% properties
69 valueSensor
%% globals
--]]
local currentDate = os.date("*t");
local power = fibaro:getValue(69, "valueSensor")
local threshold = 50 -- Threshold in watt
if (tonumber(power) > threshold) then
fibaro:debug("HC2 Coffee script started: " .. os.date());
fibaro:debug("Consumption="..power.." Watt")
fibaro:debug("Coffee Machine is ON") -- lite debug text
Please login or register to see this image.
/emoticons/default_smile.png" alt=":)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />end
... Timer to check again after 1h?
fibaro:call(69, "TurnOff")
fibaro:debug("Send push message")
fibaro:call(47, "sendPush", "Coffe Machine automatically turned of at: " .. string.format("%02d", currentDate.hour) .. ":" .. string.format("%02d", currentDate.min));
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.