Power toggle with dim levels

  • 70 Views
  • Last Post 06 October 2015
Dignan17 posted this 06 October 2015

There are a couple instances where I'd like to be able to power toggle a device within a scene, but have it go to a specific dim level (not all devices return to the last dim level).

For example, I have a scene that does nothing but turn my nightstand light off. That scene is tied to a button on a Minimote. I'd like instead for that button to toggle the behavior of that lamp, but I don't want it to turn on to full power.

Is something like that possible?

rscott posted this 06 October 2015

There are a couple instances where I'd like to be able to power toggle a device within a scene, but have it go to a specific dim level (not all devices return to the last dim level).

For example, I have a scene that does nothing but turn my nightstand light off. That scene is tied to a button on a Minimote. I'd like instead for that button to toggle the behavior of that lamp, but I don't want it to turn on to full power.

Is something like that possible?


Right now you'd need to create a script that runs with the scene to accomplish this. You can also submit a request to add this feature (http://incontrolha.uservoice.com)


using System;
using System.Collections.Generic;
using System.Text;
using MLS.ZWave.Service.Rules;
using MLS.ZWave.BusinessObjects;

///
/// ALWAYS MAKE COPIES OF SCRIPTS YOU INTEND TO CUSTOMIZE OR YOUR CHANGES
/// COULD BE LOST.
///

public class TurnOffOrSetLevel : ScriptBase, ScriptInterface {
public void runScript() {
try {

// Find your short id by double-clicking your device inside InControl
// Replace '15' in the statement below
var node = base.getNodeByShortId(15);

if (node.level == 0) {
// Node is off; turn on and set node to 40%
setDeviceLevel(node.deviceId, 40);
} else {
// Node is on, just turn it off
setDeviceLevel(node.deviceId, 0);
}


} catch (Exception ex) {
// Log the exception here
var message = ex.Message;
}
}
}

Close