zwave-js / node-zwave-js

Z-Wave driver written entirely in JavaScript/TypeScript
https://zwave-js.github.io/node-zwave-js/
MIT License
741 stars 597 forks source link

Vision ZD2102 door sensor - external switch isn't detected by Home Assistant. #2801

Closed Extreme79 closed 3 years ago

Extreme79 commented 3 years ago

Vision zd2102 door sensor has a main reed and an additional external input where another sensor/reed can be connected. Unfortunately the external input isn't available in home assistant where I use zwavejs (yes, I already opened an issue on HA core GitHub that you can read it here, where a detailed analysis on the issue is available. As I understand, a fix by Zwavejs team is needed in order to get it working.

Device information

Vision Security ZD2102 door sensor, nodeID 7 in my network

Did you change anything?

Did this use to work before?

!-- fill in -->

To Reproduce Add a vision zd2102 in the network and try to use it in home assistant detecting the open/close for each input. Additional context

Add any o

Logfile: For HomeAssistant, this is how you do it: Home Assistant -> settings -> Integrations -> Z-Wave JS -> Configure -> Create dump -> zip the json file and post it here. zwave_js_dump.zip

node7_log.txt

blhoward2 commented 3 years ago

Note that per the comment zwavejs is the secondary controller. I imagine that complicates any troubleshooting...

AlCalzone commented 3 years ago

Okay from cross-reading the other issue, there are several things that need to be done here:

1. The device sends the external switch status as an "unknown" notification which contains the V1 alarm values. We ignore the V1 values for V2+ notifications because the Z-Wave specs say so. However we could just not do this for "unknown" notifications, so this part would be an easy fix.

2. HA doesn't like the "any" metadata for the unknown notification. We don't define any metadata for that event, but I think it's fair to make it a "number" metadata at least.

kpine commented 3 years ago

Actually it's not only the Unknown sensor that has the "any" metadata, all of the Notification values have this. It seems to happen for V2.

Notification dump ```json { "endpoint": 0, "commandClass": 113, "commandClassName": "Notification", "property": "Home Security", "propertyKey": "Cover status", "propertyName": "Home Security", "propertyKeyName": "Cover status", "ccVersion": 2, "metadata": { "type": "any", "readable": true, "writeable": true }, "value": 3 }, { "endpoint": 0, "commandClass": 113, "commandClassName": "Notification", "property": "Home Security", "propertyKey": "Sensor status", "propertyName": "Home Security", "propertyKeyName": "Sensor status", "ccVersion": 2, "metadata": { "type": "any", "readable": true, "writeable": true }, "value": 2 }, { "endpoint": 0, "commandClass": 113, "commandClassName": "Notification", "property": "Home Security", "propertyKey": "unknown", "propertyName": "Home Security", "propertyKeyName": "unknown", "ccVersion": 2, "metadata": { "type": "any", "readable": true, "writeable": true }, "value": 254 }, ```

What would be the value for the Unknown notification if it's a number? Is it a static value of 254?

AlCalzone commented 3 years ago

all of the Notification values have this. It seems to happen for V2.

Ok, that's https://github.com/zwave-js/node-zwave-js/issues/1899

What would be the value for the Unknown notification if it's a number? Is it a static value of 254?

Yup, it should probably be modeled as an event though, since we cannot know if it is stateful.

AlCalzone commented 3 years ago

Please give v7.7.3 a try

Extreme79 commented 3 years ago

I updated the zwave-js integration to v0.1.25 on home assistant, that bumps zwave js 7.7.3. I rebooted HA. So I tried to re-interview one of zd2102 I own, but unfortunately this seems not solve the main issue. Some new entities was created in home assistant, but not related to the secondary switch.

@AlCalzone Later I'll edit this post with some logs to help you to better understand.

here the list of entities that now HA create after re-interview with new zwave-js release ("porta ingresso" is the node 7 device name):

I attach the silly log got on zwavejs HA integration. In order, I:

  1. opened the main door, main reed
  2. opened the outdoor door connected to the zd2102 external switch
  3. closed the outdoor door
  4. closed the main door
  5. opened the zd2102 cover, so tamper on
  6. closed the zd2102 cover, so tamper off

I've no sufficient experience in zwave protocol to perfectly understand all the log messages and consequently I can't say if it's the time to come back to HA issue tracker and continue on HA side. silly_log_ZD2102_zwaveJS_latest.txt

kpine commented 3 years ago

Please post the debug logs from a re-interview. The HA side looks OK based on what's now provided (Home Security sensors have valid metadata types), however there are no V1 values. The interview might explain why.

Extreme79 commented 3 years ago

Here the silly log of the new interview, as I posted also in HA issue side. zd2102_new_interview_silly.txt

and here the additional mini-log of a external switch open (starting with main reed already opened) >> external switch close >> main reed close. another_silly_log_zd2102.txt

kpine commented 3 years ago
2021-06-10T19:57:43.498Z DRIVER « [Node 007] [REQ] [ApplicationCommand]
                                  └─[NotificationCCSupportedReport]
                                      supports V1 alarm:            false
                                      supported notification types:
                                      · Home Security

The device claims it doesn't support V1 alarms. What a mess of a device.

Extreme79 commented 3 years ago
2021-06-10T19:57:43.498Z DRIVER « [Node 007] [REQ] [ApplicationCommand]
                                  └─[NotificationCCSupportedReport]
                                      supports V1 alarm:            false
                                      supported notification types:
                                      · Home Security

The device claims it doesn't support V1 alarms. What a mess of a device.

I wrote to vision security to try the ask about the issue, to ask about a new firmware if available, and I sent the links to the gitub issues (hopeing they'll read..). the zd2102 is the unique door sensor I found able to "handle" two inputs within one device.. but as I understand, probably there is a reason if it's the unique...

AlCalzone commented 3 years ago

The device claims it doesn't support V1 alarms

Yet it uses them (╯°□°)╯︵ ┻━┻ Well - I'll remove the condition that a device must support V1 alarm for us to preserve them.

Extreme79 commented 3 years ago

I'll check my zd2102 after the latest release as soon as I come back home from holidays (3july).

Extreme79 commented 3 years ago

Now the main issue seems solved. I have an alarmlevel entity that change from 0 (closed) to 255 (opened). So with that value I can detect my secondary switch. Now another problem seems present (missed entity alarmLevel on re-interviewed devices).. but I have to explore it on ha side, before. Edit: after some reboots and integration reload, the entity appeared and respond correctly to the real switch staus. Seems solved.