Calendar not showing

Dashticz, alternative dashboard based on HTML, CSS, jQuery

Moderators: leecollings, htilburgs, robgeerts

Post Reply
Michael87
Posts: 7
Joined: Monday 11 January 2021 10:26
Target OS: -
Domoticz version:
Contact:

Calendar not showing

Post by Michael87 »

Hi guys,

So I spend all weekend trying to get Dashticz configured the way I like. All works just fine except for the calendar function. I really tried everything, used the search button on this forum and could not find anything that works. Really hope someone can help, I'm stuck! Code snips of my Config.js:

Code: Select all

var config = {}
config['language'] = 'nl_NL'; 
config['domoticz_ip'] = 'http://10.0.0.187:8585';
config['domoticz_refresh'] = '5';
config['dashticz_refresh'] = '60';
config['enable_websocket'] = 'true';
config['timeformat'] = 'DD-MM-YY HH:mm';
config['hide_topbar'] = 0;
config['hide_seconds'] = 1;
config['app_title'] = 'ControlCenter';
config['gm_api'] = 'XXXXXXXXXXXXXXXXX';
config['gm_zoomlevel'] = '8';
config['gm_latitude'] = 'XX.XXXXXX';
config['gm_longitude'] = 'X.XXXXXX';
config['use_beaufort'] = 1;
config['translate_windspeed'] = 1;
config['static_weathericons'] = 1;
config['selector_instead_of_buttons'] = 1;
config['calendarlanguage'] = 'nl';

var calendars = {}
calendars.school = { maxitems: 5, url: 'https://calendar.google.com/calendar/embed?src=XXXXXXXXXXXXXXXXXXXXXXXgroup.calendar.google.com&ctz=Europe%2FAmsterdam', icalurl: 'https://calendar.google.com/calendar/ical/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXgroup.calendar.google.com/private-XXXXXXXXXXXXXXXXXXXXXXXXXX/basic.ics' }

var columns = {}
columns['bar'] = {}
columns['bar']['blocks'] = ['logo','miniclock','settings']

columns[1] = {}
columns[1]['blocks'] = [calendars.school]
columns[1]['width'] = 2;

var columns_standby = {}
columns_standby[1] = {}
columns_standby[1]['blocks'] = ['clock']
columns_standby[1]['width'] = 12;

var screens = {}
screens[1] = {}
screens[1]['background'] = 'bg2.jpg';
screens[1]['columns'] = [1,2,3,4]

screens[2] = {}
screens[2]['background'] = 'bg2.jpg';
screens[2]['columns'] = [5,6,7,8]
In the dashboard I see a calendar block, it says 'laden' / 'loading' but nothing shows! Clicking the block will open the calendar straight away. What am I doing wrong?

Running
Dashticz V3.7.2 beta
Domoticz version 2020.2
dzVents version 3.0.2
PHP version 8.0.0
Michael87
Posts: 7
Joined: Monday 11 January 2021 10:26
Target OS: -
Domoticz version:
Contact:

Re: Calendar not showing

Post by Michael87 »

Dug a little further last night, found an error in console:

Code: Select all

VM2655:116 Error in response from calendar with icalurl ./vendor/dashticz/ical/index.php?time=1610444906588&maxitems=5&url=https://calendar.google.com/calendar/ical/5gipqhlg6spdvabprtkk%40group.calendar.google.com/private-0dbd20…/basic.ics
Figured it had something to do with the timezones / language settings of the calendar so I took a look at the ics file:

Code: Select all

BEGIN:VCALENDAR
PRODID:-//Google Inc//Google Calendar 70.9054//EN
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:PUBLISH
X-WR-CALNAME:Basisschool de Veste
X-WR-TIMEZONE:Europe/Amsterdam
BEGIN:VTIMEZONE
TZID:Europe/Amsterdam
X-LIC-LOCATION:Europe/Amsterdam
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
TZNAME:CEST
DTSTART:19700329T020000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
TZNAME:CET
Added 'Europe/Amsterdam' => 'Europe/Berlin', to my WindowsTimezones.php. Unfortunately without result. Help would be much appreciated!

(btw, weird thing. My garbage block is working just fine?)
Lokonli
Posts: 2291
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Calendar not showing

Post by Lokonli »

What is the result if you open the url in a browser:

Code: Select all

http://dashticz ip:port/vendor/dashticz/ical/index.php?time=1610444906588&maxitems=5&url=https://calendar.google.com/calendar/ical/…/basic.ics
(fill in your dashticz ip and calendar url)

Can you add '&method=0' and try again, so like:

Code: Select all

http://dashticz ip:port/vendor/dashticz/ical/index.php?time=1610444906588&maxitems=5&url=https://calendar.google.com/calendar/ical/…/basic.ics&method=0
Michael87
Posts: 7
Joined: Monday 11 January 2021 10:26
Target OS: -
Domoticz version:
Contact:

Re: Calendar not showing

Post by Michael87 »

Thanks for replying! I tried both; the first one results in:

Code: Select all

<br />
<b>Warning</b>:  Undefined array key "history" in <b>/var/www/html/vendor/dashticz/ical/index.php</b> on line <b>37</b><br />
<br />
<b>Warning</b>:  Undefined array key "method" in <b>/var/www/html/vendor/dashticz/ical/index.php</b> on line <b>39</b><br />
<br />
<b>Fatal error</b>:  Array and string offset access syntax with curly braces is no longer supported in <b>/var/www/html/vendor/dashticz/ical/ical5/helpers/SG_iCal_Duration.php</b> on line <b>44</b><br />
The second url results in:

Code: Select all

<br />
<b>Warning</b>:  Undefined array key "history" in <b>/var/www/html/vendor/dashticz/ical/index.php</b> on line <b>37</b><br />
<br />
<b>Fatal error</b>:  Array and string offset access syntax with curly braces is no longer supported in <b>/var/www/html/vendor/dashticz/ical/ical5/helpers/SG_iCal_Duration.php</b> on line <b>44</b><br />
Lokonli
Posts: 2291
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Calendar not showing

Post by Lokonli »

Can you try the new calendar block by adding 'type: 'calendar' to block definition?

Then a more modern PHP calendar library is used.

The old calendar block uses the old library, which seems to be not supported in PHP8 as used by you.
Michael87
Posts: 7
Joined: Monday 11 January 2021 10:26
Target OS: -
Domoticz version:
Contact:

Re: Calendar not showing

Post by Michael87 »

I tried the following; unfortunately with only the title and icon as a result. Suggestions to improve?

Code: Select all

blocks['calendar.school'] = {
    url: 'https://calendar.google.com/calendar/embed?src=5gipqk%40group.calendar.google.com&ctz=Europe%2FAmsterdam',
    icalurl: 'https://calendar.google.com/calendar/ical/5gipqk%40group.calendar.google.com/private-0db7d20e50e6ca9/basic.ics',
    maxitems: 5,
    type: 'calendar',
    title: 'Basisschool',
}
Lokonli
Posts: 2291
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Calendar not showing

Post by Lokonli »

ok, then we do more or less the same experiment.

Can you open DevTools (F12), refresh Dashticz.
On the network tab filter for 'ical'. Right click on the network request -> Copy -> Copy link address.

Paste the link address in a new browser window.
Can you post the output?

Maybe your PHP version is too new, or some agenda items are not handled correctly, or something else ...
Michael87
Posts: 7
Joined: Monday 11 January 2021 10:26
Target OS: -
Domoticz version:
Contact:

Re: Calendar not showing

Post by Michael87 »

It looks like the data is beeing imported nicely, however in the dashboard I see nothing.

Code: Select all

<br />
<b>Deprecated</b>:  usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in <b>/var/www/html/vendor/dashticz/ical/vendor/om/icalparser/src/IcalParser.php</b> on line <b>383</b><br />
{"1610406000":{"id":1,"title":"Vergadering OR","desc":"","location":"","start":1610406000,"end":1610492400,"allDay":true},"1610546400":{"id":2,"title":"est","desc":"","location":"","start":1610546400,"end":1610550900,"allDay":false},"1610617500":{"id":3,"title":"dadfas","desc":"","location":"","start":1610617500,"end":1610621100,"allDay":false},"1611097200":{"id":4,"title":"Begin nationale voorleesdagen (t\/m 30 januari)","desc":"","location":"","start":1611097200,"end":1611183600,"allDay":true}}
Lokonli
Posts: 2291
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Calendar not showing

Post by Lokonli »

You see the PHP script generates a warning. Dashticz expects json format, and can't handle the html tags.

It's caused by PHP8. I'll check whether there is an updated PHP ical library. I'll supress the warnings as well.
Michael87
Posts: 7
Joined: Monday 11 January 2021 10:26
Target OS: -
Domoticz version:
Contact:

Re: Calendar not showing

Post by Michael87 »

Thanks a lot Lokonli!
Lokonli
Posts: 2291
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Calendar not showing

Post by Lokonli »

Can you test latest beta? I've integrated the updated ical library.
I don't have a PHP8 system, so I did not test myself on PHP8.
PHP7 seems to work fine.
Michael87
Posts: 7
Joined: Monday 11 January 2021 10:26
Target OS: -
Domoticz version:
Contact:

Re: Calendar not showing

Post by Michael87 »

Checked and works like a charm! Thanks you very much Lokonli.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest