Simulated Occupancy

Posted on
Mon Sep 14, 2015 9:20 am
cramer offline
Posts: 33
Joined: Feb 03, 2015

Simulated Occupancy

Hi,

I am currently a Vera user thinking of moving to Indigo. I have a Lua script on Vera that simulates occupancy and would like some direction as to how it can be developed within Indigp, if indeed it can. It works as follows :

A virtual device is defined in Vera that has a GUI which shows a button. The button sets the device in 'Occupied' or 'Unoccupied' mode.

If the switch is set to Unoccupied, the device runs a script which reads an xml file in which sequences of activities are declared (and timings) The script then calls the vera api with instructions e.g. turn on bedroom light, wait 10 seconds, turn on bathroom light, wait 2 minutes, turn off bathroom light, wait 10 seconds, turn off bedroom light. Once the script has completed it's activities, it re-schedules itself to run in, say, 5 minutes where it will check the xml again to see if any activities should be actioned, and so on.

If the button is changed to Occupied, the script terminates if running, and if it is scheduled for a later time, the scheduled item is deleted.

Is this possible within the Indigo environment? If so, can you direct me to documentation that will get me started with a port to Indigo. I don't need any help for the Python side of the process but the Indigo side - creating a virtual device that has a gui, activating a script from within the device, scheduling the execution of a script based on time interval.

Thanks for any help,

Posted on
Mon Sep 14, 2015 11:00 am
DaveL17 offline
User avatar
Posts: 6786
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Simulated Occupancy

Indigo has built-in virtual devices and they work well. It also has timers and Action Groups that, combined with Python, can handle all of this.

I came to Indigo from Vera and have never looked back!

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Tue Sep 15, 2015 1:43 am
Shutter offline
Posts: 345
Joined: Mar 07, 2014
Location: London, UK

Re: Simulated Occupancy

FYI - you could take a look at this plugin to simulate the lights. Randomized Lighting Plugin

Posted on
Tue Sep 15, 2015 11:45 am
jay (support) offline
Site Admin
User avatar
Posts: 18261
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Simulated Occupancy

There are a variety of ways of accomplishing this behavior, and some won't need any scripting (though you could do it with scripts as well).

Your occupancy should be stored in a Variable. Then, you have a schedule that runs every X minutes (or hours, or whatever, and with some randomization if you want). The condition on the schedule is that the occupancy variable is equal to Unoccupied - so the actions will only be executed if the house is Unoccupied. The actions then are the actions you want to perform. Each can have a separate delay associated with it (note that most actions are run in parallel so the delay should be calculated from execution time, not from the end of the prior action).

You can then have a control page that toggles the variable value between Occupied and Unoccupied - or use whatever triggering mechanism you want.

That's just another idea. As I said, lots of choices.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sat Sep 19, 2015 11:02 am
cramer offline
Posts: 33
Joined: Feb 03, 2015

Re: Simulated Occupancy

Thanks everyone. It looks like I need to jump right in. No doubt I will be back for advice as I progress. The Vera system does have the features I was looking for but the system has been to unstable. I am encouraged by your comment DaveL17.

Posted on
Sat Sep 19, 2015 1:05 pm
DaveL17 offline
User avatar
Posts: 6786
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Simulated Occupancy

cramer wrote:
Thanks everyone. It looks like I need to jump right in. No doubt I will be back for advice as I progress. The Vera system does have the features I was looking for but the system has been to unstable. I am encouraged by your comment DaveL17.
I'm sure you will find the community here to be most helpful.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 7 guests