How to detect scenery activation in Z-WAY API?

Discussions about RaZberry - Z-Wave board for Raspberry computer
Post Reply
dromer1967
Posts: 14
Joined: 24 Sep 2014 17:57

How to detect scenery activation in Z-WAY API?

Post 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

User avatar
PoltoS
Posts: 5622
Joined: 26 Jan 2011 19:36

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

Post 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

dromer1967
Posts: 14
Joined: 24 Sep 2014 17:57

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

Post 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)

User avatar
PoltoS
Posts: 5622
Joined: 26 Jan 2011 19:36

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

Post 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;
  }
});

dromer1967
Posts: 14
Joined: 24 Sep 2014 17:57

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

Post 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 :)

Post Reply