04.04.2020, 07:14
(This post was last modified: 04.04.2020, 07:17 by liangming011.)
local temp=knxdatatype.decode(event.datahex,dt.float16)
local heat=knxobject.get('address','1/3/5')
local ac=knxobject.get('address','3/5/37')
local heat_on=toboolean(heat.data)
local ac_on=toboolean(ac.data)
--heating off
if not heat_on then
--制冷
if temp>24 and not ac_on then
alert('BR temp:%f,A/C ON',temp)
ac:write (1)
end
--过度季节制冷
if temp>15 and temp<24 and not ac_on then
alert('BR temp:%f,A/C ON',temp)
ac:write (2)
end
--过度季节制暖
if temp>10 and temp<15 and not ac_on then
alert('BR temp:%f,A/C ON',temp)
ac:write (3)
end
--制暖
if temp<10 and not ac_on then
alert('BR temp:%f,A/C OFF',temp)
ac:write(4)
end
end
Like this, would it work
1 value is refrigeration;2 value is Overmode refrigeration;3 value is Excessive mode heating;4 value is Making the model。
local heat=knxobject.get('address','1/3/5')
local ac=knxobject.get('address','3/5/37')
local heat_on=toboolean(heat.data)
local ac_on=toboolean(ac.data)
--heating off
if not heat_on then
--制冷
if temp>24 and not ac_on then
alert('BR temp:%f,A/C ON',temp)
ac:write (1)
end
--过度季节制冷
if temp>15 and temp<24 and not ac_on then
alert('BR temp:%f,A/C ON',temp)
ac:write (2)
end
--过度季节制暖
if temp>10 and temp<15 and not ac_on then
alert('BR temp:%f,A/C ON',temp)
ac:write (3)
end
--制暖
if temp<10 and not ac_on then
alert('BR temp:%f,A/C OFF',temp)
ac:write(4)
end
end
Like this, would it work
1 value is refrigeration;2 value is Overmode refrigeration;3 value is Excessive mode heating;4 value is Making the model。