Page 2 of 2

Re: Bar chart in dashticz - block definition

Posted: Sunday 31 March 2024 20:58
by willemd
your jpg's are not visible for me

Re: Bar chart in dashticz - block definition

Posted: Monday 01 April 2024 0:23
by Daro1003
How can I make them visible?
After logging out, I see jpg

I want:
1. Daily consumption chart from 00:00 to 23:59
2. Month graph - showed consumption every day of the month
3. The year graph showed the consumption in each month to see how much energy was used in each month

Re: Bar chart in dashticz - block definition

Posted: Monday 01 April 2024 10:37
by Daro1003
One month - very good indications:

Code: Select all

blocks['Month'] = {
    title: 'Całkowita Dziś',
	height: '300px',
    devices: [770],
    graph: ['bar'],
    custom : {
        "Month": {
            range: 'month',
            filter: '1 month',
			 data: {
				 nett: 'd.v_770'
                
            }
        }
    },
    legend: {nett: 'KWh'},
    datasetColors:['blue','red','yellow']
}
Year - wrong readings - wrong energy readings:

Code: Select all

blocks['wykres3'] = {
    title: 'Year',
	height: '300px',
    devices: [770],
    graph: ['bar'],
    custom : {
        "Rok": {
            range: 'year',
			groupBy: 'month',
            filter: '12 months',
			 data: {
				 nett: 'd.v_770',              
            }
        }
    },
    legend: {nett: 'KWh'},
    datasetColors:['blue','red','yellow']
}

Re: Bar chart in dashticz - block definition

Posted: Monday 01 April 2024 11:07
by Lokonli
Hint:
March has 31 days.
31 * 17.09 = 529.79

https://dashticz.readthedocs.io/en/beta ... ml#groupby


Verzonden vanaf mijn iPhone met Tapatalk

Re: Bar chart in dashticz - block definition

Posted: Monday 01 April 2024 11:48
by Daro1003
Unfortunately, I still don't understand how to set the chart for a year to show everything in 1 month.

Re: Bar chart in dashticz - block definition

Posted: Monday 01 April 2024 12:29
by willemd
You mean that Domoticz shows a total value for the month while Dashticz shows a daily average for the month?
Try setting the aggregate to "sum" (see manual). Possibly the standard is "avg".

Re: Bar chart in dashticz - block definition

Posted: Monday 01 April 2024 14:12
by Daro1003
This is how Domoticz shows the value - month
The Dahstick shows the average and I want it to show all the energy in a month.
I have the energy consumed every day in a chart - a month, so there is no need for energy in the average value.

Which setting exactly is responsible for this?

Re: Bar chart in dashticz - block definition

Posted: Monday 01 April 2024 17:20
by Lokonli
Try adding:

Code: Select all

aggregate: 'sum',

Re: Bar chart in dashticz - block definition

Posted: Monday 01 April 2024 19:34
by Daro1003
Cannon is missing [ ] :

Code: Select all

aggregate: ['sum'], 

Code: Select all

}
blocks['wykres3'] = {
    title: 'Całkowita Dziś',
	height: '300px',
    devices: [770],
    graph: ['bar'],
    aggregate: ['sum'], 
    custom : {
        "Rok": {
            range: 'year',
			groupBy: 'month',
            filter: '12 months',
			 data: {
				 nett: 'd.v_770',            
            }
        }
    },
    legend: {nett: 'KWh'},
    datasetColors:['blue','red','yellow']

Re: Bar chart in dashticz - block definition

Posted: Tuesday 02 April 2024 20:54
by Lokonli
With this change it's working?

Re: Bar chart in dashticz - block definition

Posted: Wednesday 03 April 2024 16:43
by Daro1003
This is how it works thanks to this change. It shows bars showing the total monthly energy consumption.

Now I will want to add a chart to show the energies today.
In previous attempts, the chart showed 24 hours, but at different times I would like the chart to be from 00:00 to 23:59.

Re: Bar chart in dashticz - block definition

Posted: Wednesday 03 April 2024 16:58
by Lokonli
You can use

Code: Select all

  range: 'today'
and remove groupBy and filter.

Re: Bar chart in dashticz - block definition

Posted: Saturday 06 April 2024 21:48
by Daro1003
The chart is almost as I wanted - but
1. Today - shows from 00:00 to 23:59
2. Month - shows the whole month the total energy each day. - Shows the last 30 days, I don't know how to make it show the current month of April.
3. The year shows the total energy in each month

Code: Select all

 blocks['wykresG'] = {
    title: 'My Power',
	height: '300px',
    devices: [770],
    graph: ['bar'],
	aggregate: ['sum'],
    custom : {
        "Dziś": {
            range: 'day',
            filter: 'today',
            data: {
                nett: 'd.v_770'
            }
        },
        "Miesiąc": {
            range: 'month',
            filter: '1 month',
            data: {
                nett: 'd.v_770'
            }
        },
        "Rok": {
            range: 'year',
			groupBy: 'month',
            filter: '12 months',
            data: {
                nett: 'd.v_770'
            }
        }
    },
    legend: true,
    datasetColors:['blue','red','yellow'],