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
Guest vandi
Mam problem.
Dokładnie chodzi o punkt w którym temperatura kotła spada poniżej 44 stopni, co jest jednoznaczne z brakiem węgla. Zostają wysłane powiadomienia do zainteresowanych.
Żeby powiadomienia nie były non stop wysyłane utworzyłem zmienną globalną "Piec pracuje"
Jeżeli temperatura spada ponizej 44 stopni zmienne zmienia stan z 1 na 0 i powiadomienia nie powinny być wysyłane.
A są.
Gdzie zrobiłem błąd?
--[[
%% properties
299 value
%% weather
%% events
%% globals
--]]
local pompyAll = {297,271,270,301,281}
local tempPieca = tonumber(fibaro:getValue(299, "value"))
local pompaMieszID = 296
local silAwaryjneID = 281
local powiadomieniaMail= {2, 224, 84, 225 }
local powiadomieniaPush={ 16, 225}
if fibaro:countScenes() > 1 then fibaro:abort()
end
--------------------------------------------------------------
if tempPieca < 44 and fibaro:getGlobalValue("piecPracuje", "1")
then
fibaro:setGlobal("piecPracuje", "0");
for i,j in ipairs(powiadomieniaMail) do
fibaro:call(j,"sendDefinedEmailNotification", "320")
end
for i,j in ipairs(powiadomieniaPush) do
fibaro:call(j,"sendDefinedPushNotification", "320")
end
fibaro:call(pompaMieszID, "turnOff") ;
for i,j in ipairs(pompyAll) do
fibaro:call(j,"turnOff")
end
else
-----------------------------------------------------------
if tempPieca > 45 and fibaro:getGlobalValue("piecPracuje", "0")
then
fibaro:setGlobal("piecPracuje", "1");
else
----------------------------------------------------------------
if tempPieca <75 and fibaro:getGlobalValue("alarmTempPieca", "1")
then
fibaro:setGlobal("alarmTempPieca","0");
if fibaro:getGlobalValue("silTermoe", "0")
then
for i,j in ipairs(pompyAll) do
fibaro:call(j,"turnOff");
end
else
fibaro:call(silAwaryjneId, "turnOff");
end
else
-------------------------------------------------------------
if tempPieca >85 and fibaro:getGlobalValue("alarmTempPieca", "0")
then
fibaro:setGlobal("alarmTempPieca","1");
for i,j in ipairs(pompyAll) do
fibaro:call(j,"turnOn")
end
for i,j in ipairs(powiadomieniaMail) do
fibaro:call(j,"sendDefinedEmailNotification", "319")
end
for i,j in ipairs(powiadomieniaPush) do
fibaro:call(j,"sendDefinedPushNotification", "319")
end
end
end
end
end
fibaro:debug("Piec pracuje: " ..fibaro:getGlobalValue("piecPracuje"));
fibaro:debug("Alarm temperatury pieca: " ..fibaro:getGlobalValue("alarmTempPieca"));
fibaro:debug("Temperatura pieca: " ..tempPieca);
fibaro:sleep(30*1000)
1 answer 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.