Dashticz stacked view of multiple devices.

Dashticz, alternative dashboard based on HTML, CSS, jQuery

Moderators: leecollings, htilburgs, robgeerts

Post Reply
Wilop91
Posts: 44
Joined: Tuesday 05 March 2024 17:14
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: France
Contact:

Dashticz stacked view of multiple devices.

Post by Wilop91 »

Hello
My script is running fine, so for the time being I will keep it like that.
I can view my 10 devices in Domoticz where I can see the hourly values of the last 7 days, as well as daily values of the last week, the last month and the last year
Now I would like to see all my 10 devices in one single "stacked" view
To do this I followed willemd's suggestion and installed Dashticz.
Here is my current config file

Code: Select all

var config = {}
config['language'] = 'fr_FR'; //or: en_US, de_DE, nl_NL hu_HU, it_IT, pt_PT, sv_SV
config['domoticz_ip'] = 'http://192.168.1.102:8080';
config['app_title'] = 'Dashticz V3';
config['domoticz_refresh'] = '5';
config['dashticz_refresh'] = '60';

//Definition of blocksblocks = {}
blocks[15] = {
  width: 3, unit: ' MWh'
}
blocks[16]= {
  width: 3, unit: ' MWh'
}
blocks[18]= {
  width: 3, unit: ' MWh'
}
blocks[19]= {
  width: 3,   unit: ' MWh'
}
blocks[20]= {
  width: 3,   unit: ' MWh'
}
blocks[21]= {
  width: 3, unit: ' MWh'
}
blocks[22]= {
  width: 3, unit: ' MWh'
}
blocks[23]= {
  width: 3, unit: ' MWh'
}
blocks[25]= {
  width: 3, unit: ' MWh'
}
blocks[26]= {
  width: 3, unit: ' MWh'
}
blocks['ENTSOE_graph'] = {
    devices: [15,16,18,19,20,21,22,23,25,26],
    graph: 'bar',
    stacked: true,
}

//Definition of columns
columns = {}
columns[1] = {
  blocks : [15, 16, 18, 19, 20, 21, 22, 23, 25, 26,'ENTSOE_graph'],
  width: 12
}

//Definition of screens
screens = {}
screens[1] = {
  columns: [1]
}
My current setup shows me "daily" values" of the last month while I would like to display the "hourly values" of the last 7 days as shown in Domoticz, but for all my 10 devices "stacked".

I tried to setup a "custom" view but could not make it work.

Can anyone help me ?

PS: for my devices I'm using a Virtual Device defined as "Managed Counter" and I use the following method to update them:

Code: Select all

domoticz.devices(MyDevice).updateHistory(genDate,sValueStr)
where genDate has the format YYYY-MMM-DD HH:00:00

Willy

EDIT Waltervl: Splitted off from unrelated topic https://www.domoticz.com/forum/viewtopic.php?p=315611
Lokonli
Posts: 2271
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Dashticz stacked view of multiple devices.

Post by Lokonli »

Two examples of stacked bar charts.
THe first one stackes the temperature of two devices.
The second one stackes two datasets of a custom graph.
stackedbardays.jpg
stackedbardays.jpg (104.84 KiB) Viewed 1252 times

Code: Select all

blocks['stacked'] = {
    type: 'graph',
    devices: [708, 1345],
    stacked: true,
    graph: 'bar',
    graphTypes: ['te'],
    groupBy: 'hour',
    aggregate: 'avg'
}

blocks['stackedcustom'] = {
    type: 'graph',
    devices: [43],
    stacked: true,
    graph: 'bar',
    groupBy: 'hour',
    aggregate: 'avg',
    custom: {
        lately: {
            range: 'day',
            filter: '7 days',
            data: {
                in: 'd.v_43',
                out: 'd.v2_43'
            },
        }
    }
}
Wilop91
Posts: 44
Joined: Tuesday 05 March 2024 17:14
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: France
Contact:

Re: Dashticz stacked view of multiple devices.

Post by Wilop91 »

Hello Lokonli
Thanks for your help. I got it working!
Image

I still have a small question: at the top of the graph is written "EUbiomassGen =" which is the name of the first Device in Domoticz.
How can I remove this? Or put some other meaningfull text?
Here is my config.js

Code: Select all

var config = {}
config['language'] = 'fr_FR'; //or: en_US, de_DE, nl_NL hu_HU, it_IT, pt_PT, sv_SV
config['domoticz_ip'] = 'http://192.168.1.102:8080';
config['app_title'] = 'Dashticz V3';
config['domoticz_refresh'] = '5';
config['dashticz_refresh'] = '60';

//Definition of blocksblocks = {}
blocks['15']= {idx: 15, width: 3, unit: ' MWh', title: 'Biomass'}
blocks['16']= {idx: 16, width: 3, unit: ' MWh', title: 'FossilGas'}
blocks['18']= {idx: 18, width: 3, unit: ' MWh', title: 'FossilOil'}
blocks['19']= {idx: 19, width: 3, unit: ' MWh', title: 'HydroPump'}
blocks['20']= {idx: 20, width: 3, unit: ' MWh', title: 'HydroRoR'}
blocks['21']= {idx: 21, width: 3, unit: ' MWh', title: 'HydroBarrage'}
blocks['22']= {idx: 22, width: 3, unit: ' MWh', title: 'Nuclear'}
blocks['23']= {idx: 23, width: 3, unit: ' MWh', title: 'Solar'}
blocks['25']= {idx: 25, width: 3, unit: ' MWh', title: 'WinfOffshore'}
blocks['26']= {idx: 26, width: 3, unit: ' MWh', title: 'WindOnshore'}

blocks['ENTSOE'] = {
   blocks: ['15', '16', '18', '19', '20', '21', '22', '23', '25', '26']
}

blocks['ENTSOE_stacked'] = {
    Title: 'Generation Per Type',
    type: 'graph',
    devices: [15,16,18,20,21,22,23,25,26],
    stacked: true,
    graph: 'bar',
    groupBy: 'hour',
    height: '550px',
    legend: {'Biomass': 'Biomass',
             'FossilGas': 'FossilGas',
             'FossilOil': 'FossilOil',
             'HydroRoR': 'HydroRoR',
             'HydroBarrage': 'HydroBarrage',
             'Nuclear': 'Nuclear',
             'Solar': 'Solar',
             'WindOffshore': 'WinfOffshore',
             'WindOnshore': 'WindOnshore'},
    custom: {
        lately: {
            range: 'day',
            filter: '7 days',
            ylabels: ['MWh'],
            data: {
                Biomass: 'd.v_15',
                FossilGas: 'd.v_16',
                FossilOil: 'd.v_18',
                HydroRoR: 'd.v_20',
                HydroBarrage: 'd.v_21',
                Nuclear: 'd.v_22',
                Solar: 'd.v_23',
                WindOffshore: 'd.v_25',
                WindOnshore: 'd.v_26'
            },
        }
   }
}

//Definition of columns
columns = {}
columns[1] = {
  blocks : ['ENTSOE_stacked'],
  width: 12
}

//Definition of screens
screens = {}
screens[1] = {
  columns: [1]
}
Thanks in advance

Willy
User avatar
HansieNL
Posts: 960
Joined: Monday 28 September 2015 15:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Dashticz stacked view of multiple devices.

Post by HansieNL »

Can you try changing Title to title. So a lower case T.
Blah blah blah
Wilop91
Posts: 44
Joined: Tuesday 05 March 2024 17:14
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: France
Contact:

Re: Dashticz stacked view of multiple devices.

Post by Wilop91 »

Yes that made it work!
Thanks HansieNL
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests