Page 1 of 1

How to detect scenery activation in Z-WAY API?

Posted: 29 Sep 2014 14:21
by dromer1967
I have managed to configure my AEonlabs Minimote to send a scene activation when clicking on a button.

But how can I respond to that in my software?

In other words how do I know, using the Z-WAY API, when a scene is activated (through a click on the Minimote)?

Regards,
Peter

Re: How to detect scenery activation in Z-WAY API?

Posted: 30 Sep 2014 01:06
by PoltoS
If you want only low level Z-Way API, check log to see what data holder stores scenes (it is SceneActivation.data.currentScene) and use .bnid() to trap it. Or use Z-Way Home Automation UI

Re: How to detect scenery activation in Z-WAY API?

Posted: 30 Sep 2014 12:21
by dromer1967
Do you have an example for this? I can't find the use of .bnid() in the documentation (zwayDev.pdf) :(

Also in Home Automation UI I cannot find the Minimote at all.

In the log file I can see the currentscene:

Code: Select all

[2014-09-30 11:08:45.199] RECEIVED: ( 01 0A 00 04 00 04 04 2B 01 01 00 DA )
[2014-09-30 11:08:45.200] SENT ACK
[2014-09-30 11:08:45.200] SETDATA devices.4.data.lastReceived = 0 (0x00000000)
[2014-09-30 11:08:45.200] SETDATA devices.1.instances.0.commandClasses.43.data.srcNodeId = 4 (0x00000004)
[2014-09-30 11:08:45.200] SETDATA devices.1.instances.0.commandClasses.43.data.srcInstanceId = 0 (0x00000000)
[2014-09-30 11:08:45.200] SETDATA devices.1.instances.0.commandClasses.43.data.currentScene = 1 (0x00000001)
[2014-09-30 11:08:45.200] SETDATA devices.1.instances.0.commandClasses.43.data.dimmingDuration = 0 (0x00000000)
[2014-09-30 11:08:45.201] SETDATA devices.4.instances.0.commandClasses.43.data.currentScene = 1 (0x00000001)
[2014-09-30 11:08:45.201] SETDATA devices.4.instances.0.commandClasses.43.data.dimmingDuration = 0 (0x00000000)

Re: How to detect scenery activation in Z-WAY API?

Posted: 01 Oct 2014 00:08
by PoltoS
Of course you can not. I've made a mistake - it is bind() ;)

Code: Select all

zway.devices[4].instances[0].commandClasses[43].data.currentScene.bind(function() {
  switch (this.value) {
    case 1:
      doSomething();
      break;
    case 2:
      doSomethingElse();
      break;
  }
});

Re: How to detect scenery activation in Z-WAY API?

Posted: 01 Oct 2014 21:22
by dromer1967
Thanks for the example.

Unfortunately I can't use it since I don't use java script but HTTP calls.

However, I have found that the CurrentScene is available in the output of the ZWay API call

http://<YOURIP>:8083/ZWaveAPI/Data

under

"devices.1.instances.0.commandClasses.43.data.currentScene"

So I'll use that :)