Sapphire custom scripting and timers

DLaPlace

New member
How hard would it be to have a custom script created so that a Sapphire could have a series of buttons set up for different scenes? Once an individual scene button is pressed, the sapphire will run the scene and then after 6 hours the scene will be turned off automatically. How hard would that be to create?
 
That should be fairly straightforward to do. Is this something you are wanting to write or something you are asking us to write?
 
I would be interested in learning how we can do this. Would also like to include the other Canadian techs in this application as well.
 
Timer functionality script has been posted to the Field Service files site. This script has three configuration options:
  • Channels - CSV List of channels that this timer should apply to, ex: 1,2,3,4,5
  • Time - time in seconds for the timer. A single timer can be set and it applies to all channels, ex: 30=30 seconds. If the value is set to. Max value is currently set to 9 hours, however, this could be extended if needed.
  • Reset on Zero - if set to 1, the timer will "reset" anytime the channel level goes to 0. If set to 0, the timer will not.
A few operational notes:
  • Although the timer for each channel is independent, the same time is used for all channels
  • The timer starts when each channel goes to a state > 0
  • This timer is independent of but could also have a complex relationship with DRC, sensors, or other things on the network as they do not know about each other and all timers run independently.

If timer reset on zero is set to 0 (do not reset), and timer is set to 30 minutes, behavior is as follows:
  • User turns on lighting level at 8:00am. Off time is set for 8:30am
  • User adjust light level to 75% at 8:05am
  • User turns lights off at 8:15am
  • User turns lights on at 8:25am
  • At 8:30am, lights are automatically shut off
If timer reset on zero is set to 1 (reset on 0), and timer is set to 30 minutes, behavior is as follows:
  • User turns on lighting level at 8:00am. Off time is set for 8:30am
  • User adjust light level to 75% at 8:05am
  • User turns lights off at 8:15am
  • User turns lights on at 8:25am, Off time set for 8:55am.
  • At 8:30am, lights remain on
    • timer was reset at 8:15 at lights didn't turn on at 8:25am
  • At 8:55am, lights shut off

This script can be integrated into other packages, just be aware of and think through interacting business logic.
 
Hi David,

Is it possible to have two independent timers running? Let's say we want to have channels 1, 2, 3 on a timer and channels 4, 5, 6 on a separate timer. Would this be possible?
 
Back
Top