Hi @Chris,
I have been digging into your code for the last 4 days and I think that the reason why the .things file does not work is because there is a problem in the code that prevents the nodeID to be assigned correctly to the THING. Maybe it’s because you have never tested the binding with a real .things text file.
1st possible problem:
Inside ZWaveThingsHandler:initialize()
(line 115) your code tries to read the node ID using this piece of code:
String nodeParm = this.getThing().getProperties().get(ZWaveBindingConstants.PROPERTY_NODEID);
but getThing().getProperties()
does not contain any reference to the zwave_nodeid
parameter.
Here is the result of getThing().getProperties()
for 2 different fibaro zWave devices:
getProperties()= {modelId=FGS222, vendor=Fibaro System, defaultAssociations=3, manufacturerId=010F, manufacturerRef=0202:1002, dbReference=124}
getProperties()= {versionMin=2.1, modelId=FGD211, vendor=Fibaro System, defaultAssociations=3, manufacturerId=010F, manufacturerRef=0100:0107,0100:0109,0100:300A,0100:100A,0100:0104,0100:0106, dbReference=119}
As you can see you can retrieve many information, but not the zwave_nodeid
, so your initialize()
method does not proceed and we get the error in the log:
NodeID is not set in zwave:fibaro_fgs222_00_000:node3
2nd possible problem:
Another point of failure is inside ZWaveConfigProvider:getConfigDescription
and ZWaveConfigProvider:getParameterOption
where there is this piece of code:
if ("thing".equals(uri.getScheme()) == false) {
return null;
}
Because all the Things from the .things file have uri.getScheme() == 'thing-type'
, the mehod returns and the following code that should set the nodeID is never executed:
// And make sure this is a node because we want to get the id off the end...
if (!thingUID.getId().startsWith("node")) {
return null;
}
Here is the .things file that I have used:
Bridge zwave:serial_zstick:controller [ port="/dev/ttyACM0"] { Thing fibaro_fgs222_00_000 node3 [] Thing fibaro_fgd211_02_001 node8 [] }
And in order to avoid auto_approve of the things discovered in the inbox, I have set in conf/services/runtime.cfg:
set autoapprove:enabled=false
I hope I have contributed to find the problem that prevents the .things file to load correctly
EDIT:
3rd possible problem:
in the .xml files of the zwave devices (…/ESH-INF/thing/) there is no definition of the parameter “zwave_nodeid
” that is used in the code.