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

Request support for Visonic MCT-340 E #978

Closed
ZheYang-sjtu opened this issue Nov 26, 2018 · 70 comments
Closed

Request support for Visonic MCT-340 E #978

ZheYang-sjtu opened this issue Nov 26, 2018 · 70 comments

Comments

@ZheYang-sjtu
Copy link

Hi guys,

I recently bought a ConBee dongle and two Visonic temperature/motion sensors for my research purposes. I was able to pair the sensors with the dongle and they show up in the deCONZ software. But I am unable to get readings from the sensors (Temperature Measurement remains 0), nor can I find the device with REST API. Why is the reading always 0, is this a sensor problem or a pairing problem? Can anyone help me out please?

Here's some related information:

basic_attr

temp_cluster

node_info

@ZheYang-sjtu
Copy link
Author

some debug info from terminal:

23:41:41:383 * neighbor: 0x000D6F000B3E121C (0x4398), LQI: 252, relation: 0x01 rxOnWHenIdle: 0 23:41:44:625 MGTM_Lqi_req zdpSeq: 14 to 0x00212EFFFF029E2D start index 0 23:41:44:625 APS-DATA.request id: 25, addrmode: 0x02, addr: 0x0000, profile: 0x0000, cluster: 0x0031, ep: 0x00 queue: 0 len: 2 23:41:44:713 APS-DATA.confirm id: 25, status: 0x00 SUCCESS 23:41:44:713 APS-DATA.confirm request id: 25 -> confirmed, timeout 59840 23:41:44:745 APS-DATA.indication srcAddr: 0x00212effff029e2d, dstAddrMode: 2, profile: 0x0000, cluster: 0x8031, lqi: 55, rssi: 0 23:41:44:745 APS-DATA.indication request id: 25 -> finished 23:41:44:745 APS-DATA.request id: 25 erase from queue 23:41:44:745 ZDP status = 0x00 -> SUCCESS 23:41:44:745 ZDP Mgmt_Lqi_rsp zdpSeq: 14 from 0x00212EFFFF029E2D total: 2, startIndex: 0, listCount: 1 23:41:44:745 * neighbor: 0x000D6F000B3DEA7B (0x37FF), LQI: 247, relation: 0x01 rxOnWHenIdle: 0 23:41:45:105 MGTM_Lqi_req zdpSeq: 16 to 0x00212EFFFF029E2D start index 1 23:41:45:105 APS-DATA.request id: 28, addrmode: 0x02, addr: 0x0000, profile: 0x0000, cluster: 0x0031, ep: 0x00 queue: 0 len: 2 23:41:45:194 APS-DATA.confirm id: 28, status: 0x00 SUCCESS 23:41:45:194 APS-DATA.confirm request id: 28 -> confirmed, timeout 59840 23:41:45:226 APS-DATA.indication srcAddr: 0x00212effff029e2d, dstAddrMode: 2, profile: 0x0000, cluster: 0x8031, lqi: 55, rssi: 0 23:41:45:226 APS-DATA.indication request id: 28 -> finished 23:41:45:226 APS-DATA.request id: 28 erase from queue 23:41:45:226 ZDP status = 0x00 -> SUCCESS 23:41:45:226 ZDP Mgmt_Lqi_rsp zdpSeq: 16 from 0x00212EFFFF029E2D total: 2, startIndex: 1, listCount: 1

@ZheYang-sjtu
Copy link
Author

Has anyone encounterd the 0 reading issue? Is it a problem with pairing or with my sensor?

@manup
Copy link
Member

manup commented Nov 26, 2018

Maybe the reporting needs to be configured in order to get temperature readings. Supporting the sensor should be straightforward given it's IAS Zone and Temperature cluster.

@ZheYang-sjtu
Copy link
Author

Thanks Manuel

@ZheYang-sjtu
Copy link
Author

IAS ZOne info
ias

BTW I still read 0 after I set report interval and reportable change..

@ebaauw
Copy link
Collaborator

ebaauw commented Nov 27, 2018

Did you create a binding from the Temperature measurement cluster to the RaspBee/ConBee ZHA endpoint?

You might need to enroll the device first, by writing the mac address of your RaspBee/ConBee to the IAS_CIE_Address attribute.

@manup
Copy link
Member

manup commented Nov 27, 2018

You may try version 2.05.49 and rejoin the sensor in theory two sensors resources should be created.

@ZheYang-sjtu
Copy link
Author

@ebaauw Hi Erik, thanks for the help. In IAS Zone I wrote ConBee's MAC address to the corresponding location (though Zone Enroll Request command gives me UNSUP_CLUSTER_COMMAND response). Then I created a binding from Temperature measurement cluster 0x0402 to ConBee Home Automation Configuration tool. I still get 0 reading at Measured Value. Do you think there's anything I can do to debug this situation?

@manup Thanks for the responsiveness. I reckon that the precompiled packages are a bundle of deConZ and the REST plugin? Could you please also upload version 2.05.49 for Ubuntu? I am using ConBee. Incidentally, I also tried to install version 2.05.48 but then compile the source code of REST plugin of version 2.05.49, but there seems to be a bug. in de_web_plugin_private.h it uses deconz.h, but the latter seems not to be there. So I couldn't compile the code.

@ebaauw
Copy link
Collaborator

ebaauw commented Nov 28, 2018

though Zone Enroll Request command gives me UNSUP_CLUSTER_COMMAND response

I’ve yet to find a device that supports this.

I still get 0 reading at Measured Value.

Does the sensor respond to the read attributes command with a value of 0, or does it simply not respond and deCONZ continues to show the default value? Do the other attributes get populated? You might need to wave in front of the sensor to make sure it’s awake, while reading the attributes. Then again, the sensor might not support reading the attributes, and rely on attribute reporting, like some Xiaomi sensor.

The deCONZ REST API sets up the binding before configuring the reporting. The devices I’ve seen don’t seem to care about the order, but maybe this sensor does. Typical reporting settings for a temperature setting are: minimum: 10, maximum: 300, change: 20.

it uses deconz.h, but the latter seems not to be there.

This is not part of the REST API plugin. It describes the C++ API the deCONZ core provides to plugins. It’s installed to /usr/include on installing the development package.

I think compiling the REST API plugin is supported on Raspbian only. Typically you want the core program (and dev package) to match the version of the plugin.

@ZheYang-sjtu
Copy link
Author

@ebaauw Hi Erik, I think the sensor responds with 0 reading, for it says "reading done", and I can successfully read and write report intervals.

I wrote reporting settings with 10, 300, and 20 successfully to the device, after I manually established a binding. The sensor reading stays at 0. I don't know whether it's because I missed some important stuff, for both sensors are at 0, unlikely that both are malfunctioning.

Thanks.

@manup
Copy link
Member

manup commented Nov 28, 2018

The ubuntu version is now uploaded, to compile the plugin you also need to install the -dev.deb package.

@ZheYang-sjtu
Copy link
Author

@manup Hi Manu, thanks very much for the update! Now I can read data out of the sensor from the software and also the REST API works! It's great. You are so responsive. I am going to close this issue.

@ebaauw Thanks Erik too for your detailed information. You've been very helpful.

@jjlawren
Copy link

jjlawren commented Feb 6, 2019

@ZheYang-sjtu did you need to manually adjust check-in or poll values? I've paired this sensor but it will not reflect open/close or temperature changes via REST (specifically Home Assistant).

@jjlawren
Copy link

jjlawren commented Feb 7, 2019

@manup @ebaauw I'm running the latest REST API and firmware and can see both MCT-340 E sensors in the REST API, but their values never update. If I force a read of the IAZ Zone I can see the Zone Status update based on the door sensor state.

After the initial pairing, is there another step necessary to get these sensors to work properly?

Example REST response:

{
-"config": {
"battery": null,
"on": true,
"pending": [ ],
"reachable": true
},
"ep": 1,
"etag": "12345678a41530e2dae5cbdbd4e54321",
"manufacturername": "Visonic",
"modelid": "MCT-340 E",
"name": "MCT-340 E",
-"state": {
"lastupdated": "none",
"lowbattery": false,
"open": false,
"tampered": false
},
"type": "ZHAOpenClose",
"uniqueid": "de:ad:be:ef:0b:12:1b:69-01-0500"
}

Sorry if I'm missing something obvious, this is the first device I'm adding to my RaspBee and I'm not sure if it's me or an unsupported sensor.

@manup
Copy link
Member

manup commented Feb 7, 2019

After the initial pairing, is there another step necessary to get these sensors to work properly?

Was the sensor paired recently or with an earlier version? With current version of deCONZ the IAS devices should be configured properly to send reports.

@jjlawren
Copy link

jjlawren commented Feb 7, 2019

@manup I've reset the controller and started from scratch with the same results. What info can I provide?

@manup
Copy link
Member

manup commented Feb 7, 2019

Can you please delete and rejoin the sensor again but with logging enabled:

deCONZ --dbg-info=1 --dbg-aps=2 --dbg-zcl=1 --http-port=80

Here we should see if the IAS cluster bindings and setup steps are executed.

@youryz
Copy link

youryz commented Feb 7, 2019

@ZheYang-sjtu did you need to manually adjust check-in or poll values? I've paired this sensor but it will not reflect open/close or temperature changes via REST (specifically Home Assistant).

Hi I did manually configure in deCONZ user interface as suggested by Manu

@jjlawren
Copy link

jjlawren commented Feb 8, 2019

Hi @manup, here's the logging output: https://www.hastebin.com/osogipoyas.makefile

The device is shown in Deconz, but it doesn't appear the device knows it's paired. It keeps flashing in the pattern that reflects it's still available to pair. I've done a controller reset and device factory reset several times with the same behavior.

I can however see the various cluster attributes and the zone status updates based on the magnet presence:
image

So far the temperature cluster has always reported 0 in all my tests.

@manup
Copy link
Member

manup commented Feb 8, 2019

Thanks that helps a lot. There are some steps missing in setting up this device:

  • [5] write IAS CIE address
  • [6] sens IAS zone enroll response

I'll check the code why these aren't processed.

@manup
Copy link
Member

manup commented Feb 8, 2019

Interesting, when you look at basic cluster you should see that after join neither attributes SW Build ID 0x4000 nor Datecode 0x0006 are supported.

The current code expects that at least one of them is supported. Will be fixed in 2.05.59.

@jjlawren
Copy link

jjlawren commented Feb 9, 2019

Is there a public release schedule? Can we reopen this case until the support is stable?

@manup
Copy link
Member

manup commented Feb 9, 2019

Sure, deCONZ versions are released every 1–2 weeks on average. Next version 2.05.59 should arrive this weekend.

@manup manup reopened this Feb 9, 2019
manup added a commit that referenced this issue Feb 9, 2019
…c MCT-340 E)

Issue #978

In such cases the sensors where created but further steps like IAS zone setup wasn't executed.
@manup
Copy link
Member

manup commented Feb 15, 2019

2.05.59 is available now, please check if the Visonic MCT-340 E can be joined now.

https://github.com/dresden-elektronik/deconz-rest-plugin/releases/tag/V2_05_59

@manup
Copy link
Member

manup commented Mar 18, 2019

As a reference here is the smart things groovy script handler.
Nothing new here, seems identical to current deCONZ handling.

https://github.com/tomasaxerot/SmartThings/blob/master/devicetypes/tomasaxerot/visonic-door-window-sensor.src/visonic-door-window-sensor.groovy

However found this in the Zigbee ZCL spec for the Poll Control Cluster:

3.16.3 Commissioning Process

Poll Control Cluster Clients SHALL configure bindings on the device implementing the Poll Control Cluster Server so that they will receive the regular check-in command on the configured Check-In Interval. This can be done during the configuration period on the end device implementing the Poll Control Cluster Server during which it is in fast poll mode. The device that implements the Poll Control Cluster Server SHALL check its bindings on the configured check-in Interval. If it has any bindings related to any endpoint and the Poll Control Cluster, it will send a check-in command out on that binding.

Currently this isn't done automatically, not sure if it helps.

Can you try creating a binding between Poll Control Cluster and the Gateway 01 Configuration Tool endpoint via Binding Dropbox.

Here is an example how it looks for my OSRAM Motion Sensor-A:

image

@jjlawren
Copy link

I've added the binding from cluster 0020 (Poll Control). Should I expect the device to sleep with that in place? If it does not, do I possibly need to restart the device or Deconz for it to have an effect on sleep?

@manup
Copy link
Member

manup commented Mar 18, 2019

I've added the binding from cluster 0020 (Poll Control). Should I expect the device to sleep with that in place? If it does not, do I possibly need to restart the device or Deconz for it to have an effect on sleep?

No action should be needed, it will only make sure device checks in every 1 hour.

Next step should be adjusting the Long Poll Interval, currently it is 8 which means 8 x 250 milliseconds between mac poll attempts (when the node blinks green) = poll every 2 seconds.

This is actually overkill for the small CR2032 coin battery.

Next step
Double click on the attribute and write an larger value to it like 7200 so that the sensor polls every 30 minutes.

@jjlawren
Copy link

Long Poll Interval is a read-only attribute as shown here.

@manup
Copy link
Member

manup commented Mar 18, 2019

Ah damn, right. It can only be modified with the 0x02 command Set Long Poll Interval which isn't yet in the ZCLDB general.xml file. I'll add it for the next version.

Also the command is optional so I'm not sure if it is supported by the device.

@jjlawren
Copy link

One more thing. Deconz never marks the device as dead even when it’s been offline for several hours. The open/close status simply stops updating.

@jjlawren
Copy link

@manup any other suggestions for improving battery life? I still need to swap out fresh batteries every couple weeks.

@jjlawren
Copy link

jjlawren commented May 3, 2019

Ah damn, right. It can only be modified with the 0x02 command Set Long Poll Interval which isn't yet in the ZCLDB general.xml file. I'll add it for the next version.

Also the command is optional so I'm not sure if it is supported by the device.

@manup is this still coming in a future build?

@manup
Copy link
Member

manup commented May 11, 2019

I'm currently implementing the Poll Control functionality for the SmartThings devices, looks like this is working. It should then work equally for the Visonic devices.

@jjlawren
Copy link

Thank you, @manup, I'm looking forward to testing the new functionality.

I have two more known issues regarding this device:

  1. The battery level reporting over REST / Home Assistant always shows 100%
  2. The device does not show up in Phoscon

@rb2k
Copy link

rb2k commented May 14, 2019

zigbee2mqtt added some converters over here: Koenkk/zigbee-herdsman-converters#434 , not sure that really helps, but I thought I'd add it here just because I happen to be subscribed to both issues.

@jjlawren
Copy link

jjlawren commented Jun 4, 2019

@manup will V2_05_65 help with this issue (i.e., d81cd52)? Or will more changes be necessary for this specific sensor?

@eadamsintel
Copy link

I recently bought the Conbee II and set this up using the marthoc/deconz container. I don't know this software very well yet but I am having the same issues as @jjlawren I have 6 MCT-340e devices connected and none show up in the Phoscon web gui but do show up in deconz desktop software when using VNC to get to the desktop app in the container. When linking to home-assistant I see the open/close status but the temperature says unknown for all the sensors and the battery seems to either be 100 or true. I should note that I don't have the green line in the desktop app connecting some of the MCT-340 sensor to any of the other two zigbee devices I have connected to the Conbee II but I assume that is because the device is in sleep state.

I don't know if I should be able to but from the desktop app where I can see the MCT-340e sensor's I can't change the name of any of those sensors or any device for that matter.

Also of note I have another sensor, ISW-ZPR1-WP13, that also does not show up in the sensors gui in the phoscon web app.

@jjlawren
Copy link

I've upgraded and now see the option to set the long poll interval. However, every value I've tried to enter so far returns with INVALID_VALUE. Am I using the wrong format or is it not supported by the device? The read-only value still reports 8.

@hgelpke
Copy link

hgelpke commented Jun 16, 2019

Is anybody having success pairing this? I am moving a few over from Smart Things and while I can see it in the VNC window, the sensor itself shows a blinking red light even though Phoscon said "Sensor ready"

@jjlawren
Copy link

@hgelpke, you may need to do a factory reset to pair. Remove the battery and then hold the door switch while you replace the battery.

As of now the device does not display in Phoscon but is available over REST.

@hgelpke
Copy link

hgelpke commented Jun 17, 2019 via email

@eadamsintel
Copy link

I've done that a few times with little to no luck. I know they don't show in Phoscon but how can I check their status in Deconz over VNC? They seem to appear but when I look at them in Home Assistant the data does not appear to be passed.

On Mon, Jun 17, 2019 at 7:03 AM jjlawren @.***> wrote: @hgelpke https://github.com/hgelpke, you may need to do a factory reset to pair. Remove the battery and then hold the door switch while you replace the battery. As of now the device does not display in Phoscon but is available over REST. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#978?email_source=notifications&email_token=ACQWXGDELSHQ6WPXVAIXLU3P26KUTA5CNFSM4GGJFEY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODX3IP3I#issuecomment-502695917>, or mute the thread https://github.com/notifications/unsubscribe-auth/ACQWXGFXYXKJQ62PDJ7MH5LP26KUTANCNFSM4GGJFEYQ .

Like you I am having some issues with my MCT-340 sensors. One sensor won't pair properly and is left unconnected. If I delete it with deconz GUI then it just shows up again after I restart the Docker container. Does anyone know how I can remove this defunct sensor that keeps auto populating in deconz? HomeAssistant see's it as constantly open yet the battery has been out of the sensor for an entire day. Every time I move the magnetic switch on the sensor when the battery is in a red light blinks 3 times whereas my other sensors don't do this. I am thinking I have a bad one. The other 5 sensors show open/close status in HomeAssistant quickly but battery is 100% and temperature is not shown.

I use Docker with my setup and am using the https://hub.docker.com/r/marthoc/deconz container. Add the following to your docker command line and then you can just VNC to ip_address:0 or maybe try ip_address:1 if that 0 display doesn't work. That should show you the deconz GUI.

-e DECONZ_VNC_MODE=1 -e DECONZ_VNC_PASSWORD=abcdefg

On a side note when I had these sensors connected to smartthings they did show the battery although the battery seemed like it was perpetually at 67% or 33% until they went to 11% and stayed for a long time. I vaguely remember even at 0% these batteries still working for weeks and weeks. The temperature also worked with smart things and seemed to show the correct temp.

@jjlawren
Copy link

I thought about the long poll value and realized I wasn't setting it in hex, so I tried with 0x1C20 (7200 seconds). It accepted the change and the device almost immediately became unavailable. I guess we'll see if it comes back and remains operational...

@jjlawren
Copy link

It looks good! It still sends updates immediately when triggered and goes back to sleep very quickly. I'll monitor battery life but I expect it to be improved.

@eadamsintel
Copy link

@jjlawren Good find! I went ahead and set 5 of my sensors to this value and will test. I am not at home now so I can't test yet. How do you make it stick though? I put in 0x1c20 and clicked the "exec" button next to the "New Long Poll Interval" box. If I reboot the device through the GUI it persists but if I restart the Docker container I am running this in then the values all reset back to 0x0000. I would think the conbee II would hold the values.

I also have a phantom sensor node not connected that won't go away when I delete it. Well it does go away but restarting the docker container or computer makes it come back. Any ideas on how to remove that? It is my 6th MCT-340e sensor that I am having issues with. TIA

@jjlawren
Copy link

Are you reading the cluster attributes to check? You'll only have a very short time period to query after activating the device if this long poll change has been successful.

After setting the long poll value in the top section, the long poll interval attribute changes from the default of 8 to 7200. I wouldn't expect the "set" values to reflect the device's current values.

@hgelpke
Copy link

hgelpke commented Jun 21, 2019

Where do I change the poll value?

Logged into Deconz via VNC

@jjlawren
Copy link

Expand the available clusters (right radio button on device), look at cluster info for "0020 Poll Control". In the cluster info panel you should see a section name "Set Long Poll Interval". This is the only way to change the long poll value and must be set in hexadecimal. The attributes below should reflect the new value in number of seconds. You may have to force a fresh read of the attributes.

@eadamsintel
Copy link

@jjlawren Do you know how to remove one of these sensors from deconz? Two of my sensors are unconnected in the GUI. If I delete them then when I restart my computer or restart the docker container they just show back up again. I try to add them back and the Phoscon web gui keeps finding sensors but they never connect. At this point I am thinking to delete the db file and start over adding things and reintegrating with HomeAssistant but I am not sure if that will even work.

Also, is it possible to rename these sensors? Mine are showing up as "MCT-340 E (4)" and "MCT-340 E (5)" I change the name in the Node Info --> Name Box and it says "sending user descriptor set request" but if i click off the node and click on nothing happens. I've tried opening/closing the sensor around the same time as I set this to wake it up and it doesn't ever change the name.

@jjlawren
Copy link

jjlawren commented Jul 2, 2019

I do not know the proper way to remove them, but starting with a fresh database should do it. I had to do that a few times earlier on in this issue when pairing was half-failing.

Renaming these sensors has not worked consistently for me.

@stale
Copy link

stale bot commented Oct 30, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Oct 30, 2019
@stale stale bot closed this as completed Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants