After looking at the Energy Monitor codebase, I think there are enough “bits” to build a Vacation-Mode Plugin, something that records a few days worth of Lighting activity into a Calendar, and then can be set to “playback” these events.
I’ve done some experiments using [tt]curl[/tt] to PUT Calendar events into Google Calendar using CalDAV, and these are working fine.
Currently I’m experimenting using iCal entries like the following for the “Record” function:
[tt] BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//MiOS Vacation Plugin//CalDAV Client//EN
BEGIN:VEVENT
UID:20100712T182145Z-123401@example.com
DTSTAMP:20100613T202145Z
DTSTART:20100613T170005Z
DTEND:20100613T170100Z
SUMMARY:Set Kitchen Main Light to 50%
DESCRIPTION:A Test Calendar entry to be created by the Vera Vacation Plugin.\n\nBEGIN-MiOS\nluup.call_action(“urn:upnp-org:serviceId:Dimming1”, “SetLoadLevelTarget”, {newLoadlevelTarget=“30”}, 45)\n\END-MiOS
CLASS:PRIVATE
END:VEVENT
END:VCALENDAR
[/tt]
and I can’t make up my mind whether to use the “[tt]SUMMARY[/tt]” Field, with a human-readable command like:
[tt] Set Kitchen Main Lights to 50%[/tt] - For Dimmers
[tt] Set Living Picture Light to On[/tt] - For Switches/Dimmers
[tt] Set Master Bedroom Light to Off[/tt] - For Switches/Dimmers
which I’ll parse out and build the Vera command…
Or something like what I’ve done in the “[tt]DESCRIPTION[/tt]” Field, which contains a pure-lua snippet between [tt]BEGIN-MiOS/END-MiOS[/tt] Tagging:
[tt] A Test Calendar entry to be created by the Vera Vacation Plugin.\n\nBEGIN-MiOS\nluup.call_action(“urn:upnp-org:serviceId:Dimming1”, “SetLoadLevelTarget”, {newLoadlevelTarget=“30”}, 45)\n\END-MiOS[/tt]
The latter is much more flexible, since you could put just about any Lua/Luup code in there and have it execute (all Security issues aside
The former is much easier for folks to read, and potentially manually create, as long as the Device Descriptions are unique enough. If folks have non-unique Device Labels, then the syntax would need to be augmented with the DeviceID as in:
[tt] Set Kitchen Main Lights #54 to 50%[/tt] - For Dimmers
Since it’s going to chew up a bunch of time to write this, anyone have any opinions on which style they’d prefer to see?
Anyhow, my goal is to let Vera record, and then playback, events from a [remote] Calendar (Google, to start with, Yahoo next, and then any CalDAV server eventually). Letting it capture Lighting information (initially) so you can drive “away/vacation” schedules, and make your house look really lived in (since it will have followed real activity for a few days, recording all the Lighting “action” going on)
Anyone interested and/or have thoughts on it?
Once I get enough bits, I’ll request a code.mios.com space for it and my test files.