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 05 November 2018 18:04
TheeDude wrote: Monday 05 November 2018 13:27 Any idea of what I should try next?
put debug mode and post the log (take care of any private information)

Here comes to debug log

Code: Select all

2018-11-05 18:36:22.278 Status: (Jonas Google Kalender) Started.
2018-11-05 18:36:23.113 (Jonas Google Kalender) Debug logging mask set to: PYTHON PLUGIN QUEUE IMAGE DEVICE CONNECTION MESSAGE ALL
2018-11-05 18:36:23.113 (Jonas Google Kalender) 'Address':'127.0.0.1'
2018-11-05 18:36:23.113 (Jonas Google Kalender) 'Mode3':'No'
2018-11-05 18:36:23.113 (Jonas Google Kalender) 'DomoticzBuildTime':'2018-11-04 09:34:57'
2018-11-05 18:36:23.113 (Jonas Google Kalender) 'Author':'zak45'
2018-11-05 18:36:23.113 (Jonas Google Kalender) 'Mode5':'https://calendar.google.com/calendar/ical/xxxx-xxxx-xxxxxx-xxx/basic.ics'
2018-11-05 18:36:23.113 (Jonas Google Kalender) 'Port':'8080'
2018-11-05 18:36:23.113 (Jonas Google Kalender) 'HomeFolder':'/home/pi/domoticz/plugins/iCal/'
2018-11-05 18:36:23.113 (Jonas Google Kalender) 'Mode2':'Sweden'
2018-11-05 18:36:23.114 (Jonas Google Kalender) 'Version':'1.0.0'
2018-11-05 18:36:23.114 (Jonas Google Kalender) 'Mode6':'Debug'
2018-11-05 18:36:23.114 (Jonas Google Kalender) 'HardwareID':'11'
2018-11-05 18:36:23.114 (Jonas Google Kalender) 'DomoticzVersion':'4.10171'
2018-11-05 18:36:23.114 (Jonas Google Kalender) 'Mode1':'9003'
2018-11-05 18:36:23.114 (Jonas Google Kalender) 'Key':'iCal'
2018-11-05 18:36:23.114 (Jonas Google Kalender) 'DomoticzHash':'8dd6677b'
2018-11-05 18:36:23.114 (Jonas Google Kalender) 'Name':'Jonas Google Kalender'
2018-11-05 18:36:23.114 (Jonas Google Kalender) Device count: 0
2018-11-05 18:36:23.114 (Jonas Google Kalender) Pushing 'PollIntervalDirective' on to queue
2018-11-05 18:36:23.181 (Jonas Google Kalender) Request from domoticz to : type=command&param=getuservariables with encoding : utf-8
2018-11-05 18:36:23.182 (Jonas Google Kalender) lang file : /home/pi/domoticz/plugins/iCal/en_en.lng
2018-11-05 18:36:23.191 (Jonas Google Kalender) Pushing 'ProtocolDirective' on to queue
2018-11-05 18:36:23.191 (Jonas Google Kalender) Pushing 'ListenDirective' on to queue
2018-11-05 18:36:23.191 (Jonas Google Kalender) Listen on iCalWebserver - Port: 9003
2018-11-05 18:36:23.192 (Jonas Google Kalender) command to execute : "/home/pi/domoticz/plugins/iCal/iCal.sh" "/home/pi/domoticz/plugins/iCal/iCal.py" "9003,Sweden,,,11,https://private-url/basic.ics,/home/pi/domoticz/plugins/iCal/,No,999,0,0,0,0,0,3,127.0.0.1,8080,65.819332;21.617606" no
2018-11-05 18:36:23.218 (Jonas Google Kalender) Initialisation finished, will sync iCal every : 60 minutes
2018-11-05 18:36:23.219 (Jonas Google Kalender) Hardware ID: 11
2018-11-05 18:36:23.219 (Jonas Google Kalender) Information level: 3
2018-11-05 18:36:23.219 (Jonas Google Kalender) Processing 'PollIntervalDirective' message
2018-11-05 18:36:23.219 (Jonas Google Kalender) Heartbeat interval set to: 30.
2018-11-05 18:36:23.219 (Jonas Google Kalender) Processing 'ProtocolDirective' message
2018-11-05 18:36:23.219 (Jonas Google Kalender) Protocol set to: 'HTTP'.
2018-11-05 18:36:23.219 (Jonas Google Kalender) Processing 'ListenDirective' message
2018-11-05 18:36:23.219 (Jonas Google Kalender) Transport set to: 'TCP/IP', :9003.
2018-11-05 18:36:23.219 (Jonas Google Kalender) Listen directive received, action initiated successfully.
2018-11-05 18:36:23.107 Status: (Jonas Google Kalender) Entering work loop.
2018-11-05 18:36:23.108 Status: (Jonas Google Kalender) Initialized version 1.0.0, author 'zak45'
2018-11-05 18:36:33.110 (Jonas Google Kalender) Pushing 'onHeartbeatCallback' on to queue
2018-11-05 18:36:33.148 (Jonas Google Kalender) Processing 'onHeartbeatCallback' message
2018-11-05 18:36:33.148 (Jonas Google Kalender) Calling message handler 'onHeartbeat'.
tomdh76
Posts: 20
Joined: Saturday 09 September 2017 19:27
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by tomdh76 »

zak45 wrote: Monday 05 November 2018 12:34
tomdh76 wrote: Monday 05 November 2018 7:54
__Command detected : #cmd#Vakantie:switch:On

The #cmd# was useful to do that.
Do you think it is possible to make that work somehow?
yes, you just need to put the #cmd# keyword on the description field of your calendar entry.. but nothing else.

e.g:#cmd#Vakantie:switch:On
It is working as expected in google calendar, thanks a lot! I do not get it to work in outlook, it seems that the ics file generated by outlook always uses \n in the description line like this: DESCRIPTION:#wrk#\n. I think that it does not work in that way. Do you have an idea / suggestion?
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
Does domoticz is allowed to accept new HW/Devices ???
Capture.JPG
Capture.JPG (32.11 KiB) Viewed 2700 times
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 »

tomdh76 wrote: Monday 05 November 2018 18:43 It is working as expected in google calendar, thanks a lot! I do not get it to work in outlook, it seems that the ics file generated by outlook always uses \n in the description line like this: DESCRIPTION:#wrk#\n. I think that it does not work in that way. Do you have an idea / suggestion?
Will do some test on my side...
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 05 November 2018 18:54 @TheeDude
Does domoticz is allowed to accept new HW/Devices ???
Capture.JPG

Yes it is!
domoticz.png
domoticz.png (91.54 KiB) Viewed 2696 times
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 »

zak45 wrote: Monday 05 November 2018 18:55
tomdh76 wrote: Monday 05 November 2018 18:43 It is working as expected in google calendar, thanks a lot! I do not get it to work in outlook, it seems that the ics file generated by outlook always uses \n in the description line like this: DESCRIPTION:#wrk#\n. I think that it does not work in that way. Do you have an idea / suggestion?
Will do some test on my side...
You're right for \n.. new version uploaded. thanks.
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 05 November 2018 19:03 Yes it is!
do you have chmod +x on *.py & *.sh files ??
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 05 November 2018 19:32
TheeDude wrote: Monday 05 November 2018 19:03 Yes it is!
do you have chmod +x on *.py & *.sh files ??
Yes! That too.
I did try it again just so I didn´t forgot after I changed out those files, but no difference.
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 05 November 2018 19:54 Yes! That too.
I did try it again just so I didn´t forgot after I changed out those files, but no difference.
lets focus now on the communication part between processes.
put plugin on debug mode, and execute this command from your OS (where domoticz is running):
http://127.0.0.1:9003

you should receive an answser
iCal response OK!

and see this in your domoticz log (similar):
Spoiler: show
2018-11-05 20:36:21.562 (RFX433E) Temp + Humidity (433-TempSDB)
2018-11-05 20:36:21.562 (outlook) Pushing 'ReadEvent' on to queue
2018-11-05 20:36:21.578 (outlook) Processing 'ReadEvent' message
2018-11-05 20:36:21.578 (outlook) Received 371 bytes of data
2018-11-05 20:36:21.578 (outlook) 47 45 54 20 2f 20 48 54 54 50 2f 31 2e 31 0d 0a 48 6f 73 74 GET./.HTTP/1.1..Host
2018-11-05 20:36:21.578 (outlook) 3a 20 31 32 37 2e 30 2e 30 2e 31 3a 39 30 31 33 0d 0a 55 73 :.127.0.0.1:9013..Us
2018-11-05 20:36:21.578 (outlook) 65 72 2d 41 67 65 6e 74 3a 20 4d 6f 7a 69 6c 6c 61 2f 35 2e er-Agent:.Mozilla/5.
2018-11-05 20:36:21.578 (outlook) 30 20 28 57 69 6e 64 6f 77 73 20 4e 54 20 31 30 2e 30 3b 20 0.(Windows.NT.10.0;.
2018-11-05 20:36:21.578 (outlook) 57 69 6e 36 34 3b 20 78 36 34 3b 20 72 76 3a 36 33 2e 30 29 Win64;.x64;.rv:63.0)
2018-11-05 20:36:21.578 (outlook) 20 47 65 63 6b 6f 2f 32 30 31 30 30 31 30 31 20 46 69 72 65 .Gecko/20100101.Fire
2018-11-05 20:36:21.578 (outlook) 66 6f 78 2f 36 33 2e 30 0d 0a 41 63 63 65 70 74 3a 20 74 65 fox/63.0..Accept:.te
2018-11-05 20:36:21.578 (outlook) 78 74 2f 68 74 6d 6c 2c 61 70 70 6c 69 63 61 74 69 6f 6e 2f xt/html,application/
2018-11-05 20:36:21.578 (outlook) 78 68 74 6d 6c 2b 78 6d 6c 2c 61 70 70 6c 69 63 61 74 69 6f xhtml+xml,applicatio
2018-11-05 20:36:21.578 (outlook) 6e 2f 78 6d 6c 3b 71 3d 30 2e 39 2c 2a 2f 2a 3b 71 3d 30 2e n/xml;q=0.9,*/*;q=0.
2018-11-05 20:36:21.578 (outlook) 38 0d 0a 41 63 63 65 70 74 2d 4c 61 6e 67 75 61 67 65 3a 20 8..Accept-Language:.
2018-11-05 20:36:21.578 (outlook) 66 72 2c 66 72 2d 46 52 3b 71 3d 30 2e 38 2c 65 6e 2d 55 53 fr,fr-FR;q=0.8,en-US
2018-11-05 20:36:21.578 (outlook) 3b 71 3d 30 2e 35 2c 65 6e 3b 71 3d 30 2e 33 0d 0a 41 63 63 ;q=0.5,en;q=0.3..Acc
2018-11-05 20:36:21.578 (outlook) 65 70 74 2d 45 6e 63 6f 64 69 6e 67 3a 20 67 7a 69 70 2c 20 ept-Encoding:.gzip,.
2018-11-05 20:36:21.578 (outlook) 64 65 66 6c 61 74 65 0d 0a 43 6f 6e 6e 65 63 74 69 6f 6e 3a deflate..Connection:
2018-11-05 20:36:21.578 (outlook) 20 6b 65 65 70 2d 61 6c 69 76 65 0d 0a 55 70 67 72 61 64 65 .keep-alive..Upgrade
2018-11-05 20:36:21.578 (outlook) 2d 49 6e 73 65 63 75 72 65 2d 52 65 71 75 65 73 74 73 3a 20 -Insecure-Requests:.
2018-11-05 20:36:21.578 (outlook) 31 0d 0a 43 61 63 68 65 2d 43 6f 6e 74 72 6f 6c 3a 20 6d 61 1..Cache-Control:.ma
2018-11-05 20:36:21.578 (outlook) 78 2d 61 67 65 3d 30 0d 0a 0d 0a .. .. .. .. .. .. .. .. .. x-age=0....
2018-11-05 20:36:21.578 (outlook) Pushing 'onMessageCallback' on to queue
2018-11-05 20:36:21.578 (outlook) Processing 'onMessageCallback' message
2018-11-05 20:36:21.578 (outlook) Calling message handler 'onMessage'.
2018-11-05 20:36:21.578 (outlook) Un message appelé pour la connexion: 127.0.0.1: 25840
2018-11-05 20:36:21.578 (outlook) GET request received.
2018-11-05 20:36:21.578 (outlook) Pushing 'WriteDirective' on to queue
2018-11-05 20:36:21.578 (outlook) Processing 'WriteDirective' message
2018-11-05 20:36:21.578 (outlook) Sending 249 bytes of data
2018-11-05 20:36:21.578 (outlook) 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
2018-11-05 20:36:21.578 (outlook) 65 3a 20 4d 6f 6e 2c 20 30 35 20 4e 6f 76 20 32 30 31 38 20 e:.Mon,.05.Nov.2018.
2018-11-05 20:36:21.578 (outlook) 31 39 3a 33 36 3a 32 31 20 47 4d 54 0d 0a 53 65 72 76 65 72 19:36:21.GMT..Server
2018-11-05 20:36:21.578 (outlook) 3a 20 44 6f 6d 6f 74 69 63 7a 2f 31 2e 30 0d 0a 43 6f 6e 6e :.Domoticz/1.0..Conn
2018-11-05 20:36:21.578 (outlook) 65 63 74 69 6f 6e 3a 20 6b 65 65 70 2d 61 6c 69 76 65 0d 0a ection:.keep-alive..
2018-11-05 20:36:21.578 (outlook) 41 63 63 65 70 74 3a 20 43 6f 6e 74 65 6e 74 2d 54 79 70 65 Accept:.Content-Type
2018-11-05 20:36:21.578 (outlook) 3a 20 74 65 78 74 2f 68 74 6d 6c 3b 20 63 68 61 72 73 65 74 :.text/html;.charset
2018-11-05 20:36:21.578 (outlook) 3d 55 54 46 2d 38 0d 0a 43 6f 6e 74 65 6e 74 2d 4c 65 6e 67 =UTF-8..Content-Leng
2018-11-05 20:36:21.578 (outlook) 74 68 3a 20 37 39 0d 0a 0d 0a 3c 21 44 4f 43 54 59 50 45 20 th:.79....<!DOCTYPE.
2018-11-05 20:36:21.578 (outlook) 68 74 6d 6c 3e 3c 68 74 6d 6c 3e 3c 68 65 61 64 3e 3c 2f 68 html><html><head></h
2018-11-05 20:36:21.578 (outlook) 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
2018-11-05 20:36:21.578 (outlook) 65 73 70 6f 6e 73 65 20 4f 4b 21 3c 2f 68 33 3e 3c 62 6f 64 esponse.OK!</h3><bod
2018-11-05 20:36:21.578 (outlook) 79 3e 3c 2f 68 74 6d 6c 3e .. .. .. .. .. .. .. .. .. .. .. y></html>
2018-11-05 20:36:21.656 (outlook) Pushing 'ReadEvent' on to queue
2018-11-05 20:36:21.702 (outlook) Processing 'ReadEvent' message
2018-11-05 20:36:21.702 (outlook) Received 352 bytes of data
2018-11-05 20:36:21.702 (outlook) 47 45 54 20 2f 66 61 76 69 63 6f 6e 2e 69 63 6f 20 48 54 54 GET./favicon.ico.HTT
2018-11-05 20:36:21.702 (outlook) 50 2f 31 2e 31 0d 0a 48 6f 73 74 3a 20 31 32 37 2e 30 2e 30 P/1.1..Host:.127.0.0
2018-11-05 20:36:21.702 (outlook) 2e 31 3a 39 30 31 33 0d 0a 55 73 65 72 2d 41 67 65 6e 74 3a .1:9013..User-Agent:
2018-11-05 20:36:21.702 (outlook) 20 4d 6f 7a 69 6c 6c 61 2f 35 2e 30 20 28 57 69 6e 64 6f 77 .Mozilla/5.0.(Window
2018-11-05 20:36:21.702 (outlook) 73 20 4e 54 20 31 30 2e 30 3b 20 57 69 6e 36 34 3b 20 78 36 s.NT.10.0;.Win64;.x6
2018-11-05 20:36:21.702 (outlook) 34 3b 20 72 76 3a 36 33 2e 30 29 20 47 65 63 6b 6f 2f 32 30 4;.rv:63.0).Gecko/20
2018-11-05 20:36:21.702 (outlook) 31 30 30 31 30 31 20 46 69 72 65 66 6f 78 2f 36 33 2e 30 0d 100101.Firefox/63.0.
2018-11-05 20:36:21.702 (outlook) 0a 41 63 63 65 70 74 3a 20 74 65 78 74 2f 68 74 6d 6c 2c 61 .Accept:.text/html,a
2018-11-05 20:36:21.702 (outlook) 70 70 6c 69 63 61 74 69 6f 6e 2f 78 68 74 6d 6c 2b 78 6d 6c pplication/xhtml+xml
2018-11-05 20:36:21.702 (outlook) 2c 61 70 70 6c 69 63 61 74 69 6f 6e 2f 78 6d 6c 3b 71 3d 30 ,application/xml;q=0
2018-11-05 20:36:21.702 (outlook) 2e 39 2c 2a 2f 2a 3b 71 3d 30 2e 38 0d 0a 41 63 63 65 70 74 .9,*/*;q=0.8..Accept
2018-11-05 20:36:21.702 (outlook) 2d 4c 61 6e 67 75 61 67 65 3a 20 66 72 2c 66 72 2d 46 52 3b -Language:.fr,fr-FR;
2018-11-05 20:36:21.702 (outlook) 71 3d 30 2e 38 2c 65 6e 2d 55 53 3b 71 3d 30 2e 35 2c 65 6e q=0.8,en-US;q=0.5,en
2018-11-05 20:36:21.702 (outlook) 3b 71 3d 30 2e 33 0d 0a 41 63 63 65 70 74 2d 45 6e 63 6f 64 ;q=0.3..Accept-Encod
2018-11-05 20:36:21.702 (outlook) 69 6e 67 3a 20 67 7a 69 70 2c 20 64 65 66 6c 61 74 65 0d 0a ing:.gzip,.deflate..
2018-11-05 20:36:21.702 (outlook) 43 6f 6e 6e 65 63 74 69 6f 6e 3a 20 6b 65 65 70 2d 61 6c 69 Connection:.keep-ali
2018-11-05 20:36:21.702 (outlook) 76 65 0d 0a 43 61 63 68 65 2d 43 6f 6e 74 72 6f 6c 3a 20 6d ve..Cache-Control:.m
2018-11-05 20:36:21.702 (outlook) 61 78 2d 61 67 65 3d 30 0d 0a 0d 0a .. .. .. .. .. .. .. .. ax-age=0....
2018-11-05 20:36:21.702 (outlook) Pushing 'onMessageCallback' on to queue
2018-11-05 20:36:21.702 (outlook) Processing 'onMessageCallback' message
2018-11-05 20:36:21.702 (outlook) Calling message handler 'onMessage'.
2018-11-05 20:36:21.702 (outlook) Un message appelé pour la connexion: 127.0.0.1: 25840
2018-11-05 20:36:21.702 (outlook) GET request received.
2018-11-05 20:36:21.702 (outlook) Pushing 'WriteDirective' on to queue
2018-11-05 20:36:21.702 (outlook) Processing 'WriteDirective' message
2018-11-05 20:36:21.702 (outlook) Sending 249 bytes of data
2018-11-05 20:36:21.702 (outlook) 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
2018-11-05 20:36:21.702 (outlook) 65 3a 20 4d 6f 6e 2c 20 30 35 20 4e 6f 76 20 32 30 31 38 20 e:.Mon,.05.Nov.2018.
2018-11-05 20:36:21.702 (outlook) 31 39 3a 33 36 3a 32 31 20 47 4d 54 0d 0a 53 65 72 76 65 72 19:36:21.GMT..Server
2018-11-05 20:36:21.702 (outlook) 3a 20 44 6f 6d 6f 74 69 63 7a 2f 31 2e 30 0d 0a 43 6f 6e 6e :.Domoticz/1.0..Conn
2018-11-05 20:36:21.702 (outlook) 65 63 74 69 6f 6e 3a 20 6b 65 65 70 2d 61 6c 69 76 65 0d 0a ection:.keep-alive..
2018-11-05 20:36:21.702 (outlook) 41 63 63 65 70 74 3a 20 43 6f 6e 74 65 6e 74 2d 54 79 70 65 Accept:.Content-Type
2018-11-05 20:36:21.702 (outlook) 3a 20 74 65 78 74 2f 68 74 6d 6c 3b 20 63 68 61 72 73 65 74 :.text/html;.charset
2018-11-05 20:36:21.702 (outlook) 3d 55 54 46 2d 38 0d 0a 43 6f 6e 74 65 6e 74 2d 4c 65 6e 67 =UTF-8..Content-Leng
2018-11-05 20:36:21.702 (outlook) 74 68 3a 20 37 39 0d 0a 0d 0a 3c 21 44 4f 43 54 59 50 45 20 th:.79....<!DOCTYPE.
2018-11-05 20:36:21.702 (outlook) 68 74 6d 6c 3e 3c 68 74 6d 6c 3e 3c 68 65 61 64 3e 3c 2f 68 html><html><head></h
2018-11-05 20:36:21.702 (outlook) 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
2018-11-05 20:36:21.702 (outlook) 65 73 70 6f 6e 73 65 20 4f 4b 21 3c 2f 68 33 3e 3c 62 6f 64 esponse.OK!</h3><bod
2018-11-05 20:36:21.702 (outlook) 79 3e 3c 2f 68 74 6d 6c 3e .. .. .. .. .. .. .. .. .. .. .. y></html>
2018-11-05 20:36:23.515 (sp3s) Update 0:'0.0' (sp3s - SP3S current)
2018-11-05 20:36:23.531 (sp3s) Update 0:'0.0' (sp3s - SP3S usage)
2018-11-05 20:36:28.593 (RFX433E) Temp + Humidity (433-TempSalon)
2018-11-05 20:36:28.609 (RM2 Salon) Update 1:'22.8' (RM2 Salon - Temp)
2018-11-05 20:36:30.609 (BGAPI) regular scan initiated
2018-11-05 20:36:37.250 (RFX433E) Temp + Humidity (433-TempSDBE)
2018-11-05 20:36:37.734 (BGAPI) Device not managed : 3C:91:E1:9E:A6:24
2018-11-05 20:36:51.016 (outlook) Pushing 'onHeartbeatCallback' on to queue
2018-11-05 20:36:51.079 (outlook) Processing 'onHeartbeatCallback' message
2018-11-05 20:36:51.079 (outlook) Calling message handler 'onHeartbeat'.
2018-11-05 20:36:54.220 (sp3s) Update 0:'0.0' (sp3s - SP3S current)
2018-11-05 20:36:54.235 (sp3s) Update 0:'0.0' (sp3s - SP3S usage)
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 05 November 2018 20:41
lets focus now on the communication part between processes.
put plugin on debug mode, and execute this command from your OS (where domoticz is running):
http://127.0.0.1:9003

you should receive an answser
iCal response OK!
Here it comes!
Spoiler: show
2018-11-05 23:09:15.589 (Jonas Google Kalender) Pushing 'onHeartbeatCallback' on to queue
2018-11-05 23:09:15.594 (Jonas Google Kalender) Processing 'onHeartbeatCallback' message
2018-11-05 23:09:15.594 (Jonas Google Kalender) Calling message handler 'onHeartbeat'.
2018-11-05 23:09:15.977 (Jonas Google Kalender) Pushing 'ProtocolDirective' on to queue
2018-11-05 23:09:15.977 (Jonas Google Kalender) Pushing 'onConnectCallback' on to queue
2018-11-05 23:09:15.989 (Jonas Google Kalender) Pushing 'ReadEvent' on to queue
2018-11-05 23:09:15.995 (Jonas Google Kalender) Processing 'ProtocolDirective' message
2018-11-05 23:09:15.995 (Jonas Google Kalender) Protocol set to: 'HTTP'.
2018-11-05 23:09:15.995 (Jonas Google Kalender) Processing 'onConnectCallback' message
2018-11-05 23:09:15.995 (Jonas Google Kalender) Calling message handler 'onConnect'.
2018-11-05 23:09:16.030 (Jonas Google Kalender) Connected successfully to 127.0.0.1:59704
2018-11-05 23:09:16.030 (Jonas Google Kalender) Processing 'ReadEvent' message
2018-11-05 23:09:16.030 (Jonas Google Kalender) Received 174 bytes of data
2018-11-05 23:09:16.030 (Jonas Google Kalender) 47 45 54 20 2f 20 48 54 54 50 2f 31 2e 31 0d 0a 48 6f 73 74 GET./.HTTP/1.1..Host
2018-11-05 23:09:16.030 (Jonas Google Kalender) 3a 20 31 32 37 2e 30 2e 30 2e 31 3a 39 30 30 33 0d 0a 55 73 :.127.0.0.1:9003..Us
2018-11-05 23:09:16.030 (Jonas Google Kalender) 65 72 2d 41 67 65 6e 74 3a 20 45 4c 69 6e 6b 73 2f 30 2e 31 er-Agent:.ELinks/0.1
2018-11-05 23:09:16.030 (Jonas Google Kalender) 32 70 72 65 36 20 28 74 65 78 74 6d 6f 64 65 3b 20 4c 69 6e 2pre6.(textmode;.Lin
2018-11-05 23:09:16.030 (Jonas Google Kalender) 75 78 20 34 2e 31 34 2e 37 38 2d 76 37 2b 20 61 72 6d 76 37 ux.4.14.78-v7+.armv7
2018-11-05 23:09:16.031 (Jonas Google Kalender) 6c 3b 20 31 38 36 78 34 34 2d 32 29 0d 0a 41 63 63 65 70 74 l;.186x44-2)..Accept
2018-11-05 23:09:16.031 (Jonas Google Kalender) 3a 20 2a 2f 2a 0d 0a 41 63 63 65 70 74 2d 4c 61 6e 67 75 61 :.*/*..Accept-Langua
2018-11-05 23:09:16.031 (Jonas Google Kalender) 67 65 3a 20 73 76 0d 0a 43 6f 6e 6e 65 63 74 69 6f 6e 3a 20 ge:.sv..Connection:.
2018-11-05 23:09:16.031 (Jonas Google Kalender) 4b 65 65 70 2d 41 6c 69 76 65 0d 0a 0d 0a .. .. .. .. .. .. Keep-Alive....
2018-11-05 23:09:16.031 (Jonas Google Kalender) Pushing 'onMessageCallback' on to queue
2018-11-05 23:09:16.031 (Jonas Google Kalender) Processing 'onMessageCallback' message
2018-11-05 23:09:16.031 (Jonas Google Kalender) Calling message handler 'onMessage'.
2018-11-05 23:09:16.031 (Jonas Google Kalender) onMessage called for connection: 127.0.0.1:59704
2018-11-05 23:09:16.040 (Jonas Google Kalender) GET request received.
2018-11-05 23:09:16.040 (Jonas Google Kalender) Pushing 'WriteDirective' on to queue
2018-11-05 23:09:16.044 (Jonas Google Kalender) Processing 'WriteDirective' message
2018-11-05 23:09:16.044 (Jonas Google Kalender) Sending 249 bytes of data
2018-11-05 23:09:16.044 (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
2018-11-05 23:09:16.044 (Jonas Google Kalender) 65 3a 20 4d 6f 6e 2c 20 30 35 20 4e 6f 76 20 32 30 31 38 20 e:.Mon,.05.Nov.2018.
2018-11-05 23:09:16.044 (Jonas Google Kalender) 32 32 3a 30 39 3a 31 36 20 47 4d 54 0d 0a 53 65 72 76 65 72 22:09:16.GMT..Server
2018-11-05 23:09:16.044 (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
2018-11-05 23:09:16.044 (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..
2018-11-05 23:09:16.045 (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
2018-11-05 23:09:16.045 (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
2018-11-05 23:09:16.045 (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
2018-11-05 23:09:16.045 (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.
2018-11-05 23:09:16.045 (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
2018-11-05 23:09:16.045 (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
2018-11-05 23:09:16.045 (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
2018-11-05 23:09:16.045 (Jonas Google Kalender) 79 3e 3c 2f 68 74 6d 6c 3e .. .. .. .. .. .. .. .. .. .. .. y></html>
2018-11-05 23:09:45.606 (Jonas Google Kalender) Pushing 'onHeartbeatCallback' on to queue
2018-11-05 23:09:45.635 (Jonas Google Kalender) Processing 'onHeartbeatCallback' message
2018-11-05 23:09:45.636 (Jonas Google Kalender) Calling message handler 'onHeartbeat'.
tomdh76
Posts: 20
Joined: Saturday 09 September 2017 19:27
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by tomdh76 »

zak45 wrote: Monday 05 November 2018 19:28
zak45 wrote: Monday 05 November 2018 18:55
tomdh76 wrote: Monday 05 November 2018 18:43 It is working as expected in google calendar, thanks a lot! I do not get it to work in outlook, it seems that the ics file generated by outlook always uses \n in the description line like this: DESCRIPTION:#wrk#\n. I think that it does not work in that way. Do you have an idea / suggestion?
Will do some test on my side...
You're right for \n.. new version uploaded. thanks.
Outlook still not working for me. The google buttons look different though (see screenshot)? I really appreciate all your 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 »

TheeDude wrote: Monday 05 November 2018 23:11 Here it comes!
Looks OK.
Now focus on the second process: iCal.sh
you should have this inside: nohup python3 "$@" &
connect on the same user as Domoticz is installed and try to see if you can execute python3 ??

iCal.sh will execute iCal.py, passing all parameters you can see into Domoticz log.
you can even try to copy and paste the full cmd, should work.

if not working:
maybe need to have sudo ?? maybe not able to found in your path ?? etc ...
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 »

tomdh76 wrote: Tuesday 06 November 2018 11:52 Outlook still not working for me. The google buttons look different though (see screenshot)? I really appreciate all your work!
Work at home ....??? !!!!

To be able to debug: need ics file
tomdh76
Posts: 20
Joined: Saturday 09 September 2017 19:27
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by tomdh76 »

zak45 wrote: Tuesday 06 November 2018 12:42
tomdh76 wrote: Tuesday 06 November 2018 11:52 Outlook still not working for me. The google buttons look different though (see screenshot)? I really appreciate all your work!
Work at home ....??? !!!!

To be able to debug: need ics file
Here is the generated ics file from the plugin. I have two test events entered with #wrk#. In the ics file this is in the description followed by \n
Attachments
20iCal.zip
(6.42 KiB) Downloaded 118 times
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: Tuesday 06 November 2018 12:39
TheeDude wrote: Monday 05 November 2018 23:11 Here it comes!
Looks OK.
Now focus on the second process: iCal.sh
you should have this inside: nohup python3 "$@" &
connect on the same user as Domoticz is installed and try to see if you can execute python3 ??

iCal.sh will execute iCal.py, passing all parameters you can see into Domoticz log.
you can even try to copy and paste the full cmd, should work.

if not working:
maybe need to have sudo ?? maybe not able to found in your path ?? etc ...
Hello again!

There we go, thanks for the push in the right direction!
I ran the execute command manually, and got this in "nohup.out"
Spoiler: show
pi@raspberrypi ~/domoticz/plugins/iCal $ cat nohup.out
Traceback (most recent call last):
File "/home/pi/domoticz/plugins/iCal/iCal.py", line 10, in <module>
import requests
ImportError: No module named 'requests'
Installed requests module, and got a new error that I was missing "iCalendar"
So, I guess those modules uninstalled when i was fixing my Python installation, i had to reinstall all modules again from the wiki page, now the devices are created right away!

Time to look in to the calendar functions, if I can trigger something. :)

Thanks for the help!
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: Tuesday 06 November 2018 14:50 Installed requests module, and got a new error that I was missing "iCalendar"
So, I guess those modules uninstalled when i was fixing my Python installation, i had to reinstall all modules again from the wiki page, now the devices are created right away!
Time to look in to the calendar functions, if I can trigger something. :)
Thanks for the help!
Perfect.
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 »

tomdh76 wrote: Tuesday 06 November 2018 13:17 Here is the generated ics file from the plugin. I have two test events entered with #wrk#. In the ics file this is in the description followed by \n
New iCal.py version uploaded. let's try.
thanks.
tomdh76
Posts: 20
Joined: Saturday 09 September 2017 19:27
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by tomdh76 »

zak45 wrote: Tuesday 06 November 2018 18:17
tomdh76 wrote: Tuesday 06 November 2018 13:17 Here is the generated ics file from the plugin. I have two test events entered with #wrk#. In the ics file this is in the description followed by \n
New iCal.py version uploaded. let's try.
thanks.
It seems to work right now! Thanks
brucez
Posts: 15
Joined: Tuesday 19 January 2016 13:39
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by brucez »

Hi all!

The download link is not working. :(
Can you please check it?

Thanks! ;)
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 11 June 2018 20:29 iCal Multi Purpose Multi Language Python Plugin for Domoticz

Main Features
Hello again!

Do you think it would be possible for this script to, instead, write calendar event time to a user variable?
Or maybe both?

Let´s put it this way, if I am using this script to heat my car, let´s say it should be warm 12:00.
And I create an event 12:00 in my calendar, and I would also want that the script put this time in to a uservariable to a script I am using, would this be easy to mange/adapt?

Or is it already possible, just with the use of some other command that you have mentioned in the wiki page?

Edit: This variable also need to be set at least 4 hours before calendar time so to speak, so the car manages to get warm in time.

Edit2: Another idea would be to print out the next event on a text device as a status, like a reminder, but also like a reminder that it works.. :)

Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest