Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] ptvo.switch stops working after Z2MQTT upgrade #5894

Merged
merged 1 commit into from
Jun 19, 2023

Conversation

ptvoinfo
Copy link
Contributor

@ptvoinfo ptvoinfo commented Jun 19, 2023

@Koenkk, Fixes related to
#17931
#208

@Koenkk Koenkk merged commit bd16a15 into Koenkk:master Jun 19, 2023
@Koenkk
Copy link
Owner

Koenkk commented Jun 19, 2023

Thanks!

@evilworm
Copy link

This does not seem to be working for me... I have 4-channel zigbee switch based on ptvo.switch firmware and after upgrading Z2M to 1.32.1 (also tried latest-dev docker image) the "exposes" tab has only linkquality. After re-pairing the device, I could see for a short while state_l1, state_l2, ... but after a few seconds they disappear.

Here is a log of device joining the network if it helps:

info 2023-07-18 22:29:03MQTT publish: topic 'raspberrypi/bridge/event', payload '{"data":{"friendly_name":"0x00124b001c5b7ed0","ieee_address":"0x00124b001c5b7ed0"},"type":"device_joined"}'
info 2023-07-18 22:29:03MQTT publish: topic 'raspberrypi/bridge/log', payload '{"message":{"friendly_name":"0x00124b001c5b7ed0"},"type":"device_connected"}'
info 2023-07-18 22:29:03MQTT publish: topic 'raspberrypi/0x00124b001c5b7ed0', payload '{"last_seen":"2023-07-18T19:28:49.670Z"}'
info 2023-07-18 22:29:03Starting interview of '0x00124b001c5b7ed0'
info 2023-07-18 22:29:06MQTT publish: topic 'raspberrypi/bridge/event', payload '{"data":{"friendly_name":"0x00124b001c5b7ed0","ieee_address":"0x00124b001c5b7ed0","status":"started"},"type":"device_interview"}'
info 2023-07-18 22:29:06MQTT publish: topic 'raspberrypi/bridge/log', payload '{"message":"interview_started","meta":{"friendly_name":"0x00124b001c5b7ed0"},"type":"pairing"}'
info 2023-07-18 22:29:07MQTT publish: topic 'raspberrypi/0x00124b001c5b7ed0', payload '{"last_seen":"2023-07-18T19:28:53.416Z"}'
info 2023-07-18 22:29:10MQTT publish: topic 'raspberrypi/bridge/event', payload '{"data":{"friendly_name":"0x00124b001c5b7ed0","ieee_address":"0x00124b001c5b7ed0"},"type":"device_announce"}'
info 2023-07-18 22:29:10MQTT publish: topic 'raspberrypi/bridge/log', payload '{"message":"announce","meta":{"friendly_name":"0x00124b001c5b7ed0"},"type":"device_announced"}'
info 2023-07-18 22:29:10MQTT publish: topic 'raspberrypi/0x00124b001c5b7ed0', payload '{"last_seen":"2023-07-18T19:28:56.607Z","linkquality":51,"state_l4":"OFF"}'
info 2023-07-18 22:29:10MQTT publish: topic 'raspberrypi/0x00124b001c5b7ed0', payload '{"last_seen":"2023-07-18T19:28:56.607Z","linkquality":51,"state_l3":"OFF","state_l4":"OFF"}'
info 2023-07-18 22:29:10MQTT publish: topic 'raspberrypi/0x00124b001c5b7ed0', payload '{"last_seen":"2023-07-18T19:28:56.607Z","linkquality":51,"state_l2":"OFF","state_l3":"OFF","state_l4":"OFF"}'
info 2023-07-18 22:29:10MQTT publish: topic 'raspberrypi/0x00124b001c5b7ed0', payload '{"last_seen":"2023-07-18T19:28:56.607Z","linkquality":51,"state_l2":"OFF","state_l3":"OFF","state_l4":"OFF","state_l5":"OFF"}'
info 2023-07-18 22:29:10MQTT publish: topic 'raspberrypi/0x00124b001c5b7ed0', payload '{"last_seen":"2023-07-18T19:28:56.607Z","linkquality":51,"state_l1":"OFF","state_l2":"OFF","state_l3":"OFF","state_l4":"OFF","state_l5":"OFF"}'
info 2023-07-18 22:29:10MQTT publish: topic 'raspberrypi/0x00124b001c5b7ed0', payload '{"last_seen":"2023-07-18T19:28:57.116Z","linkquality":69,"state_l1":"OFF","state_l2":"OFF","state_l3":"OFF","state_l4":"OFF","state_l5":"OFF"}'
info 2023-07-18 22:29:12Successfully interviewed '0x00124b001c5b7ed0', device has successfully been paired
info 2023-07-18 22:29:12Device '0x00124b001c5b7ed0' is supported, identified as: Custom devices (DiY) [Multi-channel relay switch](https://ptvo.info/zigbee-switch-configurable-firmware-router-199/) (ptvo.switch)
info 2023-07-18 22:29:16MQTT publish: topic 'raspberrypi/bridge/event', payload '{"data":{"definition":{"description":"[Multi-channel relay switch](https://ptvo.info/zigbee-switch-configurable-firmware-router-199/)","exposes":[{"endpoint":"l1","features":[{"access":7,"description":"On/off state of the switch","endpoint":"l1","name":"state","property":"state_l1","type":"binary","value_off":"OFF","value_on":"ON","value_toggle":"TOGGLE"}],"type":"switch"},{"endpoint":"l2","features":[{"access":7,"description":"On/off state of the switch","endpoint":"l2","name":"state","property":"state_l2","type":"binary","value_off":"OFF","value_on":"ON","value_toggle":"TOGGLE"}],"type":"switch"},{"endpoint":"l3","features":[{"access":7,"description":"On/off state of the switch","endpoint":"l3","name":"state","property":"state_l3","type":"binary","value_off":"OFF","value_on":"ON","value_toggle":"TOGGLE"}],"type":"switch"},{"endpoint":"l4","features":[{"access":7,"description":"On/off state of the switch","endpoint":"l4","name":"state","property":"state_l4","type":"binary","value_off":"OFF","value_on":"ON","value_toggle":"TOGGLE"}],"type":"switch"},{"endpoint":"l5","features":[{"access":7,"description":"On/off state of the switch","endpoint":"l5","name":"state","property":"state_l5","type":"binary","value_off":"OFF","value_on":"ON","value_toggle":"TOGGLE"}],"type":"switch"},{"endpoint":"l6","features":[{"access":7,"description":"On/off state of the switch","endpoint":"l6","name":"state","property":"state_l6","type":"binary","value_off":"OFF","value_on":"ON","value_toggle":"TOGGLE"}],"type":"switch"},{"endpoint":"l7","features":[{"access":7,"description":"On/off state of the switch","endpoint":"l7","name":"state","property":"state_l7","type":"binary","value_off":"OFF","value_on":"ON","value_toggle":"TOGGLE"}],"type":"switch"},{"endpoint":"l8","features":[{"access":7,"description":"On/off state of the switch","endpoint":"l8","name":"state","property":"state_l8","type":"binary","value_off":"OFF","value_on":"ON","value_toggle":"TOGGLE"}],"type":"switch"},{"access":1,"description":"Link quality (signal strength)","name":"linkquality","property":"linkquality","type":"numeric","unit":"lqi","value_max":255,"value_min":0}],"model":"ptvo.switch","options":[{"access":2,"description":"Controls the transition time (in seconds) of on/off, brightness, color temperature (if applicable) and color (if applicable) changes. Defaults to `0` (no transition).","name":"transition","property":"transition","type":"numeric","value_min":0},{"access":2,"description":"State actions will also be published as 'action' when true (default false).","name":"state_action","property":"state_action","type":"binary","value_off":false,"value_on":true},{"access":2,"description":"Set to false to disable the legacy integration (highly recommended), will change structure of the published payload (default true).","name":"legacy","property":"legacy","type":"binary","value_off":false,"value_on":true},{"access":2,"description":"Number of digits after decimal point for temperature, takes into effect on next report of device.","name":"temperature_precision","property":"temperature_precision","type":"numeric","value_max":3,"value_min":0},{"access":2,"description":"Calibrates the temperature value (absolute offset), takes into effect on next report of device.","name":"temperature_calibration","property":"temperature_calibration","type":"numeric"},{"access":2,"description":"Number of digits after decimal point for humidity, takes into effect on next report of device.","name":"humidity_precision","property":"humidity_precision","type":"numeric","value_max":3,"value_min":0},{"access":2,"description":"Calibrates the humidity value (absolute offset), takes into effect on next report of device.","name":"humidity_calibration","property":"humidity_calibration","type":"numeric"},{"access":2,"description":"Number of digits after decimal point for pressure, takes into effect on next report of device.","name":"pressure_precision","property":"pressure_precision","type":"numeric","value_max":3,"value_min":0},{"access":2,"description":"Calibrates the pressure value (absolute offset), takes into effect on next report of device.","name":"pressure_calibration","property":"pressure_calibration","type":"numeric"},{"access":2,"description":"Calibrates the illuminance value (percentual offset), takes into effect on next report of device.","name":"illuminance_calibration","property":"illuminance_calibration","type":"numeric"},{"access":2,"description":"Calibrates the illuminance_lux value (percentual offset), takes into effect on next report of device.","name":"illuminance_lux_calibration","property":"illuminance_lux_calibration","type":"numeric"}],"supports_ota":false,"vendor":"Custom devices (DiY)"},"friendly_name":"0x00124b001c5b7ed0","ieee_address":"0x00124b001c5b7ed0","status":"successful","supported":true},"type":"device_interview"}'
info 2023-07-18 22:29:16Configuring '0x00124b001c5b7ed0'
info 2023-07-18 22:29:16MQTT publish: topic 'raspberrypi/bridge/log', payload '{"message":"interview_successful","meta":{"description":"[Multi-channel relay switch](https://ptvo.info/zigbee-switch-configurable-firmware-router-199/)","friendly_name":"0x00124b001c5b7ed0","model":"ptvo.switch","supported":true,"vendor":"Custom devices (DiY)"},"type":"pairing"}'
info 2023-07-18 22:29:16MQTT publish: topic 'raspberrypi/0x00124b001c5b7ed0', payload '{"last_seen":"2023-07-18T19:29:03.062Z","linkquality":80,"state_l1":"OFF","state_l2":"OFF","state_l3":"OFF","state_l4":"OFF","state_l5":"OFF"}'
info 2023-07-18 22:29:16Successfully configured '0x00124b001c5b7ed0'

this is how I see "exposes" tab for a few seconds before it goes blank:
https://pasteboard.co/ALi4Zw28wHFT.png

and this is how it used to look:
https://pasteboard.co/uowvLagI7QZT.png

After downgrading Z2M to 1.30.4 everything works again...

@ptvoinfo
Copy link
Contributor Author

@evilworm,

Could you please try to upgrade again and attach a screenshot with the list of clusters? The converter builds the exposes list using this information.

@PetrP2B
Copy link

PetrP2B commented Jul 20, 2023

I have the same problem, on the latest versions, both edge and normal, all controlled outputs do not work, Z2M only shows maybe 4 out of 8 outputs.
Z2M version 1.30.4
0x00124b00xxxxxxx
Endpoint 1
Output clusters
genBasic
genOnOff
Input clusters
genBasic
haDiagnostic
genOnOff
Endpoint 2
Output clusters
genOnOff
Input clusters
genOnOff
Endpoint 3
Output clusters
genOnOff
Input clusters
genOnOff
Endpoint 4
Output clusters
genOnOff
Input clusters
genOnOff
Endpoint 5
Output clusters
genOnOff
Input clusters
genOnOff
Endpoint 6
Output clusters
genOnOff
Input clusters
genOnOff
Endpoint 7
Output clusters
genOnOff
Input clusters
genOnOff
Endpoint 8
Output clusters
genOnOff
Input clusters
genOnOff
Z2M version 1.32.1-dev
0x00124b000xxxxxxx
Endpoint 1
Output clusters
genBasic
genOnOff
Input clusters
genBasic
haDiagnostic
genOnOff
Endpoint 2
Output clusters
genOnOff
Input clusters
genOnOff
Endpoint 3
Output clusters
genOnOff
Input clusters
genOnOff
Endpoint 4
Output clusters
genOnOff
Input clusters
genOnOff
Endpoint 5
Output clusters
genOnOff
Input clusters
genOnOff
Endpoint 6
Output clusters
genOnOff
Input clusters
genOnOff
Endpoint 7
Output clusters
genOnOff
Input clusters
genOnOff
Endpoint 8
Output clusters
genOnOff
Input clusters
genOnOff
Z2M_v1 30 4
Z2M_v1 32 1-dev

@melonius
Copy link

Sorry. After upgrading to 1.32.2, I still have the same problem:

mosquitto_pub -t zigbee2mqtt/relesA/set -m '{"state_l2": "ON"}' >> Zigbee2MQTT:error 2023-08-19 03:37:23: Device 'relesA' has no endpoint 'l2'

I downgraded to Z2M 1.30.4 and it works well again.

@ptvoinfo
Copy link
Contributor Author

ptvoinfo commented Aug 19, 2023

@melonius.

Could you please try to re-join the device?

  1. Delete in z2m
  2. Restart z2m.
  3. Join the device again.

If you can show me your full firmware configuration, including the "Expert" tab, and share your HEX file, I'll make the full test on my side.

@melonius
Copy link

melonius commented Sep 2, 2023

Sorry for the delay.
I've updated to version 1.33.0, and everything has worked without needing to delete or re-join the device.
Thanks.

@PetrP2B
Copy link

PetrP2B commented Sep 5, 2023

Yes, everything works correctly in the latest version of Edge and Stable. Thanks

@triosniolin
Copy link

I just got one of these and Z2M recognizes it as a ptvo.switch, but is not exposing the digital inputs. Instead, it only exposes an action, which does indicate a change of state of the digital inputs, but is not very useful for monitoring digital sensors and device states. Looking at this PR, it appears to make changes to the exposes to expose an action if the device supports genMultistateInput which I believe is where this issue is occurring. I have very little info on the device itself or its firmware to be able to help get the inputs exposed again, unfortunately.

@ptvoinfo
Copy link
Contributor Author

@triosniolin You can re-configure and re-flash your device for your needs
(https://ptvo.info/zigbee-configurable-firmware-features/)

@triosniolin
Copy link

The device is properly configured and flashed, but it does not report correctly in Z2M. According to the guy who builds these, it used to work great. I believe changes made to support other versions of the ptvo.switch broke his implmentation.

@ptvoinfo
Copy link
Contributor Author

@triosniolin Please note, Z2M always places genMultistateInput reports (button clicks) to one "action" field. But a value looks like "single_l1", "double_l1", etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants