Code: Select all
local devicesToCheck =
{
'Inv 122315002511', 'Inv 122315025460', 'Inv 122315031819', 'Inv 122315032050', 'Inv 122315032284', 'Inv 122315037624', 'Inv 122315042557', 'Inv 122315042561', 'Inv 122315043359', 'Inv 122315043462', 'Inv 122315045441', 'Inv 122315045526', 'Inv 122315045527', 'Inv 122315045546', 'Inv 122315045550', 'Inv 122315045550', 'Inv 122315045888',
}
return
{
on =
{
devices = devicesToCheck,
timer =
{
'every 1 minutes',
},
},
data =
{
notified = { initial = {} },
},
logging =
{
level = domoticz.LOG_DEBUG, -- change from LOG_DEBUG to LOG_ERROR when script executes without problems
marker = 'Enphase weergeven ',
},
execute = function(dz, item)
if item.isTimer then
for index, deviceName in ipairs(devicesToCheck) do
local device = dz.devices(deviceName)
dz.log('device name ' .. device.name, dz.LOG_DEBUG)
-- dz.log('device state ' .. device.state, dz.LOG_DEBUG)
-- dz.log('device lastUpdate ' .. device.lastUpdate.minutesAgo, dz.LOG_DEBUG)
dz.log('device nValue ' .. device.nValue, dz.LOG_DEBUG)
dz.devices('Enphase totaal').updateText('Inverter ' .. device.name ..' '.. tostring(device.nValue).. ' Watt ' ..'\n\n')
end
-- dz.devices(38).dump()
end
end
}
--end
Can you give me a hint how to display 17 lines with information for every inverter?
To display many lines I'm using this construct:
Code: Select all
domoticz.devices('Heating').updateText('Room temperature   ' .. math.floor(domoticz.devices('Tado Kamer Temp').temperature*10)/10 .. ' °C'..
'\n Room temp. setpoint  ' .. domoticz.devices('Tado Kamer Setpoint').setPoint .. ' °C'..
'\n Room heating       ' .. tostring(math.floor(domoticz.devices('Tado Kamer Heating').percentage)) .. '%'..
'\n \n Kitchen temperature   ' .. tostring(math.floor(domoticz.devices('Tado Keuken Temp').temperature*10)/10) .. ' °C'..
'\n      Kitchen temp. setpoint  ' .. domoticz.devices('Tado Keuken Setpoint').setPoint .. ' °C'..
'\n      Kitchen heating     ' .. tostring(math.floor(domoticz.devices('Tado Keuken Heating').percentage)) .. '%'..
'\n \n      Outside temperature   ' .. tostring(math.floor(domoticz.devices('Buitentemperatuur').temperature*10)/10) .. ' °C'..
'\n ')
Just don't know how to do it.