dresden-elektronik / deconz-rest-plugin

deCONZ REST-API plugin to control ZigBee devices
BSD 3-Clause "New" or "Revised" License
1.89k stars 498 forks source link

PTVO Switch Relay 4/8 #3324

Closed moshiko2312 closed 3 years ago

moshiko2312 commented 3 years ago

Hey First of all thank you so much for the work you do it is just amazing

I use an 8/4 Relay box My main use is in the Home Assistant system with a CONBEE 2 adapter

I enclose some links on the relevant product

https://www.zigbee2mqtt.io/devices/ptvo.switch.html

https://ptvo.info/zigbee-switch-configurable-firmware-router-199/

https://ptvo.info/zigbee-switch-configurable-firmware-v2-210/ conx1 P4 P1 P2 P3 R8_3 R8_4 R4_1 R8_1 R8_2

kachalex commented 3 years ago

I have this problem too, status does not show correctly. I will be very glad, if you solve this problems. With ziqbee2mqqt works well.

Mimiix commented 3 years ago

Same as #3319 , But now you need to provide all correct information. Please check https://github.com/dresden-elektronik/deconz-rest-plugin/issues/3319#issuecomment-699828336

I am missing all clusters read and your deconz version info.

kachalex commented 3 years ago

deconz version info - 2.05.82 / 14.09.2020 firmware - 26580700 01 Basic 0000 01 Diagnostics 0B05 01 Multistate Input Basic 0012 01 On off 0006 02 Basic 0000 02 Multistate Input Basic 0012 02 On off 0006 03 Basic 0000 03 On off 0006 04 Basic 0000 04 Multistate Input Basic 0012 04 On off 0006 05 Basic 0000 05 On off 0006

kachalex commented 3 years ago

If i do attributes read - takes the correct status.

attributes read

What should be done? To automatically read the status?

attributes on read

Mimiix commented 3 years ago

Attributes need to be read ;)

kachalex commented 3 years ago

I have more than 30 more devices and I don't have to go in and read the status with VNC every time after each change.

moshiko2312 commented 3 years ago

image image

SwoopX commented 3 years ago

You're still not following the template... Regardless.

What is the issue here? You wrote:

The problem is when I turn on the relay after 30 seconds the on-screen indication shows that the relay is off (actually the relay is still on)

What on-screen display? On the device? Does it work from a functionality perspective?

moshiko2312 commented 3 years ago

Hey Functionally it works but there is no display in Home Assistant The button returns to the off position It does not perform a read mode of the Relay box

SwoopX commented 3 years ago

This may be a HA thing where we cannot help. However, does the state get right after like 10 mins without touching it?

kachalex commented 3 years ago

This problem starts back in Phoscon App, before forwarding to HA. The state does not become correct: not after 10 minutes, not after an hour and a day without touching it. After each status change, you must manually read attributes.

kachalex commented 3 years ago

Here is an example how is displayed relay 8 in zigbee2mqtt: relay 8 relay 8-1 relay 8-2 relay 8-3 relay 8-4

0x00124b001fb3df83

Router Description Multi-channel relay switch Supports hold, single, double and triple click, on/off, type, rssi Firmware build date 2019-06-21 Firmware version 2019-06-21 Vendor Custom devices (DiY) Model ptvo.switch 0x00124b001fb3df83 Endpoint 1 Output clusters genBasic haDiagnostic genOnOff Input clusters genBasic haDiagnostic genOnOff Endpoint 2 Output clusters genOnOff Input clusters genOnOff genMultistateInput Endpoint 3 Output clusters genOnOff Input clusters genOnOff genMultistateInput Endpoint 4 Output clusters genOnOff Input clusters genOnOff genMultistateInput Endpoint 5 Output clusters genOnOff Input clusters genOnOff genMultistateInput Endpoint 6 Input clusters genAnalogInput Endpoint 7 Output clusters genOnOff Input clusters genOnOff genMultistateInput Endpoint 8 Output clusters genOnOff Input clusters genOnOff

SwoopX commented 3 years ago

Eventually, the attribute reporting is missing/not working. What happens, if you follow https://github.com/dresden-elektronik/deconz-rest-plugin/wiki/How-to...#manually-bind-server-clusters for on/off cluster and this https://github.com/dresden-elektronik/deconz-rest-plugin/wiki/How-to...#manually-configure-attribute-reporting for attribute 0x0000 of the on/off cluster?

moshiko2312 commented 3 years ago

Hey I really no longer know what to do, I have tried everything I know I tried to perform the actions according to the pictures you attached in the link, but without success

SwoopX commented 3 years ago

It is called bind dropbox, because you can drag&drop the clusters/endpoints.

As for your last screenshot, why are you taking a different cluster than I asked for? The on/off cluster is important here and attribute 0x0000.

kachalex commented 3 years ago

Reading config file onoff

ICTSMART commented 3 years ago

Hello all, I thought this issue was related to my specific setup, nevertheless I have exactly the same findings. I am running the following releases / firmware:

RaspBee II Version 2.05.81 / 9/14/2020 Firmware 26610700 DeDONZ is running as a container on Hassio

When I toggle attribute '006 On/Off' attribute in deCONZ VNC the corresponding port on the device responds correctly. Unfortunately there is no feedback to Phoscon at all. Only after reading the attributes in VNC, Phoscon updates its status.

Please let me know what other info you require.

Rgds.

SwoopX commented 3 years ago

@kachalex Have you previsouly successfully done the binding? In your last screenshot, was that the server on/off cluster (in blue letters)?

kachalex commented 3 years ago

I have not done a binding before. I do not know how to do this.

P.S In your last screenshot, was that the server on/off cluster (in blue letters)? - Yes.

SwoopX commented 3 years ago

If you are not able to drag&drop the server on/off cluster of the device on the left and the Endpoint 1 of the coordinator on the right then I cannot help you.

kachalex commented 3 years ago

Can you help me how to do this?

SwoopX commented 3 years ago

I did here and here.

ICTSMART commented 3 years ago

Hello SwoopX,

I've read the instructions on how to do the manually binding and did so for this firmware (PTVO). So in my case I used (probably) the same firmware (configured 1 input and 1 output via the PTVO tool). The Output is visible as cluster 0006 On/Off. So sending an off or on command does update the status of the device, what seems missing is what you mentioned above: "...Eventually, the attribute reporting is missing/not working". Therefore I've enabled all debug options in deCONZ (running as add-on in Hassio), hoping this provides further information for you guys to dive in. Please let me know how I can assist further. I saw Mimiix is also waiting for further info - so let me know what makes debugging easier for you.

logging_raspbeeII_PTVO.txt manual_binding_capture

SwoopX commented 3 years ago

The binding looks alright, but you also need to configure attribute reporting for 0x0000 of the on/off cluster

https://github.com/dresden-elektronik/deconz-rest-plugin/wiki/How-to...#manually-configure-attribute-reporting

ICTSMART commented 3 years ago

Hello, I probably missed that before. New attempt with all logging enabled and report interval set as depicted in attachment. Maybe good to know that the firmware tool used here, allows you to set 8 inputs and 8 outputs. In this case I've just defined 1 input and 1 output and 'linked' them via 'Link to out 1'. Without 'linking' them in the tool, the node shows up with both a '0006 On/Off' cluster and a '0012 Multistate input (basic) (2nd picture). attribute_editor_set ptvo_configuration_set ptvo_configuration_set_unlinked manual_binding_capture_unlinked Report corresponding to 'linked' and a triggerend 'on/off'command:logging_attribute_report.txt

ICTSMART commented 3 years ago

Now when reflashing with the 'unlinked' output 1 and input 1, I still can set the attributes on 0006 On/Off. When I try to do the same for the 0012 Multistate inout (Basic) and try to modify the attribute 0x0055 "present value" of which I suspect should be reflecting the status of the input, I get a UNSUPPORTED_ATTRIBUTE back from deCONZ. Same happens for instance for attribute 0x006F. See pictures below. Nevertheless I've created a log when generating an input signal on the PTVO device towards the coordinator. manual_binding_capture_unlinked_setting_attribute_0x0055 manual_binding_capture_unlinked_setting_attribute_0x006F

Report corresponding to 'unlinked' and a triggerend 'on/off'command' initiated on the device itself: logging_attribute_report_unlinked.txt

ICTSMART commented 3 years ago

According to its documentation, the firmware should report the state of an independent button via the “ZCL_CLUSTER_ID_GEN_MULTISTATE_INPUT_BASIC” cluster and the “PRESENT_VALUE” attribute: 1 – single click. 2 – double click. 3 – triple-click. 4 – long click.

SwoopX commented 3 years ago

Ok, I guess we're getting closer now. In the 2nd log file, I can see that the device is reporting for cluster 0x0006 and 0x0012, so that's good.

For the on/off events, are those now reflected in Phoscon (or in the REST API) as well? The multi state input basic reports are currently not taken into account, this will probably require some code changes.

Has the debug log taken with dbg-info=2? I'd expected to see some more information regarding the attribute reporting, the exact payload to be precise. I'd generally recommend to collect like 10mins of log data, play around with the device and share the full log, as there's more usefull data dwelling in the depths.

Ideally, you'd also be able to compile a test version of the REST API plugin, given you do not run any HA or docker.

ICTSMART commented 3 years ago

Ok. Let me change the dbg-info to 2 and I will play around with the device in order to collect a full log. As I am running the official deCONZ docker add-on for Home Assistion, I guess I am limited for what I can do there. I'll be back shortly with better logging.

ICTSMART commented 3 years ago

Please find attached an assembly of multiple log snippets. As I am not aware of a complete logfile in the deCONZ container, I tried to copy/paste relevant information here. I adjusted the debugging level to 2. logging_snippets_DBG_lvl2.txt

Now when toggling on/off in deCONZ, Phoscon does not reflect the actual change.

sdhawade commented 3 years ago

Hi I am also facing the same problem, the data appears to reach co-ordinator, I can see the on and off status as 1001 and 1000 respectively in the payload, but no status change in Phoscon. Added log below -- Light On -- 20:29:04:800 Node data 0x00124b001fc64555 profileId: 0x0104, clusterId: 0x0006 20:29:04:801 0x00124B001FC64555: update ZCL value 0x04/0x0006/0x0000 after 0 s 20:29:04:801 ZCL attribute report 0x00124B001FC64555 for cluster: 0x0006, ep: 0x04, frame control: 0x00, mfcode: 0x0000 20:29:04:801 payload: 00001001

--Light Off-- 20:34:44:803 Node data 0x00124b001fc64555 profileId: 0x0104, clusterId: 0x0006 20:34:44:803 0x00124B001FC64555: update ZCL value 0x04/0x0006/0x0000 after 0 s 20:34:44:804 ZCL attribute report 0x00124B001FC64555 for cluster: 0x0006, ep: 0x04, frame control: 0x00, mfcode: 0x0000 20:34:44:804 payload: 00001000

stale[bot] commented 3 years ago

As there hasn't been any response in 21 days, this issue has been automatically marked as stale. At OP: Please either close this issue or keep it active It will be closed in 7 days if no further activity occurs.

ICTSMART commented 3 years ago

Not sure whether this topic should be closed yet, as there's quite some interest in having PTVO support in Deconz. @SwoopX any suggestions on how to continue?

sdhawade commented 3 years ago

I had a brief look at the code, looks like there would be multiple changes required to add this to the list of supported devices. Can anyone point me to raise a request to add support ?

ICTSMART commented 3 years ago

@SwoopX , @Mimiix What can I do to provide you guys with further info or testing? Please let me know how I can contribute in getting the PTVO firmware supported.

SwoopX commented 3 years ago

Well, I pretty much did what I could from here. What else do you expect or what is not working respectively? As I recall, this was initially about the state changes in deconz.

The challenge with this device is, that it seems to be highly configurable and I do not have any clue what you need to do to "have it working as expected". To have the ultimate insight, somebody from the devs willing to have this covered would probably need to have the device in hands and do some traffic sniffing.

ICTSMART commented 3 years ago

@SwoopX You are absolutely right, this software is indeed highly configurable. Nevertheless from what I have read - and based on my own experience is that 'inputs' from this device are not reflected in Deconz. Just that would be a major step forward as we can have the actual status fed back towards Deconz. Who from the devs would you suggest I contact? As I am using these devices for quite some time now, especially in combination with the Raspbee I and Raspbee II, my wild guess is that I should be able to provide the necessary sniffing input. Are you aware of the fact that this device is fully supported in Zigbee2Mqtt? I could imagine some info is reusable to make this also work for Deconz (all be it with limited functionality).

wvuyk commented 3 years ago

Here I have an user with the 4 relais version of the device. What I am seeing here is that the webhook keeps sending a second event each time an "on":true command has been send:

11:27:34.7002860 -- (WebCommander.HandleWebQueue) Dequeue command: json {"e":"changed","id":"31","r":"lights","state":{"alert":null,"on":true,"reachable":true},"t":"event","uniqueid":"00:12:4b:00:22:02:80:97-03"} new queue size is 0 on 00212EFFFF05ED63
11:27:34.7537991 -- (WebCommander.HandleWebQueue) Dequeue command: json {"e":"changed","id":"31","r":"lights","state":{"alert":null,"on":false,"reachable":true},"t":"event","uniqueid":"00:12:4b:00:22:02:80:97-03"} new queue size is 0 on 00212EFFFF05ED63

The relais is still on though. So this looks like a false echo of some sort? Any idea why does this happen?

OskarL83 commented 3 years ago

Any progress on this?

mamrai1 commented 3 years ago

It would be great if deconz supported also the analog inputs like device temperature and source voltage.. I use 2 of them as routers with backup battery power and they are working great Screenshot_20210306_181902_com realvnc viewer android Screenshot_20210306_181911_com realvnc viewer android

mamrai1 commented 3 years ago

the device is 0x1DF3... logs with aps and zcl... played with on and off and read attribute 0x0000...

18:59:24:491 ZCL cmd-req nwk: 0x1DF3, profile: 0x0104, cluster: 0x0006 cmd: 0x01 18:59:24:492 APS-DATA.request id: 206, addrmode: 0x02, addr: 0x1df3, profile: 0x0104, cluster: 0x0006, ep: 0x01 -> 0x01 queue: 0 len: 3 tx.options 0x00 18:59:24:506 APS-DATA.confirm id: 206, status: 0x00 SUCCESS 18:59:24:507 APS-DATA.confirm request id: 206 -> erase from queue 18:59:24:516 aps request id: 206 finished, erase from queue 18:59:24:551 APS-DATA.indication srcAddr: 0x1df3, srcEp: 0x01 dstAddrMode: 2, profile: 0x0104, cluster: 0x0006, lqi: 191, rssi: -70 18:59:27:175 ZCL cmd-req nwk: 0x1DF3, profile: 0x0104, cluster: 0x0006 cmd: 0x00 18:59:27:176 APS-DATA.request id: 226, addrmode: 0x02, addr: 0x1df3, profile: 0x0104, cluster: 0x0006, ep: 0x01 -> 0x01 queue: 0 len: 3 tx.options 0x00 18:59:27:190 APS-DATA.confirm id: 226, status: 0x00 SUCCESS 18:59:27:190 APS-DATA.confirm request id: 226 -> erase from queue 18:59:27:235 aps request id: 226 finished, erase from queue 18:59:27:238 APS-DATA.indication srcAddr: 0x1df3, srcEp: 0x01 dstAddrMode: 2, profile: 0x0104, cluster: 0x0006, lqi: 191, rssi: -70 18:59:27:395 APS-DATA.request id: 229, addrmode: 0x03, addr: 0xccccccfffec6c846, profile: 0x0000, cluster: 0x0031, ep: 0x00 -> 0x00 queue: 0 len: 2 tx.options 0x00 18:59:27:418 APS-DATA.confirm id: 229, status: 0x00 SUCCESS 18:59:27:418 APS-DATA.confirm request id: 229 -> confirmed, timeout 1615222767 18:59:27:515 APS-DATA.indication srcAddr: 0xd5f9, srcEp: 0x00 dstAddrMode: 2, profile: 0x0000, cluster: 0x8031, lqi: 191, rssi: -70 18:59:27:516 APS-DATA.indication request id: 229 -> finished 18:59:27:516 APS-DATA.request id: 229 erase from queue 18:59:28:686 ZCL cmd-req nwk: 0x1DF3, profile: 0x0104, cluster: 0x0006 cmd: 0x01 18:59:28:687 APS-DATA.request id: 238, addrmode: 0x02, addr: 0x1df3, profile: 0x0104, cluster: 0x0006, ep: 0x01 -> 0x01 queue: 0 len: 3 tx.options 0x00 18:59:28:706 APS-DATA.confirm id: 238, status: 0x00 SUCCESS 18:59:28:707 APS-DATA.confirm request id: 238 -> erase from queue 18:59:28:751 APS-DATA.indication srcAddr: 0x1df3, srcEp: 0x01 dstAddrMode: 2, profile: 0x0104, cluster: 0x0006, lqi: 191, rssi: -70 18:59:28:752 APS-DATA.request id: 238 erase from queue 18:59:30:275 APS-DATA.request id: 250, addrmode: 0x03, addr: 0xccccccfffec6c846, profile: 0x0000, cluster: 0x0031, ep: 0x00 -> 0x00 queue: 0 len: 2 tx.options 0x00 18:59:30:295 APS-DATA.confirm id: 250, status: 0x00 SUCCESS 18:59:30:296 APS-DATA.confirm request id: 250 -> confirmed, timeout 1615222770 18:59:30:337 APS-DATA.indication srcAddr: 0xd5f9, srcEp: 0x00 dstAddrMode: 2, profile: 0x0000, cluster: 0x8031, lqi: 191, rssi: -70 18:59:30:338 APS-DATA.indication request id: 250 -> finished 18:59:30:338 APS-DATA.request id: 250 erase from queue 18:59:30:643 ZCL read cluster: 0x0006, attribute: 0x0000 18:59:30:643 ZCL cmd-req nwk: 0x1DF3, profile: 0x0104, cluster: 0x0006 cmd: 0x00 18:59:30:643 APS-DATA.request id: 254, addrmode: 0x02, addr: 0x1df3, profile: 0x0104, cluster: 0x0006, ep: 0x01 -> 0x01 queue: 0 len: 5 tx.options 0x00 18:59:30:662 APS-DATA.confirm id: 254, status: 0x00 SUCCESS 18:59:30:662 APS-DATA.confirm request id: 254 -> erase from queue 18:59:30:676 aps request id: 254 finished, erase from queue 18:59:30:704 APS-DATA.indication srcAddr: 0x1df3, srcEp: 0x01 dstAddrMode: 2, profile: 0x0104, cluster: 0x0006, lqi: 191, rssi: -70 18:59:30:704 ZCL got data for node=0x1DF3, cl=0x0006, at=0x0000, status=0x00, type=0x10 18:59:32:224 ZCL cmd-req nwk: 0x1DF3, profile: 0x0104, cluster: 0x0006 cmd: 0x00 18:59:32:225 APS-DATA.request id: 9, addrmode: 0x02, addr: 0x1df3, profile: 0x0104, cluster: 0x0006, ep: 0x01 -> 0x01 queue: 0 len: 3 tx.options 0x00 18:59:32:241 APS-DATA.confirm id: 9, status: 0x00 SUCCESS 18:59:32:241 APS-DATA.confirm request id: 9 -> erase from queue 18:59:32:275 aps request id: 9 finished, erase from queue 18:59:32:287 APS-DATA.indication srcAddr: 0x1df3, srcEp: 0x01 dstAddrMode: 2, profile: 0x0104, cluster: 0x0006, lqi: 191, rssi: -70 18:59:33:635 APS-DATA.request id: 21, addrmode: 0x03, addr: 0x00158d000342a74e, profile: 0x0000, cluster: 0x0031, ep: 0x00 -> 0x00 queue: 0 len: 2 tx.options 0x00 18:59:33:657 APS-DATA.confirm id: 21, status: 0x00 SUCCESS 18:59:33:657 APS-DATA.confirm request id: 21 -> confirmed, timeout 1615222773 18:59:33:684 APS-DATA.indication srcAddr: 0xca7b, srcEp: 0x00 dstAddrMode: 2, profile: 0x0000, cluster: 0x8031, lqi: 247, rssi: -63 18:59:33:684 APS-DATA.indication request id: 21 -> finished 18:59:33:685 APS-DATA.request id: 21 erase from queue 18:59:34:260 ZCL read cluster: 0x0006, attribute: 0x0000 18:59:34:261 ZCL cmd-req nwk: 0x1DF3, profile: 0x0104, cluster: 0x0006 cmd: 0x00 18:59:34:261 APS-DATA.request id: 26, addrmode: 0x02, addr: 0x1df3, profile: 0x0104, cluster: 0x0006, ep: 0x01 -> 0x01 queue: 0 len: 5 tx.options 0x00 18:59:34:284 APS-DATA.confirm id: 26, status: 0x00 SUCCESS 18:59:34:284 APS-DATA.confirm request id: 26 -> erase from queue 18:59:34:328 APS-DATA.indication srcAddr: 0x1df3, srcEp: 0x01 dstAddrMode: 2, profile: 0x0104, cluster: 0x0006, lqi: 191, rssi: -70 18:59:34:329 APS-DATA.request id: 26 erase from queue 18:59:34:329 ZCL got data for node=0x1DF3, cl=0x0006, at=0x0000, status=0x00, type=0x10

github-actions[bot] commented 3 years ago

As there has not been any response in 21 days, this issue has been automatically marked as stale. At OP: Please either close this issue or keep it active It will be closed in 7 days if no further activity occurs.

github-actions[bot] commented 3 years ago

As there has not been any response in 28 days, this issue will be closed. @ OP: If this issue is solved post what fixed it for you. If it is not solved, request to get this opened again.

rafaeledi commented 3 years ago

hello, I have a 4 relays device, but unfortunately it does not report the status of the relay (deconz 6.9.0.). has someone already solved the problem without going to the z2m. I've tried everything but still no solution.