Code:
-- ************** RUN THIS SCRIPT ONCE TO CREATE YOUR OBJECTS **************--
--**************************************************************************--
--*** Address setup for Thermokon SAB05 - created by Erwin van der Zwart ****--
--************ For HL from FW 1.5 and SL from FW 1.2 with NGINX ************--
-- ENOCEAN EEP for Micropelt iTVR ******************************************--
-- R-ORG: 0xA5 *************************************************************--
-- FUNC: 0x20 *************************************************************--
-- TYPE: 0x01 *************************************************************--
--*************************** Start of parameters **************************--
-- Version 1.1 *************************************************************--
-- Set KNX main group
maingroup = 6
-- Set KNX middle group
middlegroup = 2
-- Set number of valves (max 19 -> 19 x 13 objects = 247 = max in 1 group range)
numberofvalves = 1
-- Name des Ventils
NameOfValve = 'Kino'
--**************************************************************************--
--**************************** End of parameters ***************************--
--**************************************************************************--
--****************** DON'T CHANGE ANYTHING UNDER THIS LINE *****************--
--**************************************************************************--
--Check to avoid creating more then max number of valves */*/247 ( = 11 x 23 objects in 1 maingroup)
if numberofvalves > 0 and numberofvalves <= 19 then
--Check to avoid address 0/0/0
if maingroup == 0 then
endgroup = 1
else
endgroup = 0
end
--Loop for creating number of valves
for i = 1, numberofvalves, 1 do
--Prefixed object types, enmums and min-max
objectcreatemapping = {
[1] = {
nm = 'Incomming Enocean Telegram',
dttp = dt.uint32,
nts = '',
nms = {},
vsprms = {},
},
[2] = {
nm = 'Incomming Enocean Status',
dttp = dt.uint8,
nts = '',
nms = {},
vsprms = {},
},
[3] = {
nm = 'Outgoing Enocean Telegram',
dttp = dt.uint32,
nts = '',
nms = {},
vsprms = {},
},
[4] = {
nm = 'Outgoing Enocean Status',
dttp = dt.uint8,
nts = '',
nms = {},
vsprms = {},
},
[5] = {
nm = 'Valve Position',
dttp = dt.scale,
nts = ' %',
nms = {},
vsprms = {},
},
[6] = {
nm = 'Valve Position Feedback',
dttp = dt.scale,
nts = ' %',
nms = {},
vsprms = {},
},
[7] = {
nm = 'Room Temperature',
dttp= dt.float16,
nts = ' °C',
nms = {},
vsprms = {},
},
[8] = {
nm = 'Summer Mode',
dttp= dt.bool,
nts = ' °C',
nms = {
[0] = "Wakeup cycle every 10 minutes",
[1] = "Wakeup cycle every 8 hours",
["default"] = "",
},
vsprms = {},
},
[9] = {
nm = 'Active Harvesting',
dttp= dt.bool,
nts = ' °C',
nms = {
[0] = "Cold - Not loading",
[1] = "Hot - Loading",
["default"] = "",
},
vsprms = {},
},
[10] = {
nm = 'Energy Level',
dttp= dt.bool,
nts = ' °C',
nms = {
[0] = "Empthy - Not sufficient loaded",
[1] = "Full - Sufficient loaded",
["default"] = "",
},
vsprms = {},
},
[11] = {
nm = 'Internal Temperature of iTVR',
dttp= dt.float16,
nts = ' °C',
nms = {},
vsprms = {},
},
[12] = {
nm = 'Telegram Type',
dttp= dt.bool,
nts = '',
nms = {
[0] = "Teach-in telegram",
[1] = "Data telegram",
["default"] = "",
},
vsprms = {},
},
[13] = {
nm = 'RAW Telegram Data',
dttp= dt.string,
nts = '',
nms = {},
},
vsprms = {},
[14] = {
nm = NameOfValve .. ' Zieltemperatur',
dttp= dt.float16,
nts = ' °C',
nms = {},
vsprms = {},
},
}
--Loop for creating all objects for each valve
for j = 1, #objectcreatemapping, 1 do
address = grp.create({
--name = 'Thermokon SAB05 Valve ' .. i .. ' - ' .. objectcreatemapping[j].nm,
name = 'Thermokon SAB05 ' .. NameOfValve .. ' - ' .. objectcreatemapping[j].nm,
address = maingroup .. '/' .. middlegroup .. '/' .. endgroup,
datatype = objectcreatemapping[j].dttp,
visparams = objectcreatemapping[j].vsprms,
enums = objectcreatemapping[j].nms,
units = objectcreatemapping[j].nts,
tags = {'EEP A5-20-01', 'Valve ' .. NameOfValve},
comment = 'Auto created by script',
})
endgroup = endgroup + 1
end
end
end
script.disable(_SCRIPTNAME)