Python Plugin : iCal Multi Purpose Python Plugin for Domoticz

Python and python framework
zak45
Posts: 574
Joined: Sunday 22 January 2017 12:37
Target OS: Windows
Domoticz version: V4.10171
Contact:

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

Post by zak45 » Friday 16 November 2018 19:27

brucez wrote:
Thursday 15 November 2018 22:16
Hi all!

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

Thanks! ;)
checked and working.

zak45
Posts: 574
Joined: Sunday 22 January 2017 12:37
Target OS: Windows
Domoticz version: V4.10171
Contact:

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

Post by zak45 » Friday 16 November 2018 19:40

TheeDude wrote:
Friday 16 November 2018 17:04
Do you think it would be possible for this script to, instead, write calendar event time to a user variable?
Or maybe both?
Hi, not sure to really had understood all.. but here are some possibilities:

Create a switch in domoticz (dummy switch)
On the On action you can put the script command to create the uservariable into domoticz (few lines only will do the trick)
On your calendar you have to create an entry like that : #cmd#yourswitchname:On:0
for your required date/time

TheeDude
Posts: 44
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 » Friday 16 November 2018 19:51

zak45 wrote:
Friday 16 November 2018 19:40
TheeDude wrote:
Friday 16 November 2018 17:04
Do you think it would be possible for this script to, instead, write calendar event time to a user variable?
Or maybe both?
Hi, not sure to really had understood all.. but here are some possibilities:

Create a switch in domoticz (dummy switch)
On the On action you can put the script command to create the uservariable into domoticz (few lines only will do the trick)
On your calendar you have to create an entry like that : #cmd#yourswitchname:On:0
for your required date/time
The problem I am having with this is that if I want to leave 12:00, I need to set calendar switch on time to 08:00, it will start a (timer) switch that is calculating outside temperature, and depending of the outside temperature the preheating progress is starting some time between 30 minutes and 4 hours before I leave.

I would like to set my departure time instead of -4 hours in my calendar, and that time will then end up in a user variable and control it from that.
Now I always have to think in my head when I make the calendar entry, -4 hours, not a big problem I agree, but would be nice to solve!

Why I am having this problem is that I am working shift hours, irregular hours, and I have my shift schedule in a google calendar.

If I create a dummy switch as you said, it wouldn´t solve the problem that I have to think 4 hours ahead, or would it?

zak45
Posts: 574
Joined: Sunday 22 January 2017 12:37
Target OS: Windows
Domoticz version: V4.10171
Contact:

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

Post by zak45 » Saturday 17 November 2018 12:14

TheeDude wrote:
Friday 16 November 2018 19:51
If I create a dummy switch as you said, it wouldn´t solve the problem that I have to think 4 hours ahead, or would it?
this will not work in this case...Now, if your working time is more or less, always the same, you can create this scenario from your shift start.
Let's suppose: working time is 8 hours.
You can in this case create your calendar entry from the start and say to execute the command 4 hours after.

Edit:
even more simple is to create an event (device) based on your At work device name e.g.

commandArray = {}

if devicechanged['Google at work'] == "On" then

commandArray['Yourdevice'] = 'On AFTER 4 HOURS'

end

return commandArray

TheeDude
Posts: 44
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 » Tuesday 20 November 2018 7:38

zak45 wrote:
Saturday 17 November 2018 12:14
TheeDude wrote:
Friday 16 November 2018 19:51
If I create a dummy switch as you said, it wouldn´t solve the problem that I have to think 4 hours ahead, or would it?
this will not work in this case...Now, if your working time is more or less, always the same, you can create this scenario from your shift start.
Let's suppose: working time is 8 hours.
You can in this case create your calendar entry from the start and say to execute the command 4 hours after.

Edit:
even more simple is to create an event (device) based on your At work device name e.g.

commandArray = {}

if devicechanged['Google at work'] == "On" then

commandArray['Yourdevice'] = 'On AFTER 4 HOURS'

end

return commandArray
But I want this to execute 4 hours before, not after!
This is what I want to accomplish, https://github.com/riksarchen/carheater_domoticz <-- Step 1, INSTALLATION: First of all you need to install BakSeeDaa's google calendar script is obsolete, and dont´work anymore..

That is a secondary issue though,
I haven´t got it running just yet.
In my .ics file I have a couple of entries that loops/repeat in a 5 week period, and none of them are working.
If I create a "test" entry, it does however work, and I am having problem figuring out why.
Is it because of the timezone entry? Can you check this out?

Here you have a working entry:
Spoiler: show
BEGIN:VEVENT
DTSTART:20181119T160000Z
DTEND:20181119T200000Z
DTSTAMP:20181120T051819Z
UID:xxxxxxxxxxxxxxxxxxxxxx
CREATED:20181119T144653Z
DESCRIPTION:#cmd#Timer Motorvärmare Jonas:switch:On
LAST-MODIFIED:20181119T144716Z
LOCATION:
SEQUENCE:1
STATUS:CONFIRMED
SUMMARY:test igen..
TRANSP:TRANSPARENT
END:VEVENT
And here you a non working entry:
Spoiler: show
BEGIN:VEVENT
DTSTART;TZID=Europe/Stockholm:20151029T003000
DTEND;TZID=Europe/Stockholm:20151029T043000
RRULE:FREQ=WEEKLY;WKST=MO;INTERVAL=5;BYDAY=TH
DTSTAMP:20181120T051819Z
UID:xxxxxxxxxxxxxxxxxxxxxxx
CREATED:20150612T124040Z
DESCRIPTION:#cmd#Timer Motorvärmare Jonas:switch:On
LAST-MODIFIED:20181116T173433Z
LOCATION:
SEQUENCE:3
STATUS:CONFIRMED
SUMMARY:Förmiddagsskift vardag
TRANSP:OPAQUE
END:VEVENT

zak45
Posts: 574
Joined: Sunday 22 January 2017 12:37
Target OS: Windows
Domoticz version: V4.10171
Contact:

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

Post by zak45 » Tuesday 20 November 2018 12:47

TheeDude wrote:
Tuesday 20 November 2018 7:38

But I want this to execute 4 hours before, not after!
If you think in different way, mean from start, this is why I said AFTER.
working hour for today :
start at 08:00 AM
end 04:00 PM
when switch Google-At work will be set to 'On', this will execute some other task 4 hours AFTER, which is 4 hours BEFORE the end.

for you calendar entry, this is the reason :
RRULE:FREQ=WEEKLY;WKST=MO;INTERVAL=5;BYDAY=TH

the rrule has not been yet implemented (reccuring rule:), will see how to deal with that when had some times...

TheeDude
Posts: 44
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 » Wednesday 21 November 2018 8:56

zak45 wrote:
Tuesday 20 November 2018 12:47
TheeDude wrote:
Tuesday 20 November 2018 7:38

But I want this to execute 4 hours before, not after!
If you think in different way, mean from start, this is why I said AFTER.
working hour for today :
start at 08:00 AM
end 04:00 PM
when switch Google-At work will be set to 'On', this will execute some other task 4 hours AFTER, which is 4 hours BEFORE the end.

for you calendar entry, this is the reason :
RRULE:FREQ=WEEKLY;WKST=MO;INTERVAL=5;BYDAY=TH

the rrule has not been yet implemented (reccuring rule:), will see how to deal with that when had some times...
Oh, that is an idea!
I will try this some day!

Thanks, good to know that there was a reason for this, now I can stop pulling my hair. :)
I will put in theese manually for a couple of weeks then, and hope that this rrule can be implemented in the future. :)

zak45
Posts: 574
Joined: Sunday 22 January 2017 12:37
Target OS: Windows
Domoticz version: V4.10171
Contact:

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

Post by zak45 » Thursday 29 November 2018 18:54

New version uploaded.
Manage now recurrent rule (rrule).
for existing installation, only replace iCal.py & en_en.lng

TheeDude
Posts: 44
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 » Saturday 01 December 2018 14:29

zak45 wrote:
Thursday 29 November 2018 18:54
New version uploaded.
Manage now recurrent rule (rrule).
for existing installation, only replace iCal.py & en_en.lng
Thank you! I will try it out next week!

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests