Dashticz - Module - Calendar

Dashticz, alternative dashboard based on HTML, CSS, jQuery

Moderators: leecollings, htilburgs, robgeerts

Post Reply
robgeerts
Posts: 1273
Joined: Saturday 24 January 2015 22:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: NL
Contact:

Dashticz - Module - Calendar

Post by robgeerts »

You can add a block with upcoming events from your ical-calendar (gmail, apple etc.).
Define them as:

Code: Select all

var calendars = {}
calendars.business = { maxitems: 5, url: 'https://calendar.google.com/calendar/', icalurl: 'https://calendar.google.com/calendar/' }
calendars.private = { maxitems: 5, icalurl: 'https://cors-anywhere.herokuapp.com/https://calendar.google.com/calendar/' }
And define them in a column like:

Code: Select all

columns[1] = {}
columns[1]['width'] = 2;
columns[1]['blocks'] = [calendars.business,calendars.private]
If you want to combine multiple calendars, add this code:

Code: Select all

calendars.combined = {}
calendars.combined.maxitems = 5;
calendars.combined.calendars = [
	{ color:'white',calendar:calendars.business }, 
	{ color:'#ccc',calendar:calendars.private }
]
calendars.combined.url = 'https://calendar.google.com/calendar';
And define them in a column like:

Code: Select all

columns[1] = {}
columns[1]['width'] = 2;
columns[1]['blocks'] = [calendars.combined]
If calendars wont load, add https://cors-anywhere.herokuapp.com/ in front of the url.
For example:

Code: Select all

calendars.private = { maxitems:5, icalurl: 'https://cors-anywhere.herokuapp.com/https://calendar.google.com/calendar/' }
Last edited by robgeerts on Friday 05 May 2017 13:24, edited 1 time in total.
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Dashticz - Module - Calendar

Post by EdwinK »

Mmm. I thought I had it..

Code: Select all

Missing required request header. Must specify one of: origin,x-requested-with

Code: Select all

ar calendars = {}
calendars.business = { url: 'https://cors-anywhere.herokuapp.com/https://calendar.google.com/calendar/', icalurl: 'https://cors-anywhere.herokuapp.com/<<Google kalender URL.basic.ics' }
calendars.private = { icalurl: 'https://cors-anywhere.herokuapp.com/Google kalender URL.basic.ics/' }

calendars.combined = {}
calendars.combined.calendars = [
   { color:'white',calendar:calendars.business }, 
   { color:'#ccc',calendar:calendars.private }
]
calendars.combined.url = ' https://cors-anywhere.herokuapp.com/https://calendar.google.com/calendar';
Edit. I now have removed the cors-anywhere link and then I get the following in the console:

Code: Select all

Request Headers
Provisional headers are shown
Referer:http://192.168.0.10/dashboard/
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.96 Safari/537.36
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Dashticz - Module - Calendar

Post by EdwinK »

Or this might be a problem too:

Code: Select all

Refused to display 'https://calendar.google.com/calendar/render' in a frame because it set 'X-Frame-Options' to 'sameorigin'.
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
poudenes
Posts: 667
Joined: Wednesday 08 March 2017 9:42
Target OS: Linux
Domoticz version: 3.8993
Location: Amsterdam
Contact:

Re: Dashticz - Module - Calendar

Post by poudenes »

Is there any solution how to shown calendars that repeating? I have lots of calendar items that is repeating every 3 weeks. Somedays more then 2 on a day.

I only see the 1 time calendar items ...
RPi3 B+, Debain Stretch, Domoticz, Homebridge, Dashticz, RFLink, Milight, Z-Wave, Fibaro, Nanoleaf, Nest, Harmony Hub, Now try to understand pass2php
bsmeding
Posts: 34
Joined: Tuesday 28 October 2014 18:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Dashticz - Module - Calendar

Post by bsmeding »

Yes me too, now whole day or repeating items.
Also still a problem with the timezone, everything is +2 hour, is there a possibility to change the timezone

I'm using iCloud calendar
robgeerts
Posts: 1273
Joined: Saturday 24 January 2015 22:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: NL
Contact:

Re: Dashticz - Module - Calendar

Post by robgeerts »

Timezone and repeating will be fixed in upcoming version.
robgeerts
Posts: 1273
Joined: Saturday 24 January 2015 22:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: NL
Contact:

Re: Dashticz - Module - Calendar

Post by robgeerts »

bsmeding wrote:Yes me too, now whole day or repeating items.
Also still a problem with the timezone, everything is +2 hour, is there a possibility to change the timezone

I'm using iCloud calendar
Could you try latest BETA?
I'm not sure but I changed one thing that may fix it...
qwerk
Posts: 222
Joined: Tuesday 22 July 2014 7:21
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Netherlands
Contact:

Re: Dashticz - Module - Calendar

Post by qwerk »

I am sorry to say, it does not look fixed.
no repeat en two ours off.

an ICS taking from my own mailserver ( kopano) gives the correct time. but also no repeats.
robgeerts
Posts: 1273
Joined: Saturday 24 January 2015 22:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: NL
Contact:

Re: Dashticz - Module - Calendar

Post by robgeerts »

Didnt check the repeating events yet ;)
ARRGGGHHH I hate the time offset.
In my calendar, all events were ok, but one. One had a time offset of 2 hours..
(Created on another device..)
User avatar
htilburgs
Posts: 464
Joined: Tuesday 03 November 2015 11:01
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Dashticz - Module - Calendar

Post by htilburgs »

Maybe I've overlooked it, but is there also a posibilty to just use one calendar?
I only want to use my icloud calendar.
Hardware:
RPi3 - Aeon Labs Z-Stick GEN5 - Fibaro Dimmer 2 - Fibaro Roller Shutter 2 - Fibaro Smoke Sensor - Yeelight RGBW Led bulb - Yeelight Smart LED Light Strip - Neo Coolcam PIR Motion Sensor - Neo Coolcam PowerPlug - Nest Thermostat v3
User avatar
HansieNL
Posts: 957
Joined: Monday 28 September 2015 15:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Dashticz - Module - Calendar

Post by HansieNL »

htilburgs wrote:Maybe I've overlooked it, but is there also a posibilty to just use one calendar?
I only want to use my icloud calendar.
var calendars = {}
calendars.icloud = { title: 'My Calendar', icalurl: 'http://<your_url>' }

columns[1]['blocks'] = [calendars.icloud];
Blah blah blah
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Dashticz - Module - Calendar

Post by EdwinK »

Still can't get it to work.
Spoiler: show
var calendars = {}
calendars.business = { url: 'https://calendar.google.com/calendar/', icalurl: 'path_to_basic.ics' }
calendars.private = { icalurl: 'path_to/basic.ics' }
calendars.combined = {}
calendars.combined.calendars = [
{ color:'white',calendar:calendars.business },
{ color:'red',calendar:calendars.private }
]
calendars.combined.url = 'https://calendar.google.com/calendar';
I can see a place under 'Agenda' a slightly lighter place where there should be something, but when clicking it's empty. I think it because of the 'calendars.combined.url'. What should be there?
Agenda
Agenda
Screen Shot 2017-05-08 at 13.31.00.png (128.97 KiB) Viewed 12876 times
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
bsmeding
Posts: 34
Joined: Tuesday 28 October 2014 18:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Dashticz - Module - Calendar

Post by bsmeding »

robgeerts wrote:
bsmeding wrote:Yes me too, now whole day or repeating items.
Also still a problem with the timezone, everything is +2 hour, is there a possibility to change the timezone

I'm using iCloud calendar
Could you try latest BETA?
I'm not sure but I changed one thing that may fix it...
I checked latest beta, but still a 2 hour offset
bsmeding
Posts: 34
Joined: Tuesday 28 October 2014 18:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Dashticz - Module - Calendar

Post by bsmeding »

EdKo66 wrote:Still can't get it to work.
Spoiler: show
var calendars = {}
calendars.business = { url: 'https://calendar.google.com/calendar/', icalurl: 'path_to_basic.ics' }
calendars.private = { icalurl: 'path_to/basic.ics' }
calendars.combined = {}
calendars.combined.calendars = [
{ color:'white',calendar:calendars.business },
{ color:'red',calendar:calendars.private }
]
calendars.combined.url = 'https://calendar.google.com/calendar';
I can see a place under 'Agenda' a slightly lighter place where there should be something, but when clicking it's empty. I think it because of the 'calendars.combined.url'. What should be there?

Screen Shot 2017-05-08 at 13.31.00.png
the block must have the value 'calendars.combined' {without the .url}

Code: Select all

columns[2]['blocks'] = [314,315,399,''blocktitle_14',calendars.combined]
bsmeding
Posts: 34
Joined: Tuesday 28 October 2014 18:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Dashticz - Module - Calendar

Post by bsmeding »

For all that use iCloud calendar but don't want to use an public service processing their calendar items (privacy)

I download the ical from iCloud every 5 minutes to a local folder and use this local file for the calendar plugin

the file is a php file, so you need php available
create in custom a new folder :
mkdir ical
place this file to this folder
change the path in the file for $local_file, use full path because it will run from cronjob

$remote_file = url from iCloud calendar (in example the dutch holiday's) but you can use this for you own shared iCloud calendar.

calendar.feestdagen.php

Code: Select all

<?php
$local_file = "/var/www/home.local/web/dashboard/dashticz_beta/custom/ical/calendar.feestdagen.ics";//This is the file where we save the information
$remote_file = "https://p58-calendars.icloud.com/holidays/nl_nl.ics"; //Here is the file we are downloading


$ch = curl_init();
$fp = fopen ($local_file, 'w+');
$ch = curl_init($remote_file);
curl_setopt($ch, CURLOPT_TIMEOUT, 50);
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_ENCODING, "");
curl_exec($ch);
curl_close($ch);
fclose($fp);

open 'crontab -e'

Code: Select all

*/5 * * * * /usr/bin/php /var/www/home.local/web/dashboard/dashticz_beta/custom/ical/calendar.gezamenlijk.php
00 00 * * * /usr/bin/php /var/www/home.local/web/dashboard/dashticz_beta/custom/ical/calendar.feestdagen.php
I use two scripts, one for holidays, update every day once at 00:00 hour
and second script run every 5 minutes to update the iCloud shared calendar (gezamenlijke) these two icals will be used in Dashticz

CONFIG.js

Code: Select all

var calendars = {}
calendars.gezamenlijk = { icalurl: 'custom/ical/calendar.gezamenlijk.ics' }
calendars.feestdagen = { icalurl: 'custom/ical/calendar.feestdagen.ics' }

calendars.combined = {}
calendars.combined.calendars = [
   { color:'white',calendar:calendars.gezamenlijk },
   { color:'#ccc',calendar:calendars.feestdagen }
]
calendars.combined.url = 'https://www.icloud.com/#calendar';



columns[2]['blocks'] = [314,315,399,'blocktitle_6','buttons.cameravoordeur','blocktitle_14',[b]calendars.combined[/b]]

User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Dashticz - Module - Calendar

Post by EdwinK »

bsmeding wrote:
Screen Shot 2017-05-08 at 13.31.00.png
the block must have the value 'calendars.combined' {without the .url}

Code: Select all

columns[2]['blocks'] = [314,315,399,''blocktitle_14',calendars.combined]
[/quote]

That is what I have. Maybe I do something wrong with the Google Calendar. Trying with Icloud.
Last edited by EdwinK on Monday 16 April 2018 21:34, edited 2 times in total.
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
robgeerts
Posts: 1273
Joined: Saturday 24 January 2015 22:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: NL
Contact:

Re: Dashticz - Module - Calendar

Post by robgeerts »

I'm rewriting the calendar block, will be up in few days I hope, please be patient! :)
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Dashticz - Module - Calendar

Post by EdwinK »

Will do ;)
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
poudenes
Posts: 667
Joined: Wednesday 08 March 2017 9:42
Target OS: Linux
Domoticz version: 3.8993
Location: Amsterdam
Contact:

Re: Dashticz - Module - Calendar

Post by poudenes »

robgeerts wrote:Timezone and repeating will be fixed in upcoming version.
In v2 and Beta i can't see my repeating calendar. just the one time calendars.
RPi3 B+, Debain Stretch, Domoticz, Homebridge, Dashticz, RFLink, Milight, Z-Wave, Fibaro, Nanoleaf, Nest, Harmony Hub, Now try to understand pass2php
robgeerts
Posts: 1273
Joined: Saturday 24 January 2015 22:12
Target OS: NAS (Synology & others)
Domoticz version: 3.7067
Location: NL
Contact:

Re: Dashticz - Module - Calendar

Post by robgeerts »

You mentioned that already, will be fixed soon ;)
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest