Bar chart in dashticz - block definition

Client tools or tools that can connect with Domoticz. Tools for Windows, iOS, Android, Linux etc.

Moderator: leecollings

willemd
Posts: 649
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

Re: Bar chart in dashticz - block definition

Post by willemd »

your jpg's are not visible for me
Daro1003
Posts: 192
Joined: Monday 14 November 2022 12:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Poland
Contact:

Re: Bar chart in dashticz - block definition

Post 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
Daro1003
Posts: 192
Joined: Monday 14 November 2022 12:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Poland
Contact:

Re: Bar chart in dashticz - block definition

Post 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']
}
Attachments
DomoticzKWHYEAR.jpg
DomoticzKWHYEAR.jpg (45.01 KiB) Viewed 1581 times
DashticzYear.jpg
DashticzYear.jpg (68.64 KiB) Viewed 1581 times
Lokonli
Posts: 2290
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Bar chart in dashticz - block definition

Post 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
Daro1003
Posts: 192
Joined: Monday 14 November 2022 12:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Poland
Contact:

Re: Bar chart in dashticz - block definition

Post by Daro1003 »

Unfortunately, I still don't understand how to set the chart for a year to show everything in 1 month.
willemd
Posts: 649
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

Re: Bar chart in dashticz - block definition

Post 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".
Daro1003
Posts: 192
Joined: Monday 14 November 2022 12:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Poland
Contact:

Re: Bar chart in dashticz - block definition

Post 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?
Lokonli
Posts: 2290
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Bar chart in dashticz - block definition

Post by Lokonli »

Try adding:

Code: Select all

aggregate: 'sum',
Last edited by Lokonli on Tuesday 02 April 2024 20:54, edited 1 time in total.
Daro1003
Posts: 192
Joined: Monday 14 November 2022 12:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Poland
Contact:

Re: Bar chart in dashticz - block definition

Post 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']
Lokonli
Posts: 2290
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Bar chart in dashticz - block definition

Post by Lokonli »

With this change it's working?
Daro1003
Posts: 192
Joined: Monday 14 November 2022 12:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Poland
Contact:

Re: Bar chart in dashticz - block definition

Post 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.
Lokonli
Posts: 2290
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Bar chart in dashticz - block definition

Post by Lokonli »

You can use

Code: Select all

  range: 'today'
and remove groupBy and filter.
Daro1003
Posts: 192
Joined: Monday 14 November 2022 12:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Poland
Contact:

Re: Bar chart in dashticz - block definition

Post 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'],
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest