Graphs doesnt show month and year[Fixed]

Dashticz, alternative dashboard based on HTML, CSS, jQuery

Moderators: leecollings, htilburgs, robgeerts

Post Reply
FinalX
Posts: 8
Joined: Tuesday 13 October 2020 10:07
Target OS: Linux
Domoticz version:
Contact:

Graphs doesnt show month and year[Fixed]

Post by FinalX »

hello a question.
for some kind of reason my filters dont work months and years. it does show hours. ive added the screenshots from dashticz and 1 from demoticz
this is my code:

Code: Select all

blocks['StroomVerbruikPlug2'] = {
    title: 'Powerplug 2',
    devices: [232],
    custom : {
        "Dag": {
            range: 'day',
        	graph: ['line'],
            data: {
                verbruik: 'd.u_232',
            }
        },
        "Maand": {
            range: 'month',
        	graph: ['bar'],
            data: {
                verbruik: 'd.u_232',
            }
        },
        "Jaar": {
            range: 'year',
       		graph: ['bar'],
            data: {
                verbruik: 'd.u_232',
            }
        }
    },
    legend: true,
    datasetColors:['yellow']
}
Attachments
2021-02-11_14-26-22.jpg
2021-02-11_14-26-22.jpg (123.54 KiB) Viewed 314 times
2021-02-11_14-23-52.jpg
2021-02-11_14-23-52.jpg (49.1 KiB) Viewed 314 times
2021-02-11_14-24-03.jpg
2021-02-11_14-24-03.jpg (32.16 KiB) Viewed 314 times
Last edited by FinalX on Thursday 11 February 2021 15:09, edited 1 time in total.
Lokonli
Posts: 2291
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Graphs doesnt show month and year

Post by Lokonli »

The 'u' value probably doesn't exist for month and year ranges.

I guess you have to use d.v_232 instead of d.u_232.

when you select the month/year view, and then click on the debug button, you can find which values are reported by Domoticz.
FinalX
Posts: 8
Joined: Tuesday 13 October 2020 10:07
Target OS: Linux
Domoticz version:
Contact:

Re: Graphs doesnt show month and year

Post by FinalX »

this is what it shows in the debug.

Code: Select all

{
  "mountPoint": "#block_43",
  "block": {
    "width": 12,
    "datasetColors": [
      "yellow"
    ],
    "axisRight": false,
    "axisAlternate": true,
    "barWidth": 0.9,
    "beginAtZero": false,
    "borderDash": [],
    "borderWidth": 2,
    "buttonsBorder": "white",
    "buttonsColor": "black",
    "buttonsFill": "white",
    "buttonsIcon": "#686868",
    "buttonsMarginX": 2,
    "buttonsMarginY": 0,
    "buttonsPadX": 6,
    "buttonsPadY": 2,
    "buttonsRadius": 0,
    "buttonsShadow": false,
    "buttonsSize": 14,
    "buttonsText": false,
    "cartesian": "linear",
    "custom": {
      "Dag": {
        "range": "day",
        "graph": [
          "line"
        ],
        "data": {
          "verbruik": "d.u_232"
        }
      },
      "Maand": {
        "range": "month",
        "graph": [
          "bar"
        ],
        "data": {
          "verbruik": "d.v_232"
        }
      },
      "Jaar": {
        "range": "year",
        "graph": [
          "bar"
        ],
        "data": {
          "verbruik": "d.v_232"
        }
      }
    },
    "customHeader": false,
    "debugButton": true,
    "displayFormats": false,
    "drawOrderDay": false,
    "drawOrderLast": false,
    "drawOrderMonth": false,
    "flash": false,
    "fontColor": "white",
    "format": true,
    "gradients": false,
    "graph": "line",
    "graphTypes": false,
    "groupBy": false,
    "groupByDevice": false,
    "height": false,
    "iconColour": "grey",
    "interval": 1,
    "legend": true,
    "lineFill": false,
    "lineTension": 0.1,
    "maxTicksLimit": null,
    "method": 1,
    "pointBorderColor": [
      "grey"
    ],
    "pointBorderWidth": 0,
    "pointRadius": 0,
    "pointStyle": false,
    "range": "initial",
    "refresh": 300,
    "reverseTime": false,
    "sortDevices": false,
    "spanGaps": false,
    "stacked": false,
    "title": "Powerplug 2",
    "tooltiptotal": false,
    "zoom": false,
    "type": "StroomVerbruikPlug2",
    "devices": [
      232
    ],
    "c": 11,
    "key": "StroomVerbruikPlug2"
  },
  "key": "StroomVerbruikPlug2",
  "name": "graph",
  "callbacks": {
    "timeoutList": [],
    "intervalList": [
      195
    ],
    "subscriptionList": [
      null,
      null
    ]
  },
  "$mountPoint": {
    "0": {},
    "length": 1
  },
  "graphDevices": [
    {
      "AddjMulti": 1,
      "AddjMulti2": 1,
      "AddjValue": 0,
      "AddjValue2": 0,
      "BatteryLevel": 100,
      "CustomImage": 0,
      "Data": "2 Watt",
      "Description": "",
      "Favorite": 0,
      "HardwareID": 11,
      "HardwareName": "Dummys",
      "HardwareType": "Dummy (Does nothing, use for virtual switches only)",
      "HardwareTypeVal": 15,
      "HaveTimeout": false,
      "ID": "82232",
      "LastUpdate": "2021-02-11 14:58:06",
      "Name": "Verbruik Powerplug2",
      "Notifications": "false",
      "PlanID": "0",
      "PlanIDs": [
        0
      ],
      "Protected": false,
      "ShowNotifications": true,
      "SignalLevel": 8,
      "SubType": "Electric",
      "Timers": "false",
      "Type": "Usage",
      "TypeImg": "current",
      "Unit": 1,
      "Used": 1,
      "XOffset": "0",
      "YOffset": "0",
      "idx": 232,
      "currentValue": "2,00 Watt",
      "name": "Verbruik Powerplug2",
      "sensor": "counter",
      "subtype": "Electric",
      "title": "Verbruik Powerplug2",
      "txtUnit": "Watt",
      "txtUnits": [],
      "type": "Usage",
      "decimals": 2,
      "method": 1
    }
  ],
  "decimals": 2,
  "graphIdx": "block_43",
  "lastRefreshTime": 1613051850,
  "range": "year",
  "title": "Powerplug 2",
  "params": [
    "type=graph&sensor=counter&idx=232&range=year&method=1"
  ],
  "subtype": "Electric",
  "txtUnits": [
    "Watt"
  ],
  "data": {
    "result": [
      {
        "d": "2021-01-09",
        "u_max_232": 0,
        "u_min_232": 0
      },
      {
        "d": "2021-01-10",
        "u_max_232": 0,
        "u_min_232": 0
      },
      {
        "d": "2021-01-11",
        "u_max_232": 0,
        "u_min_232": 0
      },
      {
        "d": "2021-01-12",
        "u_max_232": 0,
        "u_min_232": 0
      },
      {
        "d": "2021-01-13",
        "u_max_232": 0,
        "u_min_232": 0
      },
      {
        "d": "2021-01-14",
        "u_max_232": 102,
        "u_min_232": 0
      },
      {
        "d": "2021-01-15",
        "u_max_232": 96,
        "u_min_232": 92
      },
      {
        "d": "2021-01-16",
        "u_max_232": 95,
        "u_min_232": 90
      },
      {
        "d": "2021-01-17",
        "u_max_232": 103,
        "u_min_232": 91
      },
      {
        "d": "2021-01-18",
        "u_max_232": 103,
        "u_min_232": 93
      },
      {
        "d": "2021-01-19",
        "u_max_232": 96,
        "u_min_232": 92
      },
      {
        "d": "2021-01-20",
        "u_max_232": 295,
        "u_min_232": 1
      },
      {
        "d": "2021-01-21",
        "u_max_232": 297,
        "u_min_232": 1
      },
      {
        "d": "2021-01-22",
        "u_max_232": 307,
        "u_min_232": 1
      },
      {
        "d": "2021-01-23",
        "u_max_232": 314,
        "u_min_232": 1
      },
      {
        "d": "2021-01-24",
        "u_max_232": 303,
        "u_min_232": 1
      },
      {
        "d": "2021-01-25",
        "u_max_232": 304,
        "u_min_232": 1
      },
      {
        "d": "2021-01-26",
        "u_max_232": 297,
        "u_min_232": 1
      },
      {
        "d": "2021-01-27",
        "u_max_232": 326,
        "u_min_232": 0
      },
      {
        "d": "2021-01-28",
        "u_max_232": 301,
        "u_min_232": 1
      },
      {
        "d": "2021-01-29",
        "u_max_232": 300,
        "u_min_232": 1
      },
      {
        "d": "2021-01-30",
        "u_max_232": 323,
        "u_min_232": 1
      },
      {
        "d": "2021-01-31",
        "u_max_232": 309,
        "u_min_232": 1
      },
      {
        "d": "2021-02-01",
        "u_max_232": 144,
        "u_min_232": 1
      },
      {
        "d": "2021-02-02",
        "u_max_232": 122,
        "u_min_232": 1
      },
      {
        "d": "2021-02-03",
        "u_max_232": 207,
        "u_min_232": 0
      },
      {
        "d": "2021-02-04",
        "u_max_232": 228,
        "u_min_232": 1
      },
      {
        "d": "2021-02-05",
        "u_max_232": 199,
        "u_min_232": 1
      },
      {
        "d": "2021-02-06",
        "u_max_232": 208,
        "u_min_232": 2
      },
      {
        "d": "2021-02-07",
        "u_max_232": 210,
        "u_min_232": 1
      },
      {
        "d": "2021-02-08",
        "u_max_232": 217,
        "u_min_232": 1
      },
      {
        "d": "2021-02-09",
        "u_max_232": 194,
        "u_min_232": 1
      },
      {
        "d": "2021-02-10",
        "u_max_232": 205,
        "u_min_232": 1
      },
      {
        "d": "2021-02-11",
        "u_max_232": 2,
        "u_min_232": 1
      }
    ],
    "status": "OK",
    "title": "Graph day",
    "verbruik": "d.v_232"
  },
  "realrange": "year",
  "dataFilterCount": 0,
  "dataFilterUnit": "",
  "groupBy": false,
  "customRange": true,
  "customRangeName": "Dag",
  "graphConfig": {
    "range": "year",
    "graph": [
      "bar"
    ],
    "data": {
      "verbruik": "d.v_232"
    }
  },
  "keys": [
    "v"
  ],
  "ykeys": [
    "verbruik"
  ],
  "txtUnit": "Watt",
  "ylabels": [
    "Watt"
  ],
  "chartctx": "graphoutput_block_43",
  "graph": [
    "bar"
  ],
  "_width": 639.984,
  "loadingTooltip": false
}
FinalX
Posts: 8
Joined: Tuesday 13 October 2020 10:07
Target OS: Linux
Domoticz version:
Contact:

Re: Graphs doesnt show month and year

Post by FinalX »

looks like its working after changing:

Code: Select all

blocks['StroomVerbruikPlug1'] = {
    title: 'Powerplug 1',
    devices: [228],
    custom : {
        "Dag": {
            range: 'day',
        	graph: ['line'],
            data: {
                verbruik: 'd.u_228',
            }
        },
        "Maand": {
            range: 'month',
        	graph: ['bar'],
            data: {
                verbruik: 'd.u_max_228',
            }
        },
        "Jaar": {
            range: 'year',
       		graph: ['bar'],
            data: {
                verbruik: 'd.u_max_228',
            }
        }
    },
    legend: true,
    datasetColors:['yellow']
}
Lokonli
Posts: 2291
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Graphs doesnt show month and year

Post by Lokonli »

FinalX wrote: Thursday 11 February 2021 15:03 looks like its working after changing:

Code: Select all

blocks['StroomVerbruikPlug1'] = {
    title: 'Powerplug 1',
    devices: [228],
    custom : {
        "Dag": {
            range: 'day',
        	graph: ['line'],
            data: {
                verbruik: 'd.u_228',
            }
        },
        "Maand": {
            range: 'month',
        	graph: ['bar'],
            data: {
                verbruik: 'd.u_max_228',
            }
        },
        "Jaar": {
            range: 'year',
       		graph: ['bar'],
            data: {
                verbruik: 'd.u_max_228',
            }
        }
    },
    legend: true,
    datasetColors:['yellow']
}
Yes, indeed. In the debug window you see that Domoticz reports the u_max and u_min values for month data.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest