Jump to content

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


  • 0

Scena wyłączająca cyrkulację


24itdev@gmail.com

Question

Witam,

 

Panowie jestem początkującym LUA-nowcem ;)

Proszę o wyrozumiałość.

 

Zaczynam przerabiać scenę wyłączenia cyrkulacji i potrzebuję porady.

 

Najpierw napiszę o co chodzi.

Mam pompę cyrkulacji podłączoną pod WallPlug-a

W dwóch łazienkach oraz w kuchni - czujki.

I teraz chodzi o to aby cyrkulacja się wyłączyła jak żadna czujka nie jest naruszona przez 10 min.

Zrobiłem to poprzez 3 sceny w bloczkach ale słabo to działa i dodatkowo ciągle mam przekroczone instancje.

 

Oto jedna z nich w LUA:

 

--[[
%% properties
9 value
%% weather
%% events
%% globals
--]]

local startSource = fibaro:getSourceTrigger();
if(startSource["type"] == "other") then
    fibaro:call(110, "turnOff");
    fibaro:call(101, "sendDefinedPushNotification", "7");
else
if (( tonumber(fibaro:getValue(9, "value")) == 0 ) and ( tonumber(fibaro:getValue(88, "value")) == 0 ) and ( tonumber(fibaro:getValue(94, "value")) == 0 )) then
setTimeout(function()
local delayedCheck0 = false;
local tempDeviceState0, deviceLastModification0 = fibaro:get(9, "value");
if (( tonumber(fibaro:getValue(9, "value")) == 0 ) and (os.time() - deviceLastModification0) >= 600) then
    delayedCheck0 = true;
end
local delayedCheck1 = false;
local tempDeviceState1, deviceLastModification1 = fibaro:get(88, "value");
if (( tonumber(fibaro:getValue(88, "value")) == 0 ) and (os.time() - deviceLastModification1) >= 600) then
    delayedCheck1 = true;
end
local delayedCheck2 = false;
local tempDeviceState2, deviceLastModification2 = fibaro:get(94, "value");
if (( tonumber(fibaro:getValue(94, "value")) == 0 ) and (os.time() - deviceLastModification2) >= 600) then
    delayedCheck2 = true;
end

local startSource = fibaro:getSourceTrigger();
if (
 ( delayedCheck0 == true )
and
 ( delayedCheck1 == true )
and
 ( delayedCheck2 == true )
or
startSource["type"] == "other"
)
then
    fibaro:call(110, "turnOff");
    fibaro:call(101, "sendDefinedPushNotification", "7");
end
end, 600000)
end

 

I teraz się zastanawiam.

Rozumiem że jak zrobię tę scenę co powyżej i np. będę jej kazał sprawdzać czy wszystkie czujki nie zostały naruszone przez 10 min

to wyłącz cyrkulację. A jak nie to czekaj np 2 min i znowu sprawdzaj to wystarczy jedna scena?

 

Pozdrawiam

 

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...