Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

groups and associations methods not working or incorrectly documented #260

Open
fehguy opened this issue Dec 10, 2018 · 5 comments
Open

Comments

@fehguy
Copy link

fehguy commented Dec 10, 2018

Hi all,
Thanks again for the efforts on this library. I'm having an issue that has been haunting me for a couple days now that I would appreciate some help with.

I'm trying to associate one device (switch A, Node018) with another one (switch B, Node017) such that turning on Switch A will turn on switch B. This is being done with groups, and my devices (both switches) are documented to support them.

There are no existing groups in Switch A, as calling this:

var groups = zwave.getNumGroups(18);
// groups = 0

Creating a group association like such:

var result = zwave.addAssociation(
      18, // nodeId
      0,  // group ID
      17); // targetNodeId
// result == undefined

... followed by getting the groups as above yields an empty array.

Where am I going wrong? I have to believe that this feature is in use by others.

@blackshadev
Copy link
Contributor

Hi,
I don't know if this use of association will have the behavior you stated, as far as I know association is just use to report values "real time". But besides that, the getNumGroups call returns the number of groups the node supports and on which you can add associations, the group index always starts with 1 (not 0). See the openzwave documentation for more info.
So if getNumGroups returns 0 then you have none, if it returns 1 then you have 1 group to add associations for and your call should be zwave.addAssociation(18, 1, 17) . Your comment stated that it returns an empty array.. this shouldn't be possible. What versions of openzwave and this library are you using? Because I couldn't get the function to return an array with any of my Zwave devices.

@fehguy
Copy link
Author

fehguy commented Jan 2, 2019

@blackshadev thanks for the reply. So it seems the addAssociation depends on the source node to have a result from getNumGroups greater than zero. Also I was wrong saying that it returns an empty array. It's an int, I've updated the comment).

But I have never seen any of my 50 devices return a value other than zero for getNumGroups, including the host (Aeotec Z-stick) and a number of GE Z-Wave, Z-Wave plus devices.

Is there any other initialization required to get this function to work? Thank you again for the reply.

@blackshadev
Copy link
Contributor

The Aeontec Z-stick doesn't have any association groups on it, I know that because I have one as well.
Currently in my network I have 2 devices which habe association groups these are the Aeontec 4 in 1 , which has one and pushes 4 values. And a fibaro wall plug, which has 3 association groups, one for the device status, one for the button on the device and one for a trigger based on the power drawn.

After reading into this, the Fibaro manual stated that the 2nd and 3rd association groups can be used to trigger other devices , like you wanted, so this is a valid use case. However it also stated that the data send along with these association groups are based on the Basic command class and send out an "on/off" command, so the device does need to support that.

Since your devices don't return any association groups I think they are designed the other way around: They can receive on/off commands from the basic command class over association groups, but they do not sent our these association groups.
If you have the product name for me I can verify it in the manual for you, if the manual states that it should sent out these association groups you can request all node information again with the refreshNodeInfo(nodeId) function, but the library should do so when you start it up so I don't expect any wonders from that one.

If that doesn't work the problem is in the config file of the device in the "device database" which are just a bunch of XML files provided with the library. Unfortunately I really don't have allot of experience with the device database, but luckily I know a place where there are loads of people that do: The OpenZWave github page. You see this repo is just a wrapper arround a much bigger cpp project called OpenZWave, they will definitely know what to do with it. Do mind, when posting issues over there they really appreciate to have the following information: The product name and maybe even a link to the manual and if you have it a part of the OZW_log.txt if you find anything related to that node and it's association group.

@fehguy
Copy link
Author

fehguy commented Jan 2, 2019

Thanks again for the reply. I have an Aeotec Wallmote that I bought to try to get these associations to work--the idea being that it could trigger a number of other zwave devices. I know that supports groups, so I'll try that tonight to see if I can get a non-zero response from getNumGroups.

@blackshadev
Copy link
Contributor

Hi again,

Wauw those things are beatifull, If I ever need a Zwave enable wall switch /dimmer I will surely get one of these.
Anyway I checked the manual and you are correct , it should absolutely have some association groups , 5 to be precise. If they react to data send over association groups I do not know, but that is not the current issue.
I also checked in the device database for you and I can't find this device in there so either I overlooked or it should be added. Again I have never done that so I can't give you any pointers on that one, but check out this page for more info. And if you require further help use the OpenZWave github, they can most certainly help you out with this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants