Python Plugin : iCal Multi Purpose Python Plugin for Domoticz

Python and python framework

Moderator: leecollings

Post Reply
zak45
Posts: 953
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, merci.

Will try to see if I can do something from my side.

PS
Et non,
malheureusement pas du coin.
Martial
Posts: 31
Joined: Saturday 11 March 2017 18:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by Martial »

thank you,
in fact, my need is to recover in a device type text, the appointments of the day to display them on a screen (type monitor) in addition to being able to do actions in Domoticz from my calendar.
zak45
Posts: 953
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 iCal.py uploaded.
give it a try.
Martial
Posts: 31
Joined: Saturday 11 March 2017 18:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by Martial »

Whaou !

Seule erreur restante:
Error : <class 'FileNotFoundError'> [Errno 2] No such file or directory: '/home/pi/domoticz/plugins/iCal/19iCal.ics.bkp' <traceback object at 0x75acf6c0>
Effectivement, le fichier n'existe pas. Est-ce à moi de le créer?
Spoiler: show
Spoiler: show
-----------------Main---------------------------
__Request Domoticz to : type=command&param=getuservariables used encoding is : utf-8__
['switch', 'push', 'level', 'rgb']
Les utilisateurs existent: 19|iCal|sync -> 60
Les utilisateurs existent: 19|iCal|cmd -> switch,push,level,rgb
Les utilisateurs existent: 19|iCal|tz -> CET
Les utilisateurs existent: 19|iCal|postalcode -> 83700
Les utilisateurs existent: 19|iCal|village -> *unknown*
Les utilisateurs existent: 19|iCal|country -> fr
Les utilisateurs existent: 19|iCal|codevillage -> vc
Nous réutilisons le fichier existant: /home/pi/domoticz/plugins/iCal/en_fr.lng
Nous ne travaillons pas sur les fenêtres
Demander domoticz à: filter=device&type=schedules le codage utilisé est: utf-8
Demander domoticz à: filter=all&type=devices&order=Name&used=true le codage utilisé est: utf-8
Nom de périphérique pour atwork: calendrier - au travail
/home/pi/domoticz/plugins/iCal/19iCal.ics
Processus shell pour générer le fichier ical.ics
Commande à exécuter: /home/pi/domoticz/plugins/iCal/getiCal.sh
Erreur lors de la première exécution, cela peut être normal, nous continuons quand même
Error : <class 'FileNotFoundError'> [Errno 2] No such file or directory: '/home/pi/domoticz/plugins/iCal/19iCal.ics.bkp' <traceback object at 0x75acf6c0>
Fuseau horaire des variables utilisateur: CET
-----------------iCal---------------------------
Atwork détecté: et defaulttoblank est: Yes
Nous gérons le changement de travail: calendrier - au travail
Atwork détecté: et defaulttoblank est: Yes
Nous gérons le changement de travail: calendrier - au travail
Atwork détecté: et defaulttoblank est: Yes
Nous gérons le changement de travail: calendrier - au travail
Atwork détecté: et defaulttoblank est: Yes
Nous gérons le changement de travail: calendrier - au travail
Atwork détecté: et defaulttoblank est: Yes
Nous gérons le changement de travail: calendrier - au travail
Atwork détecté: et defaulttoblank est: Yes
Nous gérons le changement de travail: calendrier - au travail
Atwork détecté: et defaulttoblank est: Yes
Nous gérons le changement de travail: calendrier - au travail
Nom de la règle: FREQ=DAILY;UNTIL=20190504
Date de début : 2019-04-27
Aujourd'hui : 2019-03-03 19:48:57.959691
Aujourd'hui + xxx: 2019-06-01 19:48:57.959691
Première date: 2019-04-27 00:00:00
Atwork détecté: et defaulttoblank est: Yes
Nous gérons le changement de travail: calendrier - au travail
Atwork détecté: et defaulttoblank est: Yes
Nous gérons le changement de travail: calendrier - au travail
Atwork détecté: et defaulttoblank est: Yes
Nous gérons le changement de travail: calendrier - au travail
Atwork détecté: et defaulttoblank est: Yes
Nous gérons le changement de travail: calendrier - au travail
Atwork détecté: et defaulttoblank est: Yes
Nous gérons le changement de travail: calendrier - au travail
Atwork détecté: et defaulttoblank est: Yes
Nous gérons le changement de travail: calendrier - au travail
Atwork détecté: et defaulttoblank est: Yes
Nous gérons le changement de travail: calendrier - au travail
Atwork détecté: et defaulttoblank est: Yes
Nous gérons le changement de travail: calendrier - au travail
Atwork détecté: et defaulttoblank est: Yes
Nous gérons le changement de travail: calendrier - au travail
Atwork détecté: et defaulttoblank est: Yes
Nous gérons le changement de travail: calendrier - au travail
Atwork détecté: et defaulttoblank est: Yes
Nous gérons le changement de travail: calendrier - au travail
Atwork détecté: et defaulttoblank est: Yes
Nous gérons le changement de travail: calendrier - au travail
-----------------End iCal-----------------------
-----------------atWrk--------------------------
Demander domoticz à: type=command&idx=809&param=cleartimers le codage utilisé est: utf-8
cmd:0 level:-1 hue:0 scope:-1 atWork:True
Le statut actuel de calendrier - au travail est: Off
Nous planifions du début à la fin
Demander domoticz à: min=54&active=true&type=command&date=2019-05-05&days=0&timertype=5&idx=809&param=addtimer&command=1&color=&hour=11&level=-1&randomness=false le codage utilisé est: utf-8
Demander domoticz à: min=54&active=true&type=command&date=2019-05-05&days=0&timertype=5&idx=809&param=addtimer&command=0&color=&hour=10&level=-1&randomness=false le codage utilisé est: utf-8
cmd:0 level:-1 hue:0 scope:-1 atWork:True
Le statut actuel de calendrier - au travail est: Off
Nous planifions du début à la fin
Demander domoticz à: min=00&active=true&type=command&date=2019-05-05&days=0&timertype=5&idx=809&param=addtimer&command=1&color=&hour=00&level=-1&randomness=false le codage utilisé est: utf-8
Demander domoticz à: min=00&active=true&type=command&date=2019-05-04&days=0&timertype=5&idx=809&param=addtimer&command=0&color=&hour=00&level=-1&randomness=false le codage utilisé est: utf-8
cmd:0 level:-1 hue:0 scope:-1 atWork:True
Le statut actuel de calendrier - au travail est: Off
Nous planifions du début à la fin
Rien à faire pour cet horaire: 2019-05-04 00:00:00
Demander domoticz à: min=00&active=true&type=command&date=2019-05-03&days=0&timertype=5&idx=809&param=addtimer&command=0&color=&hour=00&level=-1&randomness=false le codage utilisé est: utf-8
cmd:0 level:-1 hue:0 scope:-1 atWork:True
Le statut actuel de calendrier - au travail est: Off
Nous planifions du début à la fin
Rien à faire pour cet horaire: 2019-05-03 00:00:00
Demander domoticz à: min=00&active=true&type=command&date=2019-05-02&days=0&timertype=5&idx=809&param=addtimer&command=0&color=&hour=00&level=-1&randomness=false le codage utilisé est: utf-8
cmd:0 level:-1 hue:0 scope:-1 atWork:True
Le statut actuel de calendrier - au travail est: Off
Nous planifions du début à la fin
Rien à faire pour cet horaire: 2019-05-02 00:00:00
Demander domoticz à: min=00&active=true&type=command&date=2019-05-01&days=0&timertype=5&idx=809&param=addtimer&command=0&color=&hour=00&level=-1&randomness=false le codage utilisé est: utf-8
cmd:0 level:-1 hue:0 scope:-1 atWork:True
Le statut actuel de calendrier - au travail est: Off
Nous planifions du début à la fin
Rien à faire pour cet horaire: 2019-05-01 00:00:00
Demander domoticz à: min=00&active=true&type=command&date=2019-04-30&days=0&timertype=5&idx=809&param=addtimer&command=0&color=&hour=00&level=-1&randomness=false le codage utilisé est: utf-8
cmd:0 level:-1 hue:0 scope:-1 atWork:True
Le statut actuel de calendrier - au travail est: Off
Nous planifions du début à la fin
Rien à faire pour cet horaire: 2019-04-30 00:00:00
Demander domoticz à: min=00&active=true&type=command&date=2019-04-29&days=0&timertype=5&idx=809&param=addtimer&command=0&color=&hour=00&level=-1&randomness=false le codage utilisé est: utf-8
cmd:0 level:-1 hue:0 scope:-1 atWork:True
Le statut actuel de calendrier - au travail est: Off
Nous planifions du début à la fin
Rien à faire pour cet horaire: 2019-04-29 00:00:00
Demander domoticz à: min=00&active=true&type=command&date=2019-04-28&days=0&timertype=5&idx=809&param=addtimer&command=0&color=&hour=00&level=-1&randomness=false le codage utilisé est: utf-8
cmd:0 level:-1 hue:0 scope:-1 atWork:True
Le statut actuel de calendrier - au travail est: Off
Nous planifions du début à la fin
Rien à faire pour cet horaire: 2019-04-28 00:00:00
Demander domoticz à: min=00&active=true&type=command&date=2019-04-27&days=0&timertype=5&idx=809&param=addtimer&command=0&color=&hour=00&level=-1&randomness=false le codage utilisé est: utf-8
cmd:0 level:-1 hue:0 scope:-1 atWork:True
Le statut actuel de calendrier - au travail est: Off
Nous planifions du début à la fin
Demander domoticz à: min=09&active=true&type=command&date=2019-04-26&days=0&timertype=5&idx=809&param=addtimer&command=1&color=&hour=21&level=-1&randomness=false le codage utilisé est: utf-8
Demander domoticz à: min=09&active=true&type=command&date=2019-04-26&days=0&timertype=5&idx=809&param=addtimer&command=0&color=&hour=20&level=-1&randomness=false le codage utilisé est: utf-8
cmd:0 level:-1 hue:0 scope:-1 atWork:True
Le statut actuel de calendrier - au travail est: Off
Nous planifions du début à la fin
Demander domoticz à: min=30&active=true&type=command&date=2019-04-24&days=0&timertype=5&idx=809&param=addtimer&command=1&color=&hour=23&level=-1&randomness=false le codage utilisé est: utf-8
Demander domoticz à: min=30&active=true&type=command&date=2019-04-24&days=0&timertype=5&idx=809&param=addtimer&command=0&color=&hour=20&level=-1&randomness=false le codage utilisé est: utf-8
cmd:0 level:-1 hue:0 scope:-1 atWork:True
Le statut actuel de calendrier - au travail est: Off
Nous planifions du début à la fin
Demander domoticz à: min=30&active=true&type=command&date=2019-04-23&days=0&timertype=5&idx=809&param=addtimer&command=1&color=&hour=10&level=-1&randomness=false le codage utilisé est: utf-8
Demander domoticz à: min=30&active=true&type=command&date=2019-04-23&days=0&timertype=5&idx=809&param=addtimer&command=0&color=&hour=09&level=-1&randomness=false le codage utilisé est: utf-8
cmd:0 level:-1 hue:0 scope:-1 atWork:True
Le statut actuel de calendrier - au travail est: Off
Nous planifions du début à la fin
Demander domoticz à: min=00&active=true&type=command&date=2019-03-27&days=0&timertype=5&idx=809&param=addtimer&command=1&color=&hour=01&level=-1&randomness=false le codage utilisé est: utf-8
Demander domoticz à: min=00&active=true&type=command&date=2019-03-27&days=0&timertype=5&idx=809&param=addtimer&command=0&color=&hour=00&level=-1&randomness=false le codage utilisé est: utf-8
cmd:0 level:-1 hue:0 scope:-1 atWork:True
Le statut actuel de calendrier - au travail est: Off
Nous planifions du début à la fin
Demander domoticz à: min=15&active=true&type=command&date=2019-03-07&days=0&timertype=5&idx=809&param=addtimer&command=1&color=&hour=16&level=-1&randomness=false le codage utilisé est: utf-8
Demander domoticz à: min=15&active=true&type=command&date=2019-03-07&days=0&timertype=5&idx=809&param=addtimer&command=0&color=&hour=08&level=-1&randomness=false le codage utilisé est: utf-8
cmd:0 level:-1 hue:0 scope:-1 atWork:True
Le statut actuel de calendrier - au travail est: Off
Nous planifions du début à la fin
Rien à faire pour cet horaire: 2019-03-07 15:00:00+01:00
Demander domoticz à: min=00&active=true&type=command&date=2019-03-07&days=0&timertype=5&idx=809&param=addtimer&command=0&color=&hour=14&level=-1&randomness=false le codage utilisé est: utf-8
cmd:0 level:-1 hue:0 scope:-1 atWork:True
Le statut actuel de calendrier - au travail est: Off
Nous planifions du début à la fin
Demander domoticz à: min=15&active=true&type=command&date=2019-03-06&days=0&timertype=5&idx=809&param=addtimer&command=1&color=&hour=16&level=-1&randomness=false le codage utilisé est: utf-8
Demander domoticz à: min=15&active=true&type=command&date=2019-03-06&days=0&timertype=5&idx=809&param=addtimer&command=0&color=&hour=08&level=-1&randomness=false le codage utilisé est: utf-8
cmd:0 level:-1 hue:0 scope:-1 atWork:True
Le statut actuel de calendrier - au travail est: Off
Nous planifions du début à la fin
Demander domoticz à: min=30&active=true&type=command&date=2019-03-05&days=0&timertype=5&idx=809&param=addtimer&command=1&color=&hour=16&level=-1&randomness=false le codage utilisé est: utf-8
Demander domoticz à: min=30&active=true&type=command&date=2019-03-05&days=0&timertype=5&idx=809&param=addtimer&command=0&color=&hour=14&level=-1&randomness=false le codage utilisé est: utf-8
cmd:0 level:-1 hue:0 scope:-1 atWork:True
Le statut actuel de calendrier - au travail est: Off
Nous planifions du début à la fin
Demander domoticz à: min=15&active=true&type=command&date=2019-03-04&days=0&timertype=5&idx=809&param=addtimer&command=1&color=&hour=16&level=-1&randomness=false le codage utilisé est: utf-8
Demander domoticz à: min=15&active=true&type=command&date=2019-03-04&days=0&timertype=5&idx=809&param=addtimer&command=0&color=&hour=08&level=-1&randomness=false le codage utilisé est: utf-8
cmd:0 level:-1 hue:0 scope:-1 atWork:True
Le statut actuel de calendrier - au travail est: Off
Nous planifions du début à la fin
Rien à faire pour cet horaire: 2019-03-04 12:00:00+01:00
Demander domoticz à: min=00&active=true&type=command&date=2019-03-04&days=0&timertype=5&idx=809&param=addtimer&command=0&color=&hour=08&level=-1&randomness=false le codage utilisé est: utf-8
laston : 20190304 0800 today : 20190303 1948 modatwork : 0
-----------------End atWrk----------------------
-----------------Holidays-----------------------
Nombre de jours générés: 11
Nous envoyons des données de vacances
-----------------End Holidays-------------------
-----------------End Main-----------------------
Martial
Posts: 31
Joined: Saturday 11 March 2017 18:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by Martial »

I try a command.
In my ics file:
BEGIN:VEVENT^M
UID:e54968ee-ed17-4d9d-ab08-a80d93256473^M
DTSTART;TZID=Europe/Paris:20190303T203000^M
DTEND;TZID=Europe/Paris:20190303T213000^M
CREATED:20190303T191113Z^M
DTSTAMP:20190303T191213Z^M
LAST-MODIFIED:20190303T191213Z^M
SUMMARY:#cmd#Test:switch:On:0^M
TRANSP:OPAQUE^M
END:VEVENT^M


Nothing in domoticz on switch Test, but "At Work"
zak45
Posts: 953
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 »

this should not be on Summary but on description:
e.g.
BEGIN:VEVENT
DTSTART:20180511T224500Z
DTEND:20180511T231500Z
DTSTAMP:20190303T221129Z
CREATED:20180511T095943Z
DESCRIPTION:#cmd#Z-LampeEXTRGBW:rgb:red
LAST-MODIFIED:20180511T225500Z
LOCATION:
SEQUENCE:18
STATUS:CONFIRMED
SUMMARY:Lampe RGB Flo
TRANSP:OPAQUE
END:VEVENT
Martial
Posts: 31
Joined: Saturday 11 March 2017 18:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by Martial »

Yes !
It's OK.
A big thank !
Un grand merci pour le travail et votre disponibilité.
I just have to find how to feed either a variable or a text device with the elements of the calendar.

Encore merci
Martial
PS: vous êtes du Loiret ?
zak45
Posts: 953
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, that's great..

Et oui, à coté d’Orléans !
Bon courage.
Martial
Posts: 31
Joined: Saturday 11 March 2017 18:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by Martial »

Belle région également.
Dommage, j'aurai pu vous payer une bière.

Cordialement
zak45
Posts: 953
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 »

For people that are using this plugin and living in nice country : France ;-)

you can request by voice the rain prevision and Domoticz will use TTS to respond.
if you say "va-t-il pleuvoir", the magic appear...
This is part of the EZJarviz python plugin.
Martial
Posts: 31
Joined: Saturday 11 March 2017 18:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by Martial »

except those who, like me, live in the southeast quarter
http://www.meteofrance.com/previsions-m ... ions-pluie
:(
Aadr
Posts: 19
Joined: Tuesday 09 June 2015 21:26
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: The Nederlands
Contact:

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

Post by Aadr »

Dear Zak45,

I am searching for a good Google Calendar integration with Domoticz. At this moment, your solution would be the best for our needs.
I did try come up with a solution myself, but it is too difficult for me. In the past we used the BakSeeDaa calendar.
Multiple people use the Calendar with different appointments with differents switches. Is it possible to use more than one #cmd# in one appointment? If so, what syntax should be used?

I hope you could help me, thank you in advance.

Best regards,
Aad R
zak45
Posts: 953
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 »

Aadr wrote: Saturday 27 April 2019 11:57 I am searching for a good Google Calendar integration with Domoticz. At this moment, your solution would be the best for our needs.
I did try come up with a solution myself, but it is too difficult for me. In the past we used the BakSeeDaa calendar.
Multiple people use the Calendar with different appointments with differents switches. Is it possible to use more than one #cmd# in one appointment?

If so, what syntax should be used?
Hi,
not in actual version... but this is something you can manage with Domoticz:
let suppose you want to activate dev1, dev2 & dev3
just create a dummy switch, call it for example dum1 and put dev1,dev2 & dev3 as slave device.
your appointement need to be set for dum1...
in case you need different actions, suppose put dev1 'on', dev2 'off', dev3 'on', in this case you can try to play with the scene/group feature of Domoticz
in case you want some other type of action you can even put script execution etc ...
Domoticz offer so much possibilities... but if you have some specific need not covered by Domoticz, let me know, I can maybe take some times to see what can be done.
regards.
Aadr
Posts: 19
Joined: Tuesday 09 June 2015 21:26
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: The Nederlands
Contact:

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

Post by Aadr »

Dear Zak45,

Thank you for your quick reply.

The dummy and scene solution you propose is not ideal, we would end up with to many dummy switches. The calender-user would not be able to remember them all.

We have in our clubhouse 4 heatingzones and 20 calendar-users. Depending on the planned activities, different combinations of the heatingzones are activated.
The calendar-user makes an appointment, and fills in a specific code for a heatingzone(s) he will need during his activity.

So I am looking for a solution whereby a short keyword will trigger one specific dummy-switch. From there a simple script will handle the task.
And I need at least 4 different keywords.

I hope my explanation is clear enough for you and that a small modification or extra feature is possible.

many thanks for your work so far, at the moment I am learning Python on YouTube. Maybe I will be able to contribute in the future myself a little bit.

best regards

Aad R
zak45
Posts: 953
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 »

Aadr wrote: Sunday 28 April 2019 9:57 I hope my explanation is clear enough for you and that a small modification or extra feature is possible.
sent a PM.
zak45
Posts: 953
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 feature added to iCal:

the cmd command now allow to put more than one Domoticz device.
this work in this way:
#cmd#dev1{,dev2,dev3,...}:switch:On|Off{:0}
visuel
Posts: 13
Joined: Sunday 05 March 2017 13:02
Target OS: Linux
Domoticz version:
Contact:

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

Post by visuel »

Hello zak45 ,

I would love to use your icalendar plugin on my raspbian domoticz.
The installation succeeded without errors.

After installing the plugin I get the following in the log:
Spoiler: show
2019-07-20 21:04:17.046 Status: (Calendar) Started.
2019-07-20 21:04:18.140 Status: (Calendar) Entering work loop.
2019-07-20 21:04:18.140 Status: (Calendar) Initialized version 1.0.0, author 'zak45'
2019-07-20 21:04:18.173 Error: (Calendar) Error sending command to domoticz : param=getuservariables&type=command
2019-07-20 21:04:18.174 Error: (Calendar) Erreur to execute get user variables

2019-07-20 21:04:54.260 Status: (Calendar) Stop directive received.
2019-07-20 21:04:54.260 Status: (Calendar) Exiting work loop.
2019-07-20 21:04:54.460 Status: (Calendar) Stopping threads.
2019-07-20 21:04:54.461 Status: (Calendar) Stopped.
2019-07-20 21:05:22.778 Status: (Calendar) Started.
2019-07-20 21:05:23.245 Status: (Calendar) Entering work loop.
2019-07-20 21:05:23.245 Status: (Calendar) Initialized version 1.0.0, author 'zak45'
2019-07-20 21:05:23.268 Error: (Calendar) Error sending command to domoticz : param=getuservariables&type=command
2019-07-20 21:05:23.268 Error: (Calendar) Erreur to execute get user variables

2019-07-20 21:05:24.195 (Calendar) 63 7a 20 3a 20 74 79 70 65 3d 63 6f 6d 6d 61 6e 64 26 70 61 cz.:.type=command&pa
2019-07-20 21:05:24.195 (Calendar) 72 61 6d 3d 67 65 74 75 73 65 72 76 61 72 69 61 62 6c 65 73 ram=getuservariables
2019-07-20 21:05:24.196 (Calendar) 5f 5f 22 7d 7d .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. __"}}
2019-07-20 21:05:24.196 (Calendar) Pushing 'onMessageCallback' on to queue
2019-07-20 21:05:24.196 (Calendar) Processing 'onMessageCallback' message
2019-07-20 21:05:24.196 (Calendar) Calling message handler 'onMessage'.
2019-07-20 21:05:24.196 (Calendar) onMessage called for connection: 127.0.0.1:49136
2019-07-20 21:05:24.196 (Calendar) POST request received.
2019-07-20 21:05:24.196 (Calendar) Pushing 'WriteDirective' on to queue
2019-07-20 21:05:24.196 (Calendar) data:b'{"status":{"step":"exeDomoticz","msg":"__Error sending command to Domoticz : type=command&param=getuservariables__"}}'
2019-07-20 21:05:24.196 (Calendar) {"status":{"step":"exeDomoticz","msg":"__Error sending command to Domoticz : type=command&param=getuservariables__"}}
2019-07-20 21:05:24.196 (Calendar) processing data : {"status":{"step":"exeDomoticz","msg":"__Error sending command to Domoticz : type=command&param=getuservariables__"}}
2019-07-20 21:05:24.196 (Calendar) data process OK
2019-07-20 21:05:24.196 (Calendar) Processing 'WriteDirective' message
2019-07-20 21:05:24.196 (Calendar) Sending 249 bytes of data
In the iCal folder I found the following two files:

26output.err:
fatal error

and

26output.txt:

-----------------Main---------------------------
__Error sending command to Domoticz : type=command&param=getuservariables__
Error : <class 'urllib.error.HTTPError'> HTTP Error 401: Unauthorized <traceback object at 0x76087580>
__Error retreive dict data from Domoticz : uservariables__
__error to generate uservariables dict__
Error : None None None

Do you perhaps have an idea what I am doing wrong?


I am using python 3.5.3 and domoticz 4.11020.

Kind regards,

Victor
visuel
Posts: 13
Joined: Sunday 05 March 2017 13:02
Target OS: Linux
Domoticz version:
Contact:

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

Post by visuel »

Seems it had to do with the ip-address I used.

changed the default 127.0.0.1 to the external ip-adress that domoticz uses and now the devices do appear.

In my case the "external" ipaddress was 10.0.1.70

:D
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 again!

In the summer I haven´t used this script, because it just heats my car when it is cold outside.

And now the autumn is coming with cold temperatures, and yesterday I tried to test the script again, if it was working.
To my surprise it was not!

Any idea why?
I did try to download new version of the files from dropbox link, and no success..
Spoiler: show
2019-09-16 17:30:05.624 Status: User: Jonas initiated a switch command (879/Jonas Google Kalender - Ical status/Off)
2019-09-16 17:30:15.421 (Jonas Google Kalender) Pushing 'onCommandCallback' on to queue
2019-09-16 17:30:15.428 (Jonas Google Kalender) Processing 'onCommandCallback' message
2019-09-16 17:30:15.428 (Jonas Google Kalender) Calling message handler 'onCommand'.
2019-09-16 17:30:15.428 (Jonas Google Kalender) Oncommand called for unit 4 : parameter On , level: 0
2019-09-16 17:30:15.429 (Jonas Google Kalender - Ical status) Updating device from 0:'Pause' to have values 1:'Resume'.
2019-09-16 17:30:15.470 (Jonas Google Kalender) We update 1:'Resume' (Jonas Google Kalender - Ical status)
2019-09-16 17:30:15.470 (Jonas Google Kalender) We clean related files in plugin folder
2019-09-16 17:30:15.472 (Jonas Google Kalender) We have deleted this file: /home/pi/domoticz/plugins/iCal/14iCal.ics
2019-09-16 17:30:15.473 (Jonas Google Kalender) We have deleted this file: /home/pi/domoticz/plugins/iCal/14output.txt
2019-09-16 17:30:15.474 (Jonas Google Kalender) We have deleted this file: /home/pi/domoticz/plugins/iCal/14output.err
2019-09-16 17:30:15.475 (Jonas Google Kalender) Command to execute : "/home/pi/domoticz/plugins/iCal/iCal.sh" "/home/pi/domoticz/plugins/iCal/iCal.py" "9003,Sweden,,,14,https://calendar.google.com/calendar/ic ... ;21.617606" no
2019-09-16 17:30:15.420 Status: User: Jonas initiated a switch command (879/Jonas Google Kalender - Ical status/On)
2019-09-16 17:30:17.858 (Jonas Google Kalender) Pushing 'ProtocolDirective' on to queue
2019-09-16 17:30:17.858 (Jonas Google Kalender) Pushing 'onConnectCallback' on to queue
2019-09-16 17:30:17.858 (Jonas Google Kalender) Pushing 'ReadEvent' on to queue
2019-09-16 17:30:17.877 (Jonas Google Kalender) Processing 'ProtocolDirective' message
2019-09-16 17:30:17.878 (Jonas Google Kalender) Protocol set to: 'HTTP'.
2019-09-16 17:30:17.878 (Jonas Google Kalender) Processing 'onConnectCallback' message
2019-09-16 17:30:17.878 (Jonas Google Kalender) Calling message handler 'onConnect'.
2019-09-16 17:30:17.878 (Jonas Google Kalender) Connected successfully to 127.0.0.1:52356
2019-09-16 17:30:17.878 (Jonas Google Kalender) Deallocating connection object '127.0.0.1:52242' (127.0.0.1:52242).
2019-09-16 17:30:17.878 (Jonas Google Kalender) Processing 'ReadEvent' message
2019-09-16 17:30:17.878 (Jonas Google Kalender) Received 329 bytes of data
2019-09-16 17:30:17.879 (Jonas Google Kalender) 50 4f 53 54 20 2f 20 48 54 54 50 2f 31 2e 31 0d 0a 48 6f 73 POST./.HTTP/1.1..Hos
2019-09-16 17:30:17.879 (Jonas Google Kalender) 74 3a 20 31 32 37 2e 30 2e 30 2e 31 3a 39 30 30 33 0d 0a 41 t:.127.0.0.1:9003..A
2019-09-16 17:30:17.879 (Jonas Google Kalender) 63 63 65 70 74 2d 45 6e 63 6f 64 69 6e 67 3a 20 67 7a 69 70 ccept-Encoding:.gzip
2019-09-16 17:30:17.879 (Jonas Google Kalender) 2c 20 64 65 66 6c 61 74 65 0d 0a 41 63 63 65 70 74 3a 20 2a ,.deflate..Accept:.*
2019-09-16 17:30:17.879 (Jonas Google Kalender) 2f 2a 0d 0a 55 73 65 72 2d 41 67 65 6e 74 3a 20 70 79 74 68 /*..User-Agent:.pyth
2019-09-16 17:30:17.879 (Jonas Google Kalender) 6f 6e 2d 72 65 71 75 65 73 74 73 2f 32 2e 32 30 2e 30 0d 0a on-requests/2.20.0..
2019-09-16 17:30:17.879 (Jonas Google Kalender) 43 6f 6e 6e 65 63 74 69 6f 6e 3a 20 6b 65 65 70 2d 61 6c 69 Connection:.keep-ali
2019-09-16 17:30:17.879 (Jonas Google Kalender) 76 65 0d 0a 43 6f 6e 74 65 6e 74 2d 74 79 70 65 3a 20 74 65 ve..Content-type:.te
2019-09-16 17:30:17.879 (Jonas Google Kalender) 78 74 2f 70 6c 61 69 6e 3b 20 63 68 61 72 73 65 74 3d 75 74 xt/plain;.charset=ut
2019-09-16 17:30:17.879 (Jonas Google Kalender) 66 2d 38 0d 0a 43 6f 6e 74 65 6e 74 2d 4c 65 6e 67 74 68 3a f-8..Content-Length:
2019-09-16 17:30:17.880 (Jonas Google Kalender) 20 31 32 31 0d 0a 0d 0a 7b 22 73 74 61 74 75 73 22 3a 7b 22 .121....{"status":{"
2019-09-16 17:30:17.880 (Jonas Google Kalender) 73 74 65 70 22 3a 22 64 69 66 66 43 61 6c 22 2c 22 6d 73 67 step":"diffCal","msg
2019-09-16 17:30:17.880 (Jonas Google Kalender) 22 3a 22 5f 5f 45 72 72 6f 72 20 69 6e 20 64 69 66 66 20 69 ":"__Error.in.diff.i
2019-09-16 17:30:17.880 (Jonas Google Kalender) 43 61 6c 2c 20 66 69 72 73 74 20 74 69 6d 65 20 65 78 65 63 Cal,.first.time.exec
2019-09-16 17:30:17.880 (Jonas Google Kalender) 75 74 69 6f 6e 20 74 68 69 73 20 63 61 6e 20 62 65 20 6e 6f ution.this.can.be.no
2019-09-16 17:30:17.880 (Jonas Google Kalender) 72 6d 61 6c 2c 20 77 65 20 63 6f 6e 74 69 6e 75 65 20 61 6e rmal,.we.continue.an
2019-09-16 17:30:17.880 (Jonas Google Kalender) 79 77 61 79 5f 5f 22 7d 7d .. .. .. .. .. .. .. .. .. .. .. yway__"}}
2019-09-16 17:30:17.880 (Jonas Google Kalender) Pushing 'onMessageCallback' on to queue
2019-09-16 17:30:17.880 (Jonas Google Kalender) Processing 'onMessageCallback' message
2019-09-16 17:30:17.881 (Jonas Google Kalender) Calling message handler 'onMessage'.
2019-09-16 17:30:17.881 (Jonas Google Kalender) Onmessage called for connection: 127.0.0.1:52356
2019-09-16 17:30:17.881 (Jonas Google Kalender) POST request received.
2019-09-16 17:30:17.881 (Jonas Google Kalender) Pushing 'WriteDirective' on to queue
2019-09-16 17:30:17.881 (Jonas Google Kalender) data:b'{"status":{"step":"diffCal","msg":"__Error in diff iCal, first time execution this can be normal, we continue anyway__"}}'
2019-09-16 17:30:17.881 (Jonas Google Kalender) {"status":{"step":"diffCal","msg":"__Error in diff iCal, first time execution this can be normal, we continue anyway__"}}
2019-09-16 17:30:17.882 (Jonas Google Kalender) Processing data : {"status":{"step":"diffCal","msg":"__Error in diff iCal, first time execution this can be normal, we continue anyway__"}}
2019-09-16 17:30:17.882 (Jonas Google Kalender - Ical status) Updating device from 1:'Resume' to have values 1:'**diffCal-> msg:__Error in diff iCal, first time execution this can be normal, we continue anyway__'.
2019-09-16 17:30:17.910 (Jonas Google Kalender) We update 1:'**diffCal-> msg:__Error in diff iCal, first time execution this can be normal, we continue anyway__' (Jonas Google Kalender - Ical status)
2019-09-16 17:30:17.911 (Jonas Google Kalender) Data process ok
2019-09-16 17:30:17.911 (Jonas Google Kalender) Processing 'WriteDirective' message
2019-09-16 17:30:17.911 (Jonas Google Kalender) Sending 249 bytes of data
2019-09-16 17:30:17.911 (Jonas Google Kalender) 48 54 54 50 2f 31 2e 31 20 32 30 30 20 4f 4b 0d 0a 44 61 74 HTTP/1.1.200.OK..Dat
2019-09-16 17:30:17.911 (Jonas Google Kalender) 65 3a 20 4d 6f 6e 2c 20 31 36 20 53 65 70 20 32 30 31 39 20 e:.Mon,.16.Sep.2019.
2019-09-16 17:30:17.911 (Jonas Google Kalender) 31 35 3a 33 30 3a 31 37 20 47 4d 54 0d 0a 53 65 72 76 65 72 15:30:17.GMT..Server
2019-09-16 17:30:17.912 (Jonas Google Kalender) 3a 20 44 6f 6d 6f 74 69 63 7a 2f 31 2e 30 0d 0a 43 6f 6e 6e :.Domoticz/1.0..Conn
2019-09-16 17:30:17.912 (Jonas Google Kalender) 65 63 74 69 6f 6e 3a 20 6b 65 65 70 2d 61 6c 69 76 65 0d 0a ection:.keep-alive..
2019-09-16 17:30:17.912 (Jonas Google Kalender) 41 63 63 65 70 74 3a 20 43 6f 6e 74 65 6e 74 2d 54 79 70 65 Accept:.Content-Type
2019-09-16 17:30:17.912 (Jonas Google Kalender) 3a 20 74 65 78 74 2f 68 74 6d 6c 3b 20 63 68 61 72 73 65 74 :.text/html;.charset
2019-09-16 17:30:17.912 (Jonas Google Kalender) 3d 55 54 46 2d 38 0d 0a 43 6f 6e 74 65 6e 74 2d 4c 65 6e 67 =UTF-8..Content-Leng
2019-09-16 17:30:17.912 (Jonas Google Kalender) 74 68 3a 20 37 39 0d 0a 0d 0a 3c 21 44 4f 43 54 59 50 45 20 th:.79....<!DOCTYPE.
2019-09-16 17:30:17.912 (Jonas Google Kalender) 68 74 6d 6c 3e 3c 68 74 6d 6c 3e 3c 68 65 61 64 3e 3c 2f 68 html><html><head></h
2019-09-16 17:30:17.912 (Jonas Google Kalender) 65 61 64 3e 3c 62 6f 64 79 3e 3c 68 33 3e 69 43 61 6c 20 72 ead><body><h3>iCal.r
2019-09-16 17:30:17.912 (Jonas Google Kalender) 65 73 70 6f 6e 73 65 20 4f 4b 21 3c 2f 68 33 3e 3c 62 6f 64 esponse.OK!</h3><bod
2019-09-16 17:30:17.912 (Jonas Google Kalender) 79 3e 3c 2f 68 74 6d 6c 3e .. .. .. .. .. .. .. .. .. .. .. y></html>
2019-09-16 17:30:17.918 (Jonas Google Kalender) Queued asynchronous read aborted (127.0.0.1:52356), [2] End of file.
2019-09-16 17:30:17.918 (Jonas Google Kalender) Pushing 'DisconnectedEvent' on to queue
2019-09-16 17:30:17.963 (Jonas Google Kalender) Processing 'DisconnectedEvent' message
2019-09-16 17:30:17.963 (Jonas Google Kalender) Disconnect event received for '127.0.0.1:52356'.
2019-09-16 17:30:17.963 (Jonas Google Kalender) Pushing 'onDisconnectCallback' on to queue
2019-09-16 17:30:17.964 (Jonas Google Kalender) Processing 'onDisconnectCallback' message
2019-09-16 17:30:17.964 (Jonas Google Kalender) Calling message handler 'onDisconnect'.
2019-09-16 17:30:17.964 (Jonas Google Kalender) Ondisconnect called for connection '127.0.0.1:52356'
2019-09-16 17:30:17.964 (Jonas Google Kalender) Server connections:
2019-09-16 17:30:17.964 (Jonas Google Kalender) --> 10.10.1.4:64138'.
2019-09-16 17:30:17.964 (Jonas Google Kalender) --> 127.0.0.1:52356'.
2019-09-16 17:30:27.289 (Jonas Google Kalender) Pushing 'onHeartbeatCallback' on to queue
2019-09-16 17:30:27.336 (Jonas Google Kalender) Processing 'onHeartbeatCallback' message
2019-09-16 17:30:27.336 (Jonas Google Kalender) Calling message handler 'onHeartbeat'.
2019-09-16 17:30:27.337 (Jonas Google Kalender - Ical status) Updating device from 1:'**diffCal-> msg:__Error in diff iCal, first time execution this can be normal, we continue anyway__' to have values 1:'Executing, sync every 60 minutes '.
2019-09-16 17:30:27.364 (Jonas Google Kalender) We update 1:'Executing, sync every 60 minutes ' (Jonas Google Kalender - Ical status)
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..
zak45
Posts: 953
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: 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 ?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest