Page 2 of 4

Re: Dashticz v3.6 master

Posted: Tuesday 29 September 2020 18:40
by Lokonli
Do you see issues with all your graphs?

Can you post the code from CONFIG.js for a graph with problems?

Sent from my SM-A320FL using Tapatalk


Re: Dashticz v3.6 master

Posted: Tuesday 29 September 2020 20:19
by Remelco
Yes , I have 2 graphs and both have the same problem.
Also the icons are disappeared from nu.nl and nos.nl

my config.js of the graphs:

// Definition 'Elektriciteit' graph
blocks[p1_grafiek_elektra] = {
title: 'Energie',
graph: ['line','bar','bar'],
custom : {
"vandaag": {
range: 'day',
filter: '12 hours',
data: {
netto: 'd.v+d.v2-d.r1-d.r2',
gebruikt: 'd.v+d.v2',
geleverd: '-d.r1-d.r2'
}
},
"maand": {
range: 'month',
filter: '1 months',
data: {
netto: 'd.v+d.v2-d.r1-d.r2',
gebruikt: 'd.v+d.v2',
geleverd: '-d.r1-d.r2'
}
},
"jaar": {
range: 'year',
filter: '12 months',
data: {
netto: 'd.v+d.v2-d.r1-d.r2',
gebruikt: 'd.v+d.v2',
geleverd: '-d.r1-d.r2'
}
}
},
legend: true,
datasetColors:['blue','red','yellow']
}

// Definition 'Gas' graph
blocks[p1_grafiek_gas] = {
title: 'Gas',
width: 12,
height: '425px',
custom : {
"dag": {
graph: 'bar',
range: 'day',
filter: '24 hours',
data: {
Gas: 'd.v'
}
},
"maand": {
graph: 'bar',
range: 'month',
data: {
Gas: 'd.v'
},
},
"jaar": {
graph: 'line',
range: 'year',
data: {
Gas: 'd.v'
}
},
},
legend: false,
datasetColors: ['yellow'],
displayFormats : {
minute: 'h:mm',
hour: 'h:mm',
day: 'DD MMM',
week: 'DD MMM',
month: 'MMM',
}
}

Re: Dashticz v3.6 master

Posted: Tuesday 29 September 2020 20:55
by Lokonli
Remelco wrote: Tuesday 29 September 2020 20:19 Yes , I have 2 graphs and both have the same problem.
Also the icons are disappeared from nu.nl and nos.nl

my config.js of the graphs:
Spoiler: show

Code: Select all

// Definition 'Elektriciteit' graph
blocks[p1_grafiek_elektra] = {
    title: 'Energie',
    graph: ['line','bar','bar'],
    custom : {
        "vandaag": {
            range: 'day',
            filter: '12 hours',
            data: {
                netto: 'd.v+d.v2-d.r1-d.r2',
                gebruikt: 'd.v+d.v2',
                geleverd: '-d.r1-d.r2'
            }
        },
        "maand": {
            range: 'month',
            filter: '1 months',
            data: {
                netto: 'd.v+d.v2-d.r1-d.r2',
                gebruikt: 'd.v+d.v2',
                geleverd: '-d.r1-d.r2'
            }
        },
        "jaar": {
            range: 'year',
            filter: '12 months',
            data: {
                netto: 'd.v+d.v2-d.r1-d.r2',
                gebruikt: 'd.v+d.v2',
                geleverd: '-d.r1-d.r2'
            }
        }
    },
    legend: true,
    datasetColors:['blue','red','yellow']
}

// Definition 'Gas' graph
blocks[p1_grafiek_gas] = {
	title: 'Gas',
  width: 12,
  height: '425px',
  custom : {
  	"dag": {
               graph: 'bar',
  		range: 'day',
                filter: '24 hours',
		  data: {
		  	Gas: 'd.v'
		  }  		  		
  	},
  	"maand": {
               graph: 'bar',
  		range: 'month',
		  data: {
		  	Gas: 'd.v'
		  },		  
  	},
  	"jaar": {
               graph: 'line',
  		range: 'year',
		  data: {
		  	Gas: 'd.v'
		  }  		  		
  	},
  },
  legend: false,
  datasetColors: ['yellow'],
	  displayFormats : {
	  minute: 'h:mm',
	  hour: 'h:mm',
	  day: 'DD MMM',
	  week: 'DD MMM',
	  month: 'MMM',
	}
}
How did you define p1_grafiek_elektra and p1_grafiek_gas?

Re: Dashticz v3.6 master

Posted: Tuesday 29 September 2020 21:14
by Remelco
Is this what you meant?

var p1_elektra_nu = '56_1';
var p1_elektra_vandaag = '56_2';
var p1_elektra_totaal = '56_3';
var p1_grafiek_gas = 'graph_57';
var p1_grafiek_elektra = 'graph_56';

Re: Dashticz v3.6 master

Posted: Tuesday 29 September 2020 21:19
by Jimster
I use an older tablet (Samsung Galaxy Tab 3) for Dashticz, since 3.6 the OWM data isn't visible anymore. I tried an incognito tab, cleared browser data and cookies, restarted, but no luck. On every other devices the data is visible. I guess this is because of the older Android version (4.4.2). I'm tried Chrome and Fully Kiosk Browser. Does this have anything to do with CORS not being supported?

Re: Dashticz v3.6 master

Posted: Tuesday 29 September 2020 22:31
by Lokonli
Remelco wrote: Tuesday 29 September 2020 21:14 Is this what you meant?

var p1_elektra_nu = '56_1';
var p1_elektra_vandaag = '56_2';
var p1_elektra_totaal = '56_3';
var p1_grafiek_gas = 'graph_57';
var p1_grafiek_elektra = 'graph_56';
Yes, thanks.

I cannot completely reproduce your issue, but I've fixed some bugs that might have caused this.

Can you test latest beta? (3.6.2)

Re: Dashticz v3.6 master

Posted: Tuesday 29 September 2020 22:40
by Lokonli
Remelco wrote: Tuesday 29 September 2020 20:19 Yes , I have 2 graphs and both have the same problem.
Also the icons are disappeared from nu.nl and nos.nl
For the missing icons: which icons do you mean exactly? Can you attach a screenshot?

If you use an icon from fontawesome check whether the icon still exists (fontawesome.com).

Sometimes you have to completely refresh the cache.

Re: Dashticz v3.6 master

Posted: Tuesday 29 September 2020 22:48
by Lokonli
Jimster wrote: Tuesday 29 September 2020 21:19 I use an older tablet (Samsung Galaxy Tab 3) for Dashticz, since 3.6 the OWM data isn't visible anymore. I tried an incognito tab, cleared browser data and cookies, restarted, but no luck. On every other devices the data is visible. I guess this is because of the older Android version (4.4.2). I'm tried Chrome and Fully Kiosk Browser. Does this have anything to do with CORS not being supported?
Yes, could be.

As a small test, can you try the following:

In the file ./js/weather_owm.js, line 63, remove the first two slashes.

So change:

Code: Select all

//    _CORS_PATH +
into

Code: Select all

    _CORS_PATH +

Re: Dashticz v3.6 master

Posted: Tuesday 29 September 2020 23:25
by Jimster
Lokonli wrote: Tuesday 29 September 2020 22:48
Jimster wrote: Tuesday 29 September 2020 21:19 I use an older tablet (Samsung Galaxy Tab 3) for Dashticz, since 3.6 the OWM data isn't visible anymore. I tried an incognito tab, cleared browser data and cookies, restarted, but no luck. On every other devices the data is visible. I guess this is because of the older Android version (4.4.2). I'm tried Chrome and Fully Kiosk Browser. Does this have anything to do with CORS not being supported?
Yes, could be.

As a small test, can you try the following:

In the file ./js/weather_owm.js, line 63, remove the first two slashes.

So change:

Code: Select all

//    _CORS_PATH +
into

Code: Select all

    _CORS_PATH +
Yes, it works now.

Re: Dashticz v3.6 master

Posted: Wednesday 30 September 2020 13:52
by Lokonli
Jimster wrote: Tuesday 29 September 2020 23:25
Lokonli wrote: Tuesday 29 September 2020 22:48
Jimster wrote: Tuesday 29 September 2020 21:19 I use an older tablet (Samsung Galaxy Tab 3) for Dashticz, since 3.6 the OWM data isn't visible anymore. I tried an incognito tab, cleared browser data and cookies, restarted, but no luck. On every other devices the data is visible. I guess this is because of the older Android version (4.4.2). I'm tried Chrome and Fully Kiosk Browser. Does this have anything to do with CORS not being supported?
Yes, could be.

As a small test, can you try the following:

In the file ./js/weather_owm.js, line 63, remove the first two slashes.

So change:

Code: Select all

//    _CORS_PATH +
into

Code: Select all

    _CORS_PATH +
Yes, it works now.
hmm, interesting.
I have to check why it doesn't work on Android 4.4.2 without CORS proxy.

Re: Dashticz v3.6 master

Posted: Wednesday 30 September 2020 14:28
by Lokonli
Jimster wrote: Tuesday 29 September 2020 23:25
Lokonli wrote: Tuesday 29 September 2020 22:48
Jimster wrote: Tuesday 29 September 2020 21:19 I use an older tablet (Samsung Galaxy Tab 3) for Dashticz, since 3.6 the OWM data isn't visible anymore. I tried an incognito tab, cleared browser data and cookies, restarted, but no luck. On every other devices the data is visible. I guess this is because of the older Android version (4.4.2). I'm tried Chrome and Fully Kiosk Browser. Does this have anything to do with CORS not being supported?
Yes, could be.

As a small test, can you try the following:

In the file ./js/weather_owm.js, line 63, remove the first two slashes.

So change:

Code: Select all

//    _CORS_PATH +
into

Code: Select all

    _CORS_PATH +
Yes, it works now.
I've slightly changed the request to OpenWeatherMap, which might solve the CORS issue on Android 4.4.2.

Can you help with testing? I don't have an android 4.4.2 device.

The new new file can be downloaded from:
https://raw.githubusercontent.com/Dasht ... her_owm.js

or:
switch to the git branch 'testowm'

Re: Dashticz v3.6 master

Posted: Wednesday 30 September 2020 16:34
by Jimster
Lokonli wrote: Wednesday 30 September 2020 14:28
Jimster wrote: Tuesday 29 September 2020 23:25
Lokonli wrote: Tuesday 29 September 2020 22:48

Yes, could be.

As a small test, can you try the following:

In the file ./js/weather_owm.js, line 63, remove the first two slashes.

So change:

Code: Select all

//    _CORS_PATH +
into

Code: Select all

    _CORS_PATH +
Yes, it works now.
I've slightly changed the request to OpenWeatherMap, which might solve the CORS issue on Android 4.4.2.

Can you help with testing? I don't have an android 4.4.2 device.

The new new file can be downloaded from:
https://raw.githubusercontent.com/Dasht ... her_owm.js

or:
switch to the git branch 'testowm'
I did git checkout testown
Tested it, but unfortunately it doesn't work.

Re: Dashticz v3.6 master

Posted: Wednesday 30 September 2020 19:21
by Lokonli
ok, thanks for testing.
I'll add an additional config setting ...

Re: Dashticz v3.6 master

Posted: Wednesday 30 September 2020 20:48
by Lokonli
Jimster wrote: Wednesday 30 September 2020 16:34
Lokonli wrote: Wednesday 30 September 2020 14:28
Jimster wrote: Tuesday 29 September 2020 23:25
Yes, it works now.
I've slightly changed the request to OpenWeatherMap, which might solve the CORS issue on Android 4.4.2.

Can you help with testing? I don't have an android 4.4.2 device.

The new new file can be downloaded from:
https://raw.githubusercontent.com/Dasht ... her_owm.js

or:
switch to the git branch 'testowm'
I did git checkout testown
Tested it, but unfortunately it doesn't work.
I've created a new beta.
Add the following to CONFIG.js to enable the CORS proxy for OWM:

Code: Select all

config['use_cors'] = 1;
Can you test the latest beta?

Re: Dashticz v3.6 master

Posted: Wednesday 30 September 2020 21:22
by Remelco
Lokonli wrote: Tuesday 29 September 2020 22:31
Remelco wrote: Tuesday 29 September 2020 21:14 Is this what you meant?

var p1_elektra_nu = '56_1';
var p1_elektra_vandaag = '56_2';
var p1_elektra_totaal = '56_3';
var p1_grafiek_gas = 'graph_57';
var p1_grafiek_elektra = 'graph_56';
Yes, thanks.

I cannot completely reproduce your issue, but I've fixed some bugs that might have caused this.

Can you test latest beta? (3.6.2)
I have tested the latest beta date 30-9-2020 but stil no graph.
The icons are nu.nl.png and nos.png

Re: Dashticz v3.6 master

Posted: Wednesday 30 September 2020 22:12
by Lokonli
Remelco wrote: Wednesday 30 September 2020 21:22
Lokonli wrote: Tuesday 29 September 2020 22:31
Remelco wrote: Tuesday 29 September 2020 21:14 Is this what you meant?

var p1_elektra_nu = '56_1';
var p1_elektra_vandaag = '56_2';
var p1_elektra_totaal = '56_3';
var p1_grafiek_gas = 'graph_57';
var p1_grafiek_elektra = 'graph_56';
Yes, thanks.

I cannot completely reproduce your issue, but I've fixed some bugs that might have caused this.

Can you test latest beta? (3.6.2)
I have tested the latest beta date 30-9-2020 but stil no graph.
The icons are nu.nl.png and nos.png
hmm, annoying.

Can you open DevTools in Chrome by pressing F12. Then refresh Dashticz. Do you see any error in the DevTools console tab?
or failed network requests on the DevTools network tab?

Re: Dashticz v3.6 master

Posted: Wednesday 30 September 2020 22:23
by Jimster
Lokonli wrote: Wednesday 30 September 2020 20:48
I've created a new beta.
Add the following to CONFIG.js to enable the CORS proxy for OWM:

Code: Select all

config['use_cors'] = 1;
Can you test the latest beta?
Yes with the latest beta and adding this line it works now. Thanks!

Re: Dashticz v3.6 master

Posted: Wednesday 30 September 2020 22:41
by Lokonli
Remelco wrote: Wednesday 30 September 2020 21:22
Lokonli wrote: Tuesday 29 September 2020 22:31
Remelco wrote: Tuesday 29 September 2020 21:14 Is this what you meant?

var p1_elektra_nu = '56_1';
var p1_elektra_vandaag = '56_2';
var p1_elektra_totaal = '56_3';
var p1_grafiek_gas = 'graph_57';
var p1_grafiek_elektra = 'graph_56';
Yes, thanks.

I cannot completely reproduce your issue, but I've fixed some bugs that might have caused this.

Can you test latest beta? (3.6.2)
I have tested the latest beta date 30-9-2020 but stil no graph.
The icons are nu.nl.png and nos.png
Found it. Totally forgot the following:

The graph now support 'multidevices'

However, that means in the custom graph you have to add the device id to the value, as follows:

Code: Select all

blocks[p1_grafiek_gas] = {
    title: 'Gas',
    width: 12,
    height: '425px',
    custom : {
    "dag": {
    graph: 'bar',
    range: 'day',
    filter: '24 hours',
    data: {
    Gas: 'd.v_57'			//_57 added
    }
    },
    "maand": {
    graph: 'bar',
    range: 'month',
    data: {
    Gas: 'd.v_57'			//_57 added
    },
    },
    "jaar": {
    graph: 'line',
    range: 'year',
    data: {
    Gas: 'd.v_57'			//_57 added
    }
    },
    },
    legend: false,
    datasetColors: ['yellow'],
    displayFormats : {
    minute: 'h:mm',
    hour: 'h:mm',
    day: 'DD MMM',
    week: 'DD MMM',
    month: 'MMM',
    }
    }

That should do it ...

Re: Dashticz v3.6 master

Posted: Thursday 01 October 2020 18:31
by Remelco
Lokonli wrote: Wednesday 30 September 2020 22:41
Remelco wrote: Wednesday 30 September 2020 21:22
Lokonli wrote: Tuesday 29 September 2020 22:31

Yes, thanks.

I cannot completely reproduce your issue, but I've fixed some bugs that might have caused this.

Can you test latest beta? (3.6.2)
I have tested the latest beta date 30-9-2020 but stil no graph.
The icons are nu.nl.png and nos.png
Found it. Totally forgot the following:

The graph now support 'multidevices'

However, that means in the custom graph you have to add the device id to the value, as follows:

Code: Select all

blocks[p1_grafiek_gas] = {
    title: 'Gas',
    width: 12,
    height: '425px',
    custom : {
    "dag": {
    graph: 'bar',
    range: 'day',
    filter: '24 hours',
    data: {
    Gas: 'd.v_57'			//_57 added
    }
    },
    "maand": {
    graph: 'bar',
    range: 'month',
    data: {
    Gas: 'd.v_57'			//_57 added
    },
    },
    "jaar": {
    graph: 'line',
    range: 'year',
    data: {
    Gas: 'd.v_57'			//_57 added
    }
    },
    },
    legend: false,
    datasetColors: ['yellow'],
    displayFormats : {
    minute: 'h:mm',
    hour: 'h:mm',
    day: 'DD MMM',
    week: 'DD MMM',
    month: 'MMM',
    }
    }

That should do it ...
For the gas the graph is is working.
I am only struggling with the elecric graph. Where can I add the d.v. to d.v._56.

This is not working:
data: {
netto: 'd.v_56+d.v2-d.r1-d.r2',
gebruikt: 'd.v_56+d.v2',
geleverd: '-d.r1-d.r2'

Re: Dashticz v3.6 master

Posted: Thursday 01 October 2020 18:34
by Lokonli
try:

Code: Select all

data: {
netto: 'd.v_56+d.v2_56-d.r1_56-d.r2_56',
gebruikt: 'd.v_56+d.v2_56',
geleverd: '-d.r1_56-d.r2_56'