dBeau
Active Member
I am trying to get started with scripting in Premise. I've been looking for just the right example and just the right task to get me started. I noticed that the beam sensor in the garage that indicates the presence of a car doesnt keep the garage "occupied" after the timer expires. The sensor stays in the triggered state as long as a car is there but after the 10min (occupancy timeout) it does not reset the occupancy timer. I'd like to fix this.
A couple of thoughts came to mind: A special sensor class could be created with it's own timer. Every 60 seconds or so, the timer would fire and check the state of the sensor. If the sensor is still in the triggered state, it could re-assert the occupancy for the room. Even fancier would be a global collection of occupancy sensors that get checked every 60 seconds or so. When triggered, a sensor could add itself to the collection. It could be automatically removed when it is no longer triggered.
Perhaps there is a better way to solve this problem. I'd be interested in hearing about it, but then I'd have to come up with another idea for scripting. Like...
How about a garage door object, for example. It would bind to a couple of sensors that indicate the position of the door (up or down) and also have a up button and down button to trigger Elk tasks that perform the function. From what I've seen of Premise so far, it should be more than capable of doing this. I'm looking for pointers on how to get started.
A couple of thoughts came to mind: A special sensor class could be created with it's own timer. Every 60 seconds or so, the timer would fire and check the state of the sensor. If the sensor is still in the triggered state, it could re-assert the occupancy for the room. Even fancier would be a global collection of occupancy sensors that get checked every 60 seconds or so. When triggered, a sensor could add itself to the collection. It could be automatically removed when it is no longer triggered.
Perhaps there is a better way to solve this problem. I'd be interested in hearing about it, but then I'd have to come up with another idea for scripting. Like...
How about a garage door object, for example. It would bind to a couple of sensors that indicate the position of the door (up or down) and also have a up button and down button to trigger Elk tasks that perform the function. From what I've seen of Premise so far, it should be more than capable of doing this. I'm looking for pointers on how to get started.