I installed the "Virtual On/Off Switch" plugin from http://apps.mios.com
I have "Occupied" and "Unoccupied" scenes, which run from a "schedule" that I enter containing each guest's date/time of arrival and departure, respectively.
In the "Actions" tab, the "Occupied" scene uses a "settarget" command for my virtual switch to set a "newtargetvalue" to "1". The "Unoccupied" scene sets the "newtargetvalue" to "0".
I use luup code in other scenes that I want to run depending upon the occupied status.
I use the following Luup code in scenes that I only want to run if the home is unoccupied:
--[[OCCDevice is virtual state device, OCC = Occupied, True if unoccupied]]
local OCCDevice = 45
local OCCStatus = luup.variable_get("urn:upnp-org:serviceId:VSwitch1", "Status", OCCDevice) or "0"
if (OCCStatus == "0") then
For scenes that I want to run if occupied, I make the first return "false" and 2nd return "true".
I hope to replace the virtual switch device with the Google Calendar plugin device. To use the google Calendar device, first one enters the guest's reservation as a "event" with a keyword such as "booked" in the calendar. In scenes that run depending upon the occupied or booked status, they enter Luup code similar to the above (except with a different device identifier) to query or get the status of the Google Calendar plugin device. If the calendar has an active event containing the specified key word such as "booked", the "status" is set to "1". If unoccupied, the "status" is set to "0". I had some trouble with my Google Calendar last week so I have to see if that is straightened out first.
I enter my reservation dates in MyVRZone.com, which creates and synchs my reservation Google calendar with my other reservation calendars on VRBO, Homeaway, FlipKey, etc. If I get the Google plugin working, I will only have to enter my reservation dates in MyVRZone.com and it will synch all of my online calendars and avoid the necessity of me to having to enter the dates into my occupied and unoccupied scenes.