Closed robertsLando closed 5 years ago
Is there any updates on this? I require MultiChannel Associations for a multi sensor. Or can I help somewhere, if so can anyone give me some pointers?
I checked the docs and it seems that the instanceId is a seperate parameter which is currently unused. I forked the repo and added a 4th parameter to both AddAssociation and RemoveAssociation for the instance with as default 0, this is just like how it works in the underlaying openZwave. I still need to test the code but I am waiting for my Linux VM to update and install openzwave. so either take a chance and use mine, or wait until I tested it and I will create a pull request
edit: https://github.com/blackshadev/node-openzwave-shared/tree/feature/association-instanceid
PR was just merged, thank you all!
@blackshadev unless I am missing something the current version allows to add and remove multi channel associations but not to query them from the group. How do you do this?
@blackshadev unless I am missing something the current version allows to add and remove multi channel associations but not to query them from the group. How do you do this?
I am not sure actually, it was quite a time ago that I made this, But i think I just read the manual from the component to do this. I did not query them from software or what so ever, if openZwave has support for it, can you link me the api docs, I can add it for you.
@cburghardt check https://github.com/OpenZWave/node-openzwave-shared/blob/master/README-api.md and search for GetAssociations. Is that what you are looking for?
No but the getAssociationsInstances which I added with my PR ;)
I'm tring to add/remove associations, my device has support for multi-channel associations but there is no way to specify the target instance using the APIs provided for group/associations management.
I explain my case: my device is a thermostat and has 5 instances:
In Open Zwave control panel I can set the target node instance using
<nodeID>.<instanceID>
notation but this seems not working using the openzwave-shared lib.I'm also tring to remove and add the controller to lifeline group of node 2 and I'm able to add it but not to remove it:
Removing controller (id 1) from lifeline group (1) of nodeid 2
Command used:
zwave.removeAssociation(2, 1, 1);
Add controller to lifeline group (1) of nodeid 2 (not working):
Command used:
zwave.addAssociation(2, 1, 1);
No error is thrown but the controller is not add to the group (as you can see from the getAssociations() call that result is [])
I think the main problem can be find in this lines:
Remove association:
2018-06-27 06:33:42.378 Info, Node002, MultiChannelAssociation::Remove - Removing instance 0 on node 1 from group 1 of node 2
Add association:2018-06-27 06:45:05.246 Info, Node002, MultiChannelAssociation::Set - Adding instance 1 on node 1 to group 1 of node 2
The instance 1 of node 1 doesn't exist (as the controller is not multichannel instance) and there is no way to specify it using the APIs, the API should use by default instance 0 of controller and should also provide a way to specify it in the api call.
The apis should work like:
zwave.addAssociation(nodeid, group, target_nodeid.target_instanceID); zwave.removeAssociation(nodeid, group, target_nodeid.target_instanceID);
if the
target_nodeid
hasn't the dot the default instance is used (root instance id 0).Here the link to multi instance support in open-zwave lib: https://github.com/OpenZWave/open-zwave/blob/master/cpp/src/Group.cpp#L269