One problem I have using Domoticz ist that the senseo and actor indicators are so huge plus that these are divided in Switches, Temperature, Utility.
Of course there is Dashticz where one can customize everything.
I tried adding sensors and switches to a virtual room, but didn't like it.
The trick of handling information is that one needs just the essential information, the overview.
So I decided to create a few Text sensors containing the information I want to see in a glance and put those on the Dasboard page. Here is the code, it is heavily commented.
Code: Select all
local balance = ' '
local colorFlag = 'red'
local carConnected = ' '
local timeTillChargeLevel = ' '
return {
on = {
devices = {'Power', 'Gas'},
-- timer = {'every 1 minutes'},
},
logging = {
level = domoticz.LOG_DEBUG,
-- change LOG_DEBUG to LOG_ERROR to stop logging in the log
marker = 'Alles in een textfile',
},
execute = function(domoticz, triggeredItem)
-- domoticz.devices('Power').dump()
-- domoticz.devices('Gas').dump()
-- domoticz.devices('Gas gisteren').dump()
--[[domoticz.log('Gebruik nu :' .. domoticz.devices('Power').rawData[5],domoticz.LOG_DEBUG)
domoticz.log('Teruglevering nu :' .. domoticz.devices('Power').rawData[6],domoticz.LOG_DEBUG)
domoticz.log('Verbruik vandaag :' .. domoticz.devices('Power').counterToday,domoticz.LOG_DEBUG)
domoticz.log('Teruglevering vandaag :' .. domoticz.devices('Power').counterDeliveredToday,domoticz.LOG_DEBUG)
domoticz.log('Gas vandaag :' .. domoticz.devices('Gas').counterToday,domoticz.LOG_DEBUG)
domoticz.log('Gas gisteren sValue ook getal :' .. domoticz.devices('Gas gisteren').sValue,domoticz.LOG_DEBUG)
domoticz.log('Gas gisteren sensorValue :' .. domoticz.devices('Gas gisteren').sensorValue,domoticz.LOG_DEBUG)
domoticz.log('Gas eergisteren sensorValue :' .. domoticz.devices('Gas eergisteren').sensorValue,domoticz.LOG_DEBUG)]]--
if tonumber(domoticz.devices('Power').rawData[5]) > 0 then
colorFlag = "red"
balance = domoticz.devices('Power').rawData[5]
else
colorFlag = "green"
balance = domoticz.devices('Power').rawData[6]
end
--[[domoticz.log('XXXXXXXXXXXXXX Usage RAWDATA [5] :' .. domoticz.devices('Power').rawData[5],domoticz.LOG_DEBUG)
domoticz.log('XXXXXXXXXXXXXX Return RAWDATA [6] :' .. domoticz.devices('Power').rawData[6],domoticz.LOG_DEBUG)
domoticz.log('XXXXXXXXXXXXXX balance :' .. tostring(balance),domoticz.LOG_DEBUG)]]--
-- ,  , and  
domoticz.devices('Energie').updateText('Gas today      ' .. tostring(domoticz.devices('Gas').counterToday) ..
'\n Gas yesterday    ' .. tostring(domoticz.devices('Gas gisteren').sensorValue) ..
'\n Gas the day before  ' .. tostring(domoticz.devices('Gas eergisteren').sensorValue) ..
'\n \n \n      Power used today   <font color="red">' .. tostring(domoticz.devices('Power').counterToday) .. '</font> '..
'\n      Power returned today <font color="green">' .. tostring(domoticz.devices('Power').counterDeliveredToday) ..'</font> '..
'\n      Power balance now  <font color='..colorFlag..'>' .. balance.. '</font>'..
'\n ')
-- domoticz.devices('XC40-ChargeLevel').dump()
-- domoticz.devices('XC40-ChargeLevel').dump()
-- domoticz.devices('Volvo-aangesloten').dump()
-- domoticz.devices('Auto laden').dump()
-- domoticz.devices('Volvo-Opladen').dump()
--[[domoticz.log('Volvo charge level :' .. domoticz.devices('XC40-ChargeLevel').nValue,domoticz.LOG_DEBUG)
domoticz.log('Battery charge set :' .. domoticz.devices('XC40 battery charge set').levelVal,domoticz.LOG_DEBUG)
domoticz.log('Volvo aangesloten :'..domoticz.devices('Volvo-aangesloten').state,domoticz.LOG_DEBUG)
domoticz.log('Car charging switch :'..domoticz.devices('Auto laden').state,domoticz.LOG_DEBUG)
domoticz.log('Car charging state :'..domoticz.devices('Volvo-Opladen').state,domoticz.LOG_DEBUG)]]--
if domoticz.devices('Volvo-aangesloten').state ~= 'Disconnected' then
carConnected = 'Connected'
else
carConnected = 'not Connected'
end
-- laadtijd berekenen
local resttijd90 = (90 - domoticz.devices('XC40-ChargeLevel').state)/3.55
-- resttijd = round(resttijd,2)
uren90, honderdsten90 = math.modf(resttijd90)
minuten90 = honderdsten90*60
minuten90 = math.floor(minuten90+0.5)
domoticz.devices('Volvo').updateText('Volvo charge level set    ' .. tostring(domoticz.devices('XC40 battery charge set').levelVal) ..
'\n Volvo charge level actual  ' .. tostring(domoticz.devices('XC40-ChargeLevel').nValue) ..
'\n Volvo plug connected    ' .. carConnected ..
'\n \n \n      Volvo charging switch state ' .. domoticz.devices('Auto laden').state ..
'\n      Volvo charging state     ' .. domoticz.devices('Volvo-Opladen').state ..'</font> '..
'\n \n   Volvo charging to 90% : '.. tostring(uren90) .. ' hours, ' .. tostring(minuten90) .. ' minutes'..
'\n ')
-- domoticz.devices('Tado Kamer Temp').dump()
-- domoticz.devices('Tado Kamer Setpoint').dump()
-- domoticz.devices('Tado Kamer Heating').dump()
-- domoticz.devices('Buitentemperatuur').dump()
domoticz.log('Tado Kamer Temperature :'..math.floor(domoticz.devices('Tado Kamer Temp').temperature*10)/10,domoticz.LOG_DEBUG)
domoticz.devices('Heating').updateText('Room temperature   ' .. tostring(math.floor(domoticz.devices('Tado Kamer Temp').temperature*10)/10) ..
'\n Room temp. setpoint  ' .. domoticz.devices('Tado Kamer Setpoint').setPoint ..
'\n Room heating       ' .. tostring(math.floor(domoticz.devices('Tado Kamer Heating').percentage)) .. '%'..
'\n \n \n      Kitchen temperature  ' .. tostring(math.floor(domoticz.devices('Tado Keuken Temp').temperature*10)/10) ..
'\n      Kitchen temp. setpoint  ' .. domoticz.devices('Tado Keuken Setpoint').setPoint ..
'\n      Kitchen heating     ' .. tostring(math.floor(domoticz.devices('Tado Keuken Heating').percentage)) .. '%'..
'\n \n \n      Outside temperature  ' .. tostring(math.floor(domoticz.devices('Buitentemperatuur').temperature*10)/10) ..
'\n ')
end
}