Enocean PTM 216Z: missing command
See original GitHub issueHi @Koenkk, I’ve already created an issue in the zigbee2mqtt repository for this topic (Koenkk/zigbee2mqtt#13804), but after some investigation I think I’ve found the problem, which is related to the converter.
In the following snippet the ID is put together by the commandID and the whole commandFrame. https://github.com/Koenkk/zigbee-herdsman-converters/blob/811789fbae0d3570d666f1141dde2b9091a9a99a/converters/fromZigbee.js#L5122
According to the log, the commandFrame does include more than the needed information. For example if I press the top left button the following commandID and commandFrame is sent:
data '{"commandFrame":{"raw":{"data":[1,254,165,76],"type":"Buffer"}},"commandID":105
The expected ID is 105_1
but with the code mentioned above the ID is 105_1_254_165_76
. So only the first item of the commandFrame must be appended. The last item (here value 76) seems to be the link quality.
What do you think about this?
I use zigbee2mqtt as an addon in home assistant and unfortunately I do not know how I could test the adaption.
Best regards,
Thorsten
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Great, integrated the fix!
Changes will be available in the dev branch in a few hours from now. (https://www.zigbee2mqtt.io/advanced/more/switch-to-dev-branch.html)
After changing the line to
const ID = '${commandID}_${msg.data.commandFrame.raw.slice(0,1).join('_')}';
and adding the lineconst { precisionRound, mapNumberRange, isLegacyEnabled, toLocalISOString, numberWithinRange, hasAlreadyProcessedMessage, calibrateAndPrecisionRoundOptions, addActionGroup, postfixWithEndpointName, getKey, batteryVoltageToPercentage, getMetaValue, } = require('zigbee-herdsman-converters/lib/utils');
it is working!Thanks a lot!