Double-click GE/Jasco devices

Discussions about Z-Way software and Z-Wave technology in general
Post Reply
jhmartin
Posts: 29
Joined: 14 Apr 2015 02:52

Double-click GE/Jasco devices

Post by jhmartin »

I have GE/Jasco ON/Off switches. I'd like to configure them such that if someone does a 'off' operation twice in X seconds on a given switch that it'll trigger a scene. The switches do not support associations, but I believe Niffler can see them.

So for example, the switch at the base of the stairwell would normally be on/off for the stairs light, but if it is double-clicked off then it would trigger the scene that turns off all lights downstairs.

Any suggestions on how to do this?

jensmoes
Posts: 57
Joined: 10 Jan 2015 21:48
Location: San Diego
Contact:

Re: Double-click GE/Jasco devices

Post by jensmoes »

You can create a user module and in the init method subscribe to metric changes in level like this:

Code: Select all

//Define change handler
this.levelChanged = function (virtualDevice) {
        if(virtualDevice.SwitchBinary.data.level.value === false){
        //Do something, compare with timestamp of last time this happened for example             
        }
    };
//Bind the handler to level changes
this.controller.devices.on('change:metrics:level', this.levelChanged);
Then when they occur you can query the device, to ensure you got the one you are looking for, and calculate if you need to execute an action and do what you need it to do.
This is just pseudo code for the purpose of describing the concept, the developer documentation describes in detail how to access virtual devices.

jhmartin
Posts: 29
Joined: 14 Apr 2015 02:52

Re: Double-click GE/Jasco devices

Post by jhmartin »

Thank you, that points me in the right direction.

Post Reply