dresden-elektronik / deconz-rest-plugin

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

EasyAccess EasyCodeTouch #4253

Closed stolevegen closed 3 years ago

stolevegen commented 3 years ago

Device

Screenshots

OTAU CLUSTER DOORLOCK CLUSTER 2 DOORLOCK CLUSTER GROUP CLUSTER 2 SCENES CLUSTER 3 SCENES CLUSTER 2 SCENES CLUSTER IDENTIFY CLUSTER POWER CONFIGURATION CLUSTER BASIC CLUSTER DOORLOCK ATTRIBUTES NODE INFO EASYCODETOUCH ENDPOINTS EASYCODETOUCH
stolevegen commented 3 years ago

Ok, found that Home Assistant instance is causing the api error. No relevant info in HA logs, and the deCONZ integration works like it should within HA.

I will keep device included from here on out. Only thing missing now is the attributes for autorelock and soundvolume

Screenshot 2021-04-02 at 09 04 28 Screenshot 2021-04-02 at 09 04 42 Screenshot 2021-04-02 at 09 04 49
Smanar commented 3 years ago

Only thing missing now is the attributes for autorelock and soundvolume

But thoses setting are not dynamic ? you set them one time, and never change them again no ?

stolevegen commented 3 years ago

No, by design they are dynamic. But for some reason, in my case, they were greyed out since the first time I set them.

Smanar commented 3 years ago

No by static, I mean , you don't change the setting all days ? The api will be used by third app, do you think someone will use this command in a script in HA for exemple ?

I can add an hidden command, but not sure a full support is something usefull ?

If you press the "read" button, it not re-enable grayed attributes after some time ?

stolevegen commented 3 years ago

No by static, I mean , you don't change the setting all days ? The api will be used by third app, do you think someone will use this command in a script in HA for exemple ?

Gotcha. That's correct, it's mostly set and forget. I guess someone could want to change the auto-relock based on if they are home or not. Personally I would rather have an actionable notification automation that asked if I would like to open the door for someone, and then lock after a longer delay or when they leave again.

If you press the "read" button, it not re-enable grayed attributes after some time ?

No, now they are not visible. The general.xml in my deconz-rest-plugin directory matches doorlock_v2 branch. The general.xml in /usr/share/deCONZ/zcl does not have autorelock etc included. As long as plugin is active, it should read from deconz-rest-plugin, no?

Screenshot 2021-04-03 at 13 19 05 Screenshot 2021-04-03 at 12 58 09 Screenshot 2021-04-03 at 12 58 03 Screenshot 2021-04-03 at 12 57 49
Smanar commented 3 years ago

The general.xml in /usr/share/deCONZ/zcl does not have autorelock etc included

It s because you are not using the last version, even the version from last beta have it now, try to overwrite yourself the file, updating the lb, don't update the xml https://github.com/dresden-elektronik/deconz-rest-plugin/blob/master/general.xml#L1501

The version in V2 is the same + some tests for the PIN management.

But it don't explain why field are disabled for you ......

But this setting is not for that, the auto relock is just to relock door after it was closed, so just the time, to open the door, enter and close the door, not to let some time to someone to enter, do something and go out.

stolevegen commented 3 years ago

the auto relock is just to relock door after it was closed, so just the time, to open the door, enter and close the door, not to >let some time to someone to enter, do something and go out.

Yes, what I meant was that maybe it's more desirable to keep relock disabled if you are controlling the lock through home automation software. Example, if you have an automation that unlocks the door when you arrive home. With relock enabled you would always have only a 7 sec window to enter the door from the automation triggers.

It s because you are not using the last version, even the version from last beta have it now, try to overwrite yourself the file, >updating the lb, don't update the xml

Done. As long as I don't read the attributes they work, and the changes take effect. It seems it's only when I read the attributes they are greyed out. See below.

First start

Second start

Third start

Fourth start

Smanar commented 3 years ago

It s perhaps when you read attributes, the button "read" read all of them, perhaps aggressive for battery sensor Try with selecting an attribute, and the button "read" and "write" of the second panel.

stolevegen commented 3 years ago

Yep, you are correct. Reading one by one keeps them enabled

Smanar commented 3 years ago

Ha ? seriously ? lol, it s just that the trick ?

stolevegen commented 3 years ago

Yep, simple as that :) Tested multiple times the last 30 minutes.

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.

Smanar commented 3 years ago

@stolevegen hello ^^ We have a problem ATM with doorlock and as you have a sniffer it can be usefull. We are trying the pin magement, and we don't know why when we make the request with the API the device make 2/3 cycle and only one when doing the request with the GUI

https://github.com/dresden-elektronik/deconz-rest-plugin/issues/3750#issuecomment-831516607

stolevegen commented 3 years ago

@Smanar You are referring to get pin command, to receive a certain user ID's pin code ? I'm not sure if my lock module supports that, I think only set and clear, I will check.

Smanar commented 3 years ago

If you want to test, there is a PR that add some fonction to the GUI with changing the xml file https://github.com/dresden-elektronik/deconz-rest-plugin/pull/4795

Smanar commented 3 years ago

For information I have removed "beta code", so you can test the branch as it.

sudo apt install deconz-dev
git clone --branch doorlock_v2 https://github.com/Smanar/deconz-rest-plugin.git
cd deconz-rest-plugin
qmake && make -j2
sudo cp ../libde_rest_plugin.so /usr/share/deCONZ/plugins

To use the GUI, just update the xml file To use the API

/api/{apikey}/sensors/{sensorid}/state/pin/{userid}

Is only for GET (get a pin) and DELETE (remove a pin)

For the PUT the body need to be {"id":4,"type": X, "status":Y, "code":"YYYYYY"}

and the url only /api/{apikey}/sensors/{sensorid}/state/pin

But when he use a request using the api , the device react 3 times Not happen when he use the GUI.

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.

mpunktnuSupport commented 3 years ago

This might be the completely wrong place to post this, if so, please help me find a more proper place.

But I got this lock as well and running it with HomeAssistant using their latest Deconz docker. I have managed to get it working in the Deconz view by manually requesting the attributes. And using the Cluster Info tab I can lock/unlock.

However, nothing shows in either Phoscon or HomeAssistant. I had the impression that you guys got it to work in Phoscon at least. And by the changelog in the HA docker it looks like this should have been included. Also, @stolevegen showed some nice HA images!

Please help a clueless user if possible where to start :)

Best regards, Erik

Smanar commented 3 years ago

Hello, it seem you are not alone with problem https://github.com/dresden-elektronik/deconz-rest-plugin/issues/5042

What is your deconz version ? Can you show the logs during the failed inclusion ? With "info" and "info_l2" ?

mpunktnuSupport commented 3 years ago

Thanks for taking a look!

Running Home Assistant Deconz addon version 6.9.0 Should be deCONZ version 2.11.5

The inclusion doesn't fail. Or rather, Phoscon doesn't show anything, even during inclusion, but it is added to the network when looking in deconz view.

I'll try a re-add later today and see if I can catch the log

Smanar commented 3 years ago

You need a third app to see it (or use direclty the API), phoscon don't display doorlock.

mpunktnuSupport commented 3 years ago

Well, I believed that that you got a GUI going in this issue? Anyways, that's what Home Assistant is for.

However, I tried some more. The logging is not that easy to get from Home Assistant without alot of other mess, so might install deconz on my main computer instead.

But, I don't know if this is a thing. When I add the lock without the outdoor panel attached, it adds perfectly. It adds as doorlock and shows in Home Assistant. But it can't be controlled. Neither from Home Assistant or deconz interface.

When adding it with outdoor panel attached, interview seems lock up on "Read Node Descriptor" and device is added as unknown. It does not show in Home Assistant, but after manually redoing the "Read Simple Descriptors" it can be controlled from deconz but still nothing in Home Assistant.

Am I crazy, or could this be a thing?

Smanar commented 3 years ago

There is no "electronic" in the outdoor panel ? So it's seem shield issue like lot of zigbee device.

It adds as doorlock and shows in Home Assistant. But it can't be controlled. Neither from Home Assistant or deconz interface

This is not normal, If you take a look on log you probably will see connection error.

device is added as unknown. It does not show in Home Assistant, but after manually redoing the "Read Simple Descriptors" it can be controlled from deconz but still nothing in Home Assistant

You let phoscon in "add new sensor" during the procedure ? And I m curious to see the "unknown" device json ?

mpunktnuSupport commented 3 years ago

Thank you for your hard work and patience @Smanar!

I've been working directly with EasyAccess and probably have a bad chip. Will get a replacement and hopefully that clears everything up.

Smanar commented 3 years ago

You haven't see connection error in logs ? But it need to work on deconz, else it will never be able to work using the API.

On doorlock cluster, commands are native, pure zigbee, thoses one need to work.