ioBroker / ioBroker.zwave

Legacy Z-Wave integration using OpenZWave
Other
24 stars 7 forks source link

It is not possible to change z-wave values with type="list". #108

Open hr-117 opened 4 years ago

hr-117 commented 4 years ago

I'm not sure if I misst something. But my current understanding is that it is not possible to change z-wave values with type="list".

    <Instance index="1"/>
    <Value genre="user" index="0" instance="1" label="Mode" type="list">

This seems to be an old issue: https://forum.iobroker.net/topic/9261/eurotronic-spirit-z-wave-plus-%C3%BCbernimmt-keinen-schaltpunkt/78 with an workaround. But it seems still not be solved. In function extendChannel the states object is created from OZW valueId.values.

                    for (var i = 0; i < valueId.values.length; i++) {
                        stateObj.common.states[i] = valueId.values[i];
                        if (valueId.values[i] === value) value = i;
                    }

The OZW value is converted to the indes of valueId.values. To:

    "0": "Off",
     "1": "Heat",
    "2": "Heat Econ",
    "3": "Full Power",
    "4": "Manufacturer Specific"
    }

If one change the state of an object in iobroker the adapter function stateChange is called with state.val as id (0..49 not the label). This value is then send directly to OZW with zwave.setValue(valueID, value);.