The new version of Zigbee2MQTT (Z2M) adds new features and improvements, but occasionally, they can break compatibility with existing devices :).
If your PTVO-based devices do not work in the latest version (Z2M shows the “Unsupported” status for your device), it seems, you should update a custom converter for it.
Option #1
You can re-create a converter in the latest version of Firmware Configurator, update it in the “data” folder, and restart Z2M.
Option #2
Or, if you cannot remember a configuration of your old device, and therefore re-create a converter, you can edit the existing file:
- Find your custom converter “.js” file in the “data” folder of your Z2M installation.
- Replace the following lines at the beginning of that file.
- Restart Z2M.
Replace #1
1
2 const fz = zigbeeHerdsmanConverters.fromZigbeeConverters;
const tz = zigbeeHerdsmanConverters.toZigbeeConverters;
to
1
2 const fz = zigbeeHerdsmanConverters.fromZigbeeConverters || zigbeeHerdsmanConverters.fromZigbee;
const tz = zigbeeHerdsmanConverters.toZigbeeConverters || zigbeeHerdsmanConverters.toZigbee;
Replace #2
1 const ptvo_switch = zigbeeHerdsmanConverters.findByDevice({modelID: 'ptvo.switch'});
to
1 const ptvo_switch = (zigbeeHerdsmanConverters.findByModel)?zigbeeHerdsmanConverters.findByModel('ptvo.switch'):zigbeeHerdsmanConverters.findByDevice({modelID: 'ptvo.switch'});
Replace #3
1 const exposes = zigbeeHerdsmanConverters.exposes;
to
1 const exposes = (zigbeeHerdsmanConverters.hasOwnProperty('exposes'))?zigbeeHerdsmanConverters.exposes:require("zigbee-herdsman-converters/lib/exposes");
Arend
Thank you so much! Option #2 didn’t work, but generating a new .js file did work perfectly.
Profruit
A heartfelt thank you. I had two DIY CC2530 from the time of zigbee version 1.32. After I upgraded to zigbee version 1.37.1 they stopped working. Option 2 didn’t work. I generated new *.js files with the latest ptvo configurator (May 2024) and miraculously they worked again. Thank you and good luck.
Chris
In my case it also broke when updating to 1.36, but I fixed it by following z2m 1.36.1 release notes which is:
Due to some internal changes, some external converters will break. To fix it simply remove const extend = require(‘zigbee-herdsman-converters/lib/extend’); from the external converter.
John
aparenttly 1.36 broke it again
Diogo
Apparently z2m 1.36 broke it again. I’m trying to use my custom device and all exposed attributes are shown (including unused, like link to output), but when I try to refresh or set state it always returns something like “No converter available for ‘link_to_output’ (undefined)”. Device was flashed using hex and js files created with the last version of firmware
Rog
Works for me too, thanks for the swift post on this.
Alex
works! option#2