I hope to get an answer / solution to my challenge here. I read my energy consumption with a P1 module. That works. I found a script to calculate consumption to Energy costs and it works too. However, I see a line graph in the “log” of Gas costs and I would like a bar graph the same I see with my gas consumption and my power consumption.
I see this in the log of my gas costs:
But I would like to see it like this:
So with bars.
I use this script for it and will therefore have to change something somewhere, so it does shows bars instead of lines.
Who knows the answer or gives me a hint?
Code: Select all
return {
on = { timer = { 'every 15 minutes' }},
execute = function(domoticz, device, timer)
local vandaagKwh = domoticz.devices('Power').counterToday
local vandaagM3Gas = domoticz.devices('Gas').counterToday
local StroomKosten = domoticz.devices('StroomKosten')
local GasKosten = domoticz.devices('GasKosten')
local Kosten = domoticz.devices('TotaalEnergieKosten')
-- Eenheidsprijs in Euro's / Kwh - M3
local kwhPrijs = 0.22903
local gasM3Prijs = 0.74681
if (domoticz.time == 'Between 23:00 and 07:00') or (domoticz.day == 'Saturday') or (domoticz.day == 'Sunday') then
kwhPrijs = 0.21024 -- Daltarief
else
kwhPrijs = 0.22903 -- Normaal tarief
end
-- Vaste kosten in Euro's per dag (zoals vastrecht)
local kwhPrijsVast = 0.70132
local gasM3PrijsVast = 0.54740
-- Kosten berekenen
local kwhKosten = tonumber(domoticz.utils.round( (kwhPrijs * vandaagKwh) + kwhPrijsVast,2))
local GasM3Kosten = tonumber(domoticz.utils.round( (gasM3Prijs * vandaagM3Gas) + gasM3PrijsVast,2))
local Kostentotaal = kwhKosten + GasM3Kosten
-- Kosten updaten
StroomKosten.updateCustomSensor(kwhKosten)
GasKosten.updateCustomSensor(GasM3Kosten)
Kosten.updateCustomSensor(Kostentotaal)
end
}