"Grau, Schlag, cool ..." oder die Logik der Klimatisierung in einem Smart Home

Smart Home

, , , , . - , . .

, . , , , .

: , . Fibaro, .

HVAC Z-Wave. , . , , Z-Wave .

, .

, . Home Center 2. , . , , HC2 z-wave , z-wave , . 230 . , , , - 230 . . HC2 4-5 , 46 57 z-wave .

, , , , . , : , , CO2, , . , CO2.

z-wave , . , , . , 35 , . FIB_FGFS-101, IR REM_ZXT120, RS 014G0160, , DS 18B20 . , , .. 27 .

Temperaturregelung zum Schutz des Bodens vor Überhitzung




, , – .

. HC2 , . , DS 18B20, . , .

, . , , - , z-wave FIB_FGBS-001.

Anschließen der Temperatursensoren DS18B20

DS18B20

, . , .

Virtuelles Gerät - Aktivierungsschaltflächen für den Heim- / Arbeitsmodus


— /

, , HVAC , . , , 18 .

. . .

, , .

3 Mitsubishi lectric. IR REM_ZXT120. , IR .

- , FIB_FGS-222.

Außerdem werden alle Apartments sieben Heizungsetagen und einen Zentralheizungskreis haben. Jeder Stromkreis ist mit einem Dreistellungsventil mit Servoantrieb ausgestattet. Es wird vom RGBW-Modul FIB_FGRGB-101 gesteuert.

Nachdem wir alle erforderlichen Geräte ausgewählt und untersucht hatten, bestand unsere nächste Aufgabe darin, den effektivsten und autarksten Algorithmus für die Klimatisierung zu entwickeln.

Klickbar:

Blockschaltbild mit dem Klimatisierungsalgorithmus in der Wohnung

- , HVAC.

. 2 lua.
, .

:

  • /
  • ( ) /

--[[
%% properties
3 Temperature   --  
85 value		--  1
86 value		--  2
87 value		--  3

%% events

%% globals
tempSet
--]]

local temp1 = tonumber(fibaro:getValue(85, "value")) --   1
local temp2 = tonumber(fibaro:getValue(86, "value"))--   2
local temp3 = tonumber(fibaro:getValue(87, "value"))--   3
local tempOUT = tonumber(fibaro:getValue(3, "Temperature"))--    
local IDCooler = 99   -- 
local IDCond = 100 -- 
local IDCondHeat = 102 --   ( )
local IDFloor = 23 --  
local IDHeat = 24 -- 

local tempset = fibaro:getGlobalValue("tempSet")
local workmode = fibaro:getGlobalValue("Workmode")


local tempInside = (temp1 + temp2 + temp3) / 3
local date = os.date("!*t", now)
local currtime = date.hour*60 + date.min --   
local d = tempset - tempInside
local w = tempset - tempOUT


--globals:  
--	Workmode
--	TempSet
-- 	WinStatus
--	Isventnow
--	CHeating

local cHeating = "on"
local winStatus = "closed"

print("Starting Climate Control")
print("t   = "..tempInside..",  t  = "..tempset)
print("Workmode: "..workmode..",  Windows: "..winStatus,",  Central Heating: "..cHeating)

--   
if (fibaro:getGlobalValue("Workmode1") == "At work") 
then 
    -- 
	if (tempInside < 18) 
    then -- 
    	if (cHeating == "on")
    	then --  
    		print(" ")
      		fibaro:call(IDHeat, "turnOn")
      		if(Isventnow == "no")
        	then
      			fibaro:call(IDCooler, "turnOff")
      		end
            fibaro:call(IDCondHeat, "turnOff")
      		fibaro:call(IDCond, "turnOff")
      		fibaro:call(IDFloor, "turnOff")
      	elseif (windows == "closed")
      	then --   
     		print("  ")
      		fibaro:call(IDCondHeat, "turnOn")
      		fibaro:call(IDCond, "turnOn")
      		fibaro:call(IDFloor, "turnOff")
     		if(Isventnow == "no")
        	then
      			fibaro:call(IDCooler, "turnOff")
      		end      
      		fibaro:call(IDHeat, "turnOff")
      	end
    --    
    elseif (tempInside > 21)
    then -- 
		if(fibaro:getValue(IDHeat, value) >0)
		then
    		print(" ")
    		fibaro:call(IDHeat, "turnOff")
		else
        	fibaro:call(IDCondHeat, "turnOn")
      		fibaro:call(IDCond, "turnOn")
      		fibaro:call(IDFloor, "turnOff")
            if(Isventnow == "no")
        	then
      			fibaro:call(IDCooler, "turnOff")
      		end
		end
    end 
--    
elseif d < 1 and d > -1
then
  	print(" ")
    -- 
	fibaro:call(IDCondHeat, "turnOff")
    fibaro:call(IDCond, "turnOff")
	-- 
    if(Isventnow == "no")
    then
		fibaro:call(IDCooler, "turnOff")
    end
	-- 
	fibaro:call(IDHeat, "turnOff")
	--  
	fibaro:call(IDFloor, "turnOff")
--    
elseif (cHeating == "on")
then --  
    if (d >= 1)
    then  --
        if (d <= 3)
        then 
    		print("  ")
            --  
            fibaro:call(IDFloor, "turnOn")		
            fibaro:call(IDCondHeat, "turnOff")
            fibaro:call(IDCond, "turnOff")
            fibaro:call(IDHeat, "turnOff")
            fibaro:call(IDCooler, "turnOff")
        elseif (d > 3)
        then
    		print("    ")
			--  
    		fibaro:call(IDFloor, "turnOn")
            -- 
    		fibaro:call(IDHeat, "turnOn")
			fibaro:call(IDCondHeat, "turnOff")
      		fibaro:call(IDCond, "turnOff")
      	    if(Isventnow == "no")
    		then
				fibaro:call(IDCooler, "turnOff")
    		end
        end
    elseif (d <= -1)
    then --
  		print(" ")
        --  
  		if(Isventnow == "no")
   	 	then
			fibaro:call(IDCooler, "turnOn")
    	end
        lastCondition = currTime
    end
--   
elseif (cHeating == "off")
then --
    if (d >= 1)
    then
        if (w <= 0)
        then
    		print(" ")
            --  
    		if(Isventnow == "no")
      		then
				fibaro:call(IDCooler, "turnOn")
    		end
    		fibaro:call(IDCondHeat, "turnOff")    
			lastCondition = currTime
        elseif (d < 4)
        then 
    		print(" ")
			--  
    		fibaro:call(IDCondHeat, "turnOff")
      		if(Isventnow == "no")
    		then
				fibaro:call(IDCooler, "turnOn")
    		end
        	lastCondition = currTime
        elseif (winStatus == "closed")
        then
    		print("   ")
			--    
    		fibaro:call(IDCondHeat, "turnOn")
      		fibaro:call(IDCond, "turnOn")    
      		if(Isventnow == "no")
    		then
				fibaro:call(IDCooler, "turnOff")
    		end
        end
    elseif (d <= -1)
    then --
		if(w >= 0)
		then
	    	if(d > -4)
	    	then
     			print(" ")
	        	--  
                if(Isventnow == "no")
                then
                    fibaro:call(IDCooler, "turnOn")
                end
    			fibaro:call(IDCondHeat, "turnOff")
      			fibaro:call(IDCond, "turnOff")
	    	elseif (winStatus == "closed")
        	then
      			print(" ")
	        	--  
      			fibaro:call(IDCond, "turnOn")
      			fibaro:call(IDCondHeat, "turnOff")
                if(Isventnow == "no")
                then
                    fibaro:call(IDCooler, "turnOff")
                end
	    	end
		elseif (winStatus == "closed")
      	then
    		print(" ")
	    	--  
   			fibaro:call(IDCond, "turnOn")
      		fibaro:call(IDCondHeat, "turnOff")    
            if(Isventnow == "no")
            then
                fibaro:call(IDCooler, "turnOff")
            end
		end
    end
end     


, :

  • Workmode {«at work», «at home»} //
  • TempSet //
  • WinStatus {'opened", «closed»} // ( )
  • CHeating {«on»,«off»} //

. WinStatus. . CHeating.

, , - . , 15 . « ».

function vent_forced()
  
local workmode = fibaro:getGlobal('Workmode')
local isventnow = fibaro:getGlobal('Isventnow')
local lastModified = fibaro:getGlobalModificationTime('Isventnow')
  if ((os.time() - lastModified) < 10800) then
    	print ("       "..(os.time() - lastModified))
    	print ("     3- ")
  end 
	if ( workmode == 'At home' and isventnow == 'no' and (os.time() - lastModified) > 10800 ) then
	 	print ("       "..(os.time() - lastModified))
    		fibaro:call(99, "turnOn")
		fibaro:setGlobal('Isventnow', 'yes')
 		print ("     3 ")
		print ("   ")
    		fibaro:sleep(900000)
		fibaro:call(99, "turnOff")
    		fibaro:setGlobal('Isventnow', 'no')
		print ("   ")
	end 
end

 local sourceTrigger = fibaro:getSourceTrigger()
	if (sourceTrigger["type"] == "autostart") then
   		while true do
       		fibaro:debug('  ')
        		local currentDate = os.date("*t")
			if (currentDate.min >= 0 and currentDate.min <= 60) then
          		vent_forced()
          		end
		fibaro:debug(' ,    1 ')
  		fibaro:sleep(3600*1000)
        end
end


. , . , .

Source: https://habr.com/ru/post/de398391/


All Articles