Essential information, concise overview

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
HvdW
Posts: 615
Joined: Sunday 01 November 2015 22:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Twente
Contact:

Essential information, concise overview

Post by HvdW »

Hi,
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.
dashboard.jpg
dashboard.jpg (75.02 KiB) Viewed 277 times
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 &emsp;&emsp;&emsp;&emsp; Power used today &emsp;&emsp;<font color="red">' .. tostring(domoticz.devices('Power').counterToday) .. '</font> '..
            '\n &emsp;&emsp;&emsp;&emsp; Power returned today &nbsp;<font color="green">' .. tostring(domoticz.devices('Power').counterDeliveredToday) ..'</font> '..
            '\n &emsp;&emsp;&emsp;&emsp; Power balance now &nbsp;&emsp;<font color='..colorFlag..'>' .. balance.. '</font>'..
            '\n &nbsp;')
        -- 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 &nbsp;&ensp;&emsp;&emsp;' .. tostring(domoticz.devices('XC40 battery charge set').levelVal) .. 
            '\n Volvo charge level actual &nbsp;&emsp;' .. tostring(domoticz.devices('XC40-ChargeLevel').nValue) ..
            '\n Volvo plug connected &emsp;&emsp;&emsp;' .. carConnected ..
            '\n \n \n &emsp;&emsp;&emsp;&emsp; Volvo charging switch state&ensp;' .. domoticz.devices('Auto laden').state ..
            '\n &emsp;&emsp;&emsp;&emsp; Volvo charging state &nbsp;&ensp;&emsp;&emsp;&emsp;' .. domoticz.devices('Volvo-Opladen').state ..'</font> '..
            '\n \n &emsp; Volvo charging to 90% : '.. tostring(uren90) .. ' hours, ' .. tostring(minuten90) .. ' minutes'..
            '\n &nbsp;')
        
         -- 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 &emsp;&emsp;' .. tostring(math.floor(domoticz.devices('Tado Kamer Temp').temperature*10)/10) .. 
            '\n Room temp. setpoint &nbsp;&emsp;' .. domoticz.devices('Tado Kamer Setpoint').setPoint ..
            '\n Room heating &ensp;&emsp;&emsp;&emsp;&emsp; ' .. tostring(math.floor(domoticz.devices('Tado Kamer Heating').percentage)) .. '%'..
            '\n \n \n &emsp;&emsp;&emsp;&emsp; Kitchen temperature &nbsp;&emsp;' .. tostring(math.floor(domoticz.devices('Tado Keuken Temp').temperature*10)/10) ..
            '\n &emsp;&emsp;&emsp;&emsp; Kitchen temp. setpoint &ensp;' .. domoticz.devices('Tado Keuken Setpoint').setPoint ..
            '\n &emsp;&emsp;&emsp;&emsp; Kitchen heating &nbsp;&ensp;&emsp;&emsp;&emsp;' .. tostring(math.floor(domoticz.devices('Tado Keuken Heating').percentage)) .. '%'..
            '\n \n \n &emsp;&emsp;&emsp;&emsp; Outside temperature &nbsp;&emsp;' .. tostring(math.floor(domoticz.devices('Buitentemperatuur').temperature*10)/10) ..
            '\n &nbsp;')
end
}
Bugs bug me.
User avatar
RonkA
Posts: 115
Joined: Tuesday 14 June 2022 12:57
Target OS: NAS (Synology & others)
Domoticz version: 2025.1
Location: Harlingen
Contact:

Re: Essential information, concise overview

Post by RonkA »

Same here, this saves enough space to get all the info i want to álmost' fit onto 1 monitor..
Utility.PNG
Utility.PNG (29.28 KiB) Viewed 254 times
Utility 2.PNG
Utility 2.PNG (30.04 KiB) Viewed 254 times
SolarEdge ModbusTCP - Kaku - Synology NAS - Watermeter - ESPEasy - DS18b20
Work in progress = Life in general..
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest