We have moved at community.getvera.com

Author Topic: CODE: Public Holiday virtual switch  (Read 50962 times)

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3260
  • Karma: +192/-9
Re: CODE: Public Holiday virtual switch
« Reply #30 on: April 27, 2011, 07:48:42 am »
It affects the order list in the display, not the end result, is this correct ?

Correct.  Purely visual.

Offline markbannister

  • Full Member
  • ***
  • Posts: 113
  • Karma: +1/-0
Re: CODE: Public Holiday virtual switch
« Reply #31 on: April 27, 2011, 09:48:09 am »
As always I can't figure the easy stuff out.
Installed it all.  Created a calendar on my web server.  Holidays show up.
Go to use it in a scene. Events - add - device (select holiday device) - "what type of event is the trigger" just says "please select" and I have no other choices.
What silly thing am I doing wrong?

Offline Ap15e

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1998
  • Karma: +12/-0
Re: CODE: Public Holiday virtual switch
« Reply #32 on: April 27, 2011, 10:06:09 am »
Quote
What silly thing am I doing wrong?

You're using UI4 ...  :)

@futzle
Please add the event list to the json file to support events for UI4 (http://forum.micasaverde.com/index.php?topic=3801.msg18984#msg18984).
« Last Edit: April 27, 2011, 10:08:29 am by Ap15e »

Offline markbannister

  • Full Member
  • ***
  • Posts: 113
  • Karma: +1/-0
Re: CODE: Public Holiday virtual switch
« Reply #33 on: April 27, 2011, 10:10:49 am »

@futzle
Please add the event list to the json file to support events for UI4 (http://forum.micasaverde.com/index.php?topic=3801.msg18984#msg18984).

Yes UI4.  Can't get to the link you posted. :(

Offline Ap15e

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1998
  • Karma: +12/-0
Re: CODE: Public Holiday virtual switch
« Reply #34 on: April 27, 2011, 10:16:25 am »
The relevant part from http://forum.micasaverde.com/index.php?topic=3801.msg18984#msg18984 is:

Quote
UI2 scenes/events definitions are not compatible with UI3/4, since after UI2 json data wasn't stored in xml files anymore.
You need to create a json file with sceneList and eventList which were previously stored in xml file, [...]

Offline markbannister

  • Full Member
  • ***
  • Posts: 113
  • Karma: +1/-0
Re: CODE: Public Holiday virtual switch
« Reply #35 on: April 27, 2011, 10:19:07 am »
The relevant part from http://forum.micasaverde.com/index.php?topic=3801.msg18984#msg18984 is:

Quote
UI2 scenes/events definitions are not compatible with UI3/4, since after UI2 json data wasn't stored in xml files anymore.
You need to create a json file with sceneList and eventList which were previously stored in xml file, [...]

...not quite sure what that means....

Offline MNB

  • Hero Member
  • *****
  • Posts: 689
  • Karma: +4/-9
Re: CODE: Public Holiday virtual switch
« Reply #36 on: April 27, 2011, 02:23:02 pm »
The current "I".xml file doesn't sort the future holidays. If the holidays in the ics file are unsorted, so are the holidays on the 'Control' tab. Please ask futzle to implement your feature request.
Thanxs @Ap15e, I will manually sort the ICS file as suggested, as it's a "purely visual" issue, many thanxs to both your self and @futzle for the capability and features. Mike
Edge-1.7.2607, VRI06-1LX Dimr (6), VS05-1LX Sw (4), GE ZW3002 Dimr (1), HA01C Outlet (12), HA02C Sw (6), HA04C Sw (4), GE Sw (2), HA05 Sw (3), MiniMote Contr (5), HSM200/100 Sensor (2), ZW100A Sensor (8), Nest thermostat (1) & Protect Fire/CO (6) Kwikset Locks (3), F18918W (1) & IP3M-9 (6) Cam's

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3260
  • Karma: +192/-9
Re: CODE: Public Holiday virtual switch
« Reply #37 on: April 27, 2011, 06:22:46 pm »
The relevant part from http://forum.micasaverde.com/index.php?topic=3801.msg18984#msg18984 is:

Quote
UI2 scenes/events definitions are not compatible with UI3/4, since after UI2 json data wasn't stored in xml files anymore.
You need to create a json file with sceneList and eventList which were previously stored in xml file, [...]

...not quite sure what that means....

It's aimed at me.  The D_* files I've supplied were hacked from a Vera UI2 original, and the file format has changed a bit for UI4.

I'll stick it on my to-do list for the plugin.  It's getting quite long...  Meanwhile you can make the scene conditional on the Status of the device, by making a scene run every day at x o'clock, and putting this into the scene's "Luup" tab:

Code: [Select]
-- Replace 74 with your Holiday device's id.
-- "1" means run this scene only on holidays.  Use "0" for inverse.
return luup.variable_get("urn:upnp-org:serviceId:SwitchPower1", "Status" ,74) == "1"

Offline iflyM3

  • Full Member
  • ***
  • Posts: 144
  • Karma: +0/-0
Re: CODE: Public Holiday virtual switch
« Reply #38 on: April 27, 2011, 09:53:01 pm »
@futzle

You definitely have your work cut out for you.  lol.  Take your time, man.  No rush.  Thanks again for this useful plugin and I look forward to the updated versions.   Don't stop and keep up the good work!!!  :)

I really have to learn how to create plugins myself so that I can assist, I'm slowly warming up to Lua. lol.  I'll get there one of these days.
Vera 2 UI5 (1.5.622)... and too many Z-Wave/Ethernet/Wi-Fi devices to list.

Offline Ap15e

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1998
  • Karma: +12/-0
Re: CODE: Public Holiday virtual switch
« Reply #39 on: April 28, 2011, 11:22:09 am »
... and here comes my final contribution to the PHVS with a fix for the order of future holidays.

Offline MNB

  • Hero Member
  • *****
  • Posts: 689
  • Karma: +4/-9
Re: CODE: Public Holiday virtual switch
« Reply #40 on: April 28, 2011, 01:13:13 pm »
... and here comes my final contribution to the PHVS with a fix for the order of future holidays.

@Ap15e "you da man (person)" ;D... many thanxs. Mike
Edge-1.7.2607, VRI06-1LX Dimr (6), VS05-1LX Sw (4), GE ZW3002 Dimr (1), HA01C Outlet (12), HA02C Sw (6), HA04C Sw (4), GE Sw (2), HA05 Sw (3), MiniMote Contr (5), HSM200/100 Sensor (2), ZW100A Sensor (8), Nest thermostat (1) & Protect Fire/CO (6) Kwikset Locks (3), F18918W (1) & IP3M-9 (6) Cam's

Offline cedriclocqueneux

  • Jr. Member
  • **
  • Posts: 79
  • Karma: +0/-0
Re: CODE: Public Holiday virtual switch
« Reply #41 on: May 06, 2011, 06:59:02 am »
It works great !

But i try with Google Calendar and the public ics link. I create an event, for the entire day, but i have nothing in status or futur holidays. Is there a special setting for events in Google Calendar ?

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3260
  • Karma: +192/-9
Re: CODE: Public Holiday virtual switch
« Reply #42 on: May 06, 2011, 07:29:22 pm »
Hi cedriclocqueneux,

But i try with Google Calendar and the public ics link. I create an event, for the entire day, but i have nothing in status or futur holidays. Is there a special setting for events in Google Calendar ?

My code only handles a tiny subset of the full ics file format.  Perhaps there's something in the Google Calendar file that my code doesn't recognize.

Are you able to post the text from the ics file here, so I can see how I need to change my code to support it?  They're just text files, so just open it up in a text editor and copy and paste it into a post.

Offline cedriclocqueneux

  • Jr. Member
  • **
  • Posts: 79
  • Karma: +0/-0
Re: CODE: Public Holiday virtual switch
« Reply #43 on: May 09, 2011, 03:52:23 am »
Hi,

You can find example with this link, it's a public calendar that i created: http://www.google.com/calendar/ical/locqueneux.com_t1gtpkp9khpee7dno2d50dbtg4%40group.calendar.google.com/public/basic.ics

I think there is a problem with recurrent event.
If i create lots of event one by one, all are listed on the Vera (on futur holidays)
If i create a recurrent event (for example each Wednesday or each year ), the plugin take only the first event, and ignore the other.

You're plugin is great, and i want to use it for holidays, but also for birthdays, or also for rubbish collection day, per example. We can make lots of useful things :D So, reccurent event will be very usefull.

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3260
  • Karma: +192/-9
Re: CODE: Public Holiday virtual switch
« Reply #44 on: May 09, 2011, 05:11:39 am »
You can find example with this link

Got it, thanks.  Yes, recurring events are a known shortcoming.  They are definitely on the to-do list.  I'll focus on the types of recurrences that I see in your ICS file ("every second Thursday"; "every day for 20 days").