Python Plugin : iCal Multi Purpose Python Plugin for Domoticz

Python and python framework

Moderator: leecollings

TheeDude
Posts: 46
Joined: Wednesday 07 October 2015 0:43
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin : iCal Multi Purpose Python Plugin for Domoticz

Post by TheeDude »

zak45 wrote: Monday 16 September 2019 18:13
TheeDude wrote: Monday 16 September 2019 17:34 Any idea why?
I did try to download new version of the files from dropbox link, and no success..
Spoiler: show
root@raspberrypi:/home/pi/domoticz/plugins/iCal# cat 14output.err
Traceback (most recent call last):
File "/home/pi/domoticz/plugins/iCal/iCal.py", line 1241, in <module>
processiCal()
File "/home/pi/domoticz/plugins/iCal/iCal.py", line 1074, in processiCal
datetomanage=getRecurrences(rulename, startdtorig, todayorig, addtonow, excludedate)
File "/home/pi/domoticz/plugins/iCal/iCal.py", line 979, in getRecurrences
for d in rules.between(today, addtonow):
File "/usr/local/lib/python3.5/dist-packages/dateutil/rrule.py", line 293, in between
if i >= before:
TypeError: can't compare offset-naive and offset-aware datetimes
The error seems to be "Error in diff iCal" and it doesn´t matter hos many times I run the script..
hI, looks like problem is coming from recuring rules.
Can you send me your ics file ?
Of course, I did send it private
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : iCal Multi Purpose Python Plugin for Domoticz

Post by zak45 »

New version uploaded for better management of recurring rules.
For already installed plugin, just upload the new iCal.py from dropbox and install py module recurring-ical-events.
See Wiki.
ricorico94
Posts: 94
Joined: Monday 26 October 2015 10:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : iCal Multi Purpose Python Plugin for Domoticz

Post by ricorico94 »

Hi,

I've been using the GCALCLI package for several years to manage my calendar and it was working well. Since this summer, I face issues to reinstall it -issues I could solve in August, nd not anymore with the latest release. So I'm looking for another solution and I saw your plugin which looks promising..
I have a couple questions on its mechanisms:
1- the wiki states that by adding :0 at end of calendar/event title, it will avoid assigning a RGB to OFF at end of event. But it's not described for SWitch. Is it the same for the SWitch ? Or any event with the :switch: setting will force the switch to OFF at end of event ? (I'd like to keep the freedom of initiating a command at beginning of an event without automatically putting to OFF at end of the event)
2- the wiki mentions a sentence I don't understand:
Caution: for #cmd# keyword: plugin create automatically all the timers, but if you change or remove any entry in Calendar, you need to do that manually in your Domoticz system.
Does it mean that if I reate an event in Google calendar, then it will be reflected by the plugin into Domoticz. But if I later modify the event (or delete it) in Google Calendar, it won't be modified/deleted in Domoticz and that such later change/deletion must be done manually in domoticz ?
3- do you think it would be easy (for someone else than you) to add some other syntax or keywords, so that entries in Google calendar can follow other structure or shorter syntax, etc.. ?
4- would there be a way for a script in dzvents/lua to use your script to "scan" the various google calendar entries of a specific day and then analyse their content ? (like exporting a structured file which could be analysed by a lua script)

br,
Ricorico94
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : iCal Multi Purpose Python Plugin for Domoticz

Post by zak45 »

Hi,
ricorico94 wrote: Sunday 20 October 2019 23:07 1- the wiki states that by adding :0 at end of calendar/event title, it will avoid assigning a RGB to OFF at end of event. But it's not described for SWitch. Is it the same for the SWitch ? Or any event with the :switch: setting will force the switch to OFF at end of event ? (I'd like to keep the freedom of initiating a command at beginning of an event without automatically putting to OFF at end of the event)
The same except for push (see Wiki)
ricorico94 wrote: Sunday 20 October 2019 23:07 2- the wiki mentions a sentence I don't understand:
Caution: for #cmd# keyword: plugin create automatically all the timers, but if you change or remove any entry in Calendar, you need to do that manually in your Domoticz system.
Does it mean that if I reate an event in Google calendar, then it will be reflected by the plugin into Domoticz. But if I later modify the event (or delete it) in Google Calendar, it won't be modified/deleted in Domoticz and that such later change/deletion must be done manually in domoticz ?
Right, for #cmd#, the plugin do not delete any created timers, but this can be customized if necessary...
ricorico94 wrote: Sunday 20 October 2019 23:07 3- do you think it would be easy (for someone else than you) to add some other syntax or keywords, so that entries in Google calendar can follow other structure or shorter syntax, etc.. ?
yes, but need some basic python knowledge of course...
ricorico94 wrote: Sunday 20 October 2019 23:07 4- would there be a way for a script in dzvents/lua to use your script to "scan" the various google calendar entries of a specific day and then analyse their content ? (like exporting a structured file which could be analysed by a lua script)
Plugin already create a structured file, It's a plain ascii text file, so you can do what you want with it.
ricorico94
Posts: 94
Joined: Monday 26 October 2015 10:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin : iCal Multi Purpose Python Plugin for Domoticz

Post by ricorico94 »

HI Zak,
Thank you for your reply and explanations.
Sounds interesting indeed. I'll try downloading the scripts and see if I understand something so that I could customize for my needs. ;-)

br,
Ricorico94
TheeDude
Posts: 46
Joined: Wednesday 07 October 2015 0:43
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin : iCal Multi Purpose Python Plugin for Domoticz

Post by TheeDude »

Hello!

I am getting new error messages today that I haven´t seen before.

Code: Select all

root@raspberrypi:/home/pi/domoticz/plugins/iCal# cat 16output.err
Traceback (most recent call last):
  File "/home/pi/domoticz/plugins/iCal/iCal.py", line 1197, in <module>
    processiCal()
  File "/home/pi/domoticz/plugins/iCal/iCal.py", line 1049, in processiCal
    startdt = startdt.astimezone(TZ)
AttributeError: 'datetime.date' object has no attribute 'astimezone'
root@raspberrypi:/home/pi/domoticz/plugins/iCal#
Has there been some changes?
It did only update the timer list for tomorrow, and nothing further.
I don´t know if it is because of this message or not either.

Thanks for a great program!
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : iCal Multi Purpose Python Plugin for Domoticz

Post by zak45 »

TheeDude wrote: Tuesday 28 January 2020 23:48 Hello!

Has there been some changes?
Nothing on plugin side :-(
Do you have updated python version !??

If possible, send me your isc file for debugging.
Lebo2d9
Posts: 139
Joined: Tuesday 06 September 2016 20:39
Target OS: Raspberry Pi / ODroid
Domoticz version: L stab
Location: Belgium
Contact:

Re: Python Plugin : iCal Multi Purpose Python Plugin for Domoticz

Post by Lebo2d9 »

Hi zak45,

I have installed the iCal but i have a translation problem.
I live in Belgium (BE) dutch part.
In the iCal directory i have the translation file "en_be.lng" but in the file there are translations to Rusian.
Is there a way to get the nl translation?
Domoicz on RPI3 (wifi) directly connected 3x ds18b20 for CV temp, Evohome (9 zone), 1 remote 220V switch based on ESP-12. RFXtrx433E, 16x AMST-606, 5 Somfy RTS motors
Domoticz on RPI3(wifi) as slave for terraruim control
More to come
Lebo2d9
Posts: 139
Joined: Tuesday 06 September 2016 20:39
Target OS: Raspberry Pi / ODroid
Domoticz version: L stab
Location: Belgium
Contact:

Re: Python Plugin : iCal Multi Purpose Python Plugin for Domoticz

Post by Lebo2d9 »

Lebo2d9 wrote: Monday 01 June 2020 14:28 Hi zak45,

I have installed the iCal but i have a translation problem.
I live in Belgium (BE) dutch part.
In the iCal directory i have the translation file "en_be.lng" but in the file there are translations to Rusian.
Is there a way to get the nl translation?
I did a small trick to get it fixed. I "moved" my "domoticz" to the netherlands and restarted the plugin. Now all the devices are created in dutch. I also have appapted the "postalcode" to the correct one. The country code i have left on "nl"

Kind regards
Domoicz on RPI3 (wifi) directly connected 3x ds18b20 for CV temp, Evohome (9 zone), 1 remote 220V switch based on ESP-12. RFXtrx433E, 16x AMST-606, 5 Somfy RTS motors
Domoticz on RPI3(wifi) as slave for terraruim control
More to come
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : iCal Multi Purpose Python Plugin for Domoticz

Post by zak45 »

Ok, nice to see that you have it running...
geertvercamer
Posts: 84
Joined: Friday 12 May 2017 20:03
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin : iCal Multi Purpose Python Plugin for Domoticz

Post by geertvercamer »

Hi,


I'm unable to get the devices created.
server is listening on 9003, IP is set to 192.xxx.xxx.xxx address, port is right.
Running on W10

Thanks for your help
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : iCal Multi Purpose Python Plugin for Domoticz

Post by zak45 »

geertvercamer wrote: Friday 03 July 2020 10:48 Hi,


I'm unable to get the devices created.
server is listening on 9003, IP is set to 192.xxx.xxx.xxx address, port is right.
Running on W10

Thanks for your help
be sure that no firewall is blocking.
geertvercamer
Posts: 84
Joined: Friday 12 May 2017 20:03
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin : iCal Multi Purpose Python Plugin for Domoticz

Post by geertvercamer »

zak45 wrote: Friday 03 July 2020 11:09
geertvercamer wrote: Friday 03 July 2020 10:48 Hi,


I'm unable to get the devices created.
server is listening on 9003, IP is set to 192.xxx.xxx.xxx address, port is right.
Running on W10

Thanks for your help
be sure that no firewall is blocking.
I don't think so, just using Windows Firewall . It is an ip address in the local network.
geertvercamer
Posts: 84
Joined: Friday 12 May 2017 20:03
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin : iCal Multi Purpose Python Plugin for Domoticz

Post by geertvercamer »

geertvercamer wrote: Friday 03 July 2020 14:02
zak45 wrote: Friday 03 July 2020 11:09
geertvercamer wrote: Friday 03 July 2020 10:48 Hi,


I'm unable to get the devices created.
server is listening on 9003, IP is set to 192.xxx.xxx.xxx address, port is right.
Running on W10

Thanks for your help
be sure that no firewall is blocking.
I don't think so, just using Windows Firewall . It is an ip address in the local network.
I'm also using pihole, but nothing is blocked there.
Anyone got any ideas as why the devices are not created? (I get the popup, but they are not)
peter68
Posts: 7
Joined: Wednesday 20 September 2017 12:04
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Nederland
Contact:

Re: Python Plugin : iCal Multi Purpose Python Plugin for Domoticz

Post by peter68 »

Hi,

I have installed this plugin, webserver is running "iCal response OK!".
In the google agenda i made a appointment with the code #wrk#
However if the time is there nothing happens.
How can i see that the google agenda is loaded correctly?
The log in Domoticz shows no error
Please advise how to check where the probleme might be.

thank you!
Peter
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : iCal Multi Purpose Python Plugin for Domoticz

Post by zak45 »

peter68 wrote: Monday 17 August 2020 14:56 Hi,

I have installed this plugin, webserver is running "iCal response OK!".
In the google agenda i made a appointment with the code #wrk#
However if the time is there nothing happens.
How can i see that the google agenda is loaded correctly?
The log in Domoticz shows no error
Please advise how to check where the probleme might be.

thank you!
Peter
check domoticz device (At work) , Verify if you have corresponding schedules created.
peter68
Posts: 7
Joined: Wednesday 20 September 2017 12:04
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Nederland
Contact:

Re: Python Plugin : iCal Multi Purpose Python Plugin for Domoticz

Post by peter68 »

zak45 wrote: Monday 17 August 2020 15:40
peter68 wrote: Monday 17 August 2020 14:56 Hi,

I have installed this plugin, webserver is running "iCal response OK!".
In the google agenda i made a appointment with the code #wrk#
However if the time is there nothing happens.
How can i see that the google agenda is loaded correctly?
The log in Domoticz shows no error
Please advise how to check where the probleme might be.

thank you!
Peter
check domoticz device (At work) , Verify if you have corresponding schedules created.
No schedules are created. Not on the At Work switch and also not on the holiday switch.
I did find some logging in the folder /domoticz/plugin/iCal.
There is a file called 11output.err and 11output.txt
opening the 11output.err:
pi@pi2:~/domoticz/plugins/iCal $ sudo more 11output.err
Traceback (most recent call last):
File "/home/pi/domoticz/plugins/iCal/iCal.py", line 1197, in <module>
processiCal()
File "/home/pi/domoticz/plugins/iCal/iCal.py", line 1049, in processiCal
startdt = startdt.astimezone(TZ)
AttributeError: 'datetime.date' object has no attribute 'astimezone'

part of the file: 11output.txt:
We beheren de werkschakelaar: kamer 1 - op het werk
start 2020-10-15 09:00:00+02:00, end 2020-10-15 17:30:00+02:00 , duration 8:30:
00 , desc
Atwork gedetecteerd: en standaardtoblank is: Yes
We beheren de werkschakelaar: kamer 1 - op het werk
start 2020-10-12 08:30:00+02:00, end 2020-10-12 17:00:00+02:00 , duration 8:30:
00 , desc
Atwork gedetecteerd: en standaardtoblank is: Yes
We beheren de werkschakelaar: kamer 1 - op het werk
start 2020-09-17 09:00:00+02:00, end 2020-09-17 17:30:00+02:00 , duration 8:30:
00 , desc
Atwork gedetecteerd: en standaardtoblank is: Yes
We beheren de werkschakelaar: kamer 1 - op het werk

So its looks that there should be some schedules.

For my understanding. Does the plugin create schedules on the device on what time in needs to switch on/off?

thanks already.
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : iCal Multi Purpose Python Plugin for Domoticz

Post by zak45 »

peter68 wrote: Monday 17 August 2020 16:38 So its looks that there should be some schedules.

For my understanding. Does the plugin create schedules on the device on what time in needs to switch on/off?

thanks already.
Right.
peter68
Posts: 7
Joined: Wednesday 20 September 2017 12:04
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Nederland
Contact:

Re: Python Plugin : iCal Multi Purpose Python Plugin for Domoticz

Post by peter68 »

zak45 wrote: Monday 17 August 2020 17:22
peter68 wrote: Monday 17 August 2020 16:38 So its looks that there should be some schedules.

For my understanding. Does the plugin create schedules on the device on what time in needs to switch on/off?

thanks already.
Right.
I removed the plugin in hardware section of domoticz. this also removes the created devices.
Added the plugin again under a different name. New devices are created.
Also the iCal from google is downloaded. But no schedules are created under the devices. only under the seasons device are 4 schedules.
Still there a no schedules.
where to look to solve this? All help is welcome!
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : iCal Multi Purpose Python Plugin for Domoticz

Post by zak45 »

peter68 wrote: Monday 17 August 2020 19:27
I removed the plugin in hardware section of domoticz. this also removes the created devices.
Added the plugin again under a different name. New devices are created.
Also the iCal from google is downloaded. But no schedules are created under the devices. only under the seasons device are 4 schedules.
Still there a no schedules.
where to look to solve this? All help is welcome!
If possible, send me your isc file for debugging.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest