-
Notifications
You must be signed in to change notification settings - Fork 482
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
Adding DDF for IDlock 150 #5775
Adding DDF for IDlock 150 #5775
Conversation
f1637af
to
f004a59
Compare
Without binding/report, values will be updated only when you will read them in deconz.
It mean you have a bind from the cluster 0x0101, EP¨0x01 from the device to the gateway on EP 0x01. that for the attribute 0x0003. DT is the attribute type, min and max are delay between 2 reports. ATM on code we are using as value for the attribute 0x0000
And for the 0x0003
Here you have made more work than me ^^ BTW, state/open is working ? I think too it's better to remove As the device will use report, no need to poll it. |
Thanks for the feedback, now the bindings make complete sense! I'll try using the same intervals as the c++ code then and give it a go without the explicit mf code.
This is a bit funky. Because if I restart deCONZ then If I started deCONZ with no javascript file and no expression for Edit: And I forgot to mention, the 'status/open' works perfectly. |
f004a59
to
6aaa1bd
Compare
Nice catch, I will ask to other devs if they have idea
BTW, you still have the mf here, I think you can remove all And there is something strange on DT
And both are enum8, so it's strange 0x0003 is working .... Have you tried to read the value in deconz ? when you read the value in deconz it need to update the filed in the API too in same time (this procedure works without bind/report, usefull to test the first part) and with the same value ofc. and it's a long story, but for easy setting, it s esaier to set the status to "gold" for your tests, to be sure the DDF is always loaded. |
Okay, got all the mf parts removed here now. The datatypes are still a huge mystery to me. So I know that the devices will return an enum for both of these fields. So when I used on javascript or expression I just got numbers. Now in the parse function I could produce whatever datatype I want. So for the lockstate it made sense to create a string which matches the standard lock state values. But I would much rather have just used the enum, but I didn't understand how to do that. For the door state I would ideally have created a new Now, the thing that isn't making sense to me right now is that both lockstate and doorstate are grey when I try to read them in the cluster in deCONZ. But still these values get updated when I call the API. All except So I guess I'm asking, should I go about returning an enum in this case? Deconz seems to be able to fill in the "locked/unlocked" values in the UI, can I instruct the API to do the same thing? I'm also on the discord channel with the same nick btw if I'm not making sense right now. I find it's a bit hard to describe what's going on here as it's not clear to me how read and parse relate to eachother and to the bindings. For instance is the parse function used by the bindings? |
??? you can't select a data type in parse / read ? But NVM, will see later for the correction, for the moment having a value is nice ^^.
Ha yes, have already see this issue on another doorlock, never use the "read" button, because it ask for all attributes in same time, and the doorlock is not able to do that, and one time the attribute is disabled not possible to asking it a second time. Better to ask the attribute one by one. It's the parse part that is used with binding. To resume state/lockstate, attribute 0x0000 > locked to 3 ? right ? I don't check for config/lock because this one is special (can be updated by the API itself) So for state/lockstate, as this value is used at 2 places, can be the problem but it s strange the value can move, you have set "Item.val = Attr.val" for test ? And why the value 3 ?
The issue can be from the missing file in devices/generic/items Try with adding for exemple config_lock_item.json
|
Yes, that's what I mean. When parsing the value I can return whatever datatype I want. This is confusing as it's not clear from the UI what this variable is used for.
This is helpfull, so I it doesn't matter what the datatype of the attribute on the devices is, it matters how it is parsed. But is the parse function also used for reads?
Does this mean that I shouldn't do any parsing for this one?
There is already an entry for |
oh, and as for this one
It doesn't matter what I set it to. If i use my javascript it will stay as 'unlocked' for ever, if I use 'Item.val = Attr.val' it will stay as '2' forever. No change if I lock the door, or change the expression. |
Ha ok, on my side when I say type, was zigbee type, the "dt" field used in the zigbee request ( thoses types https://github.com/dresden-elektronik/deconz-rest-plugin/blob/master/general.xml#L5 ), , not the returned value type by the API.
If I m right, the read part is for the poll stuff, using the field "interval"
You need too, but this one use the API stuff, it's a long story, but to resume, it's updated first by the api, after the request is done, and the value is updated again according to device return, so you can have "strange result" with this one.
This one is for TRV, it's the childlock, better to use a new one.
Have you tried to read the value in deconz ? when values are not disabled (if you don't read all attribute in same time using the "read" button) If it update the value in same time > binding issue. |
Okay, so the data types in the bindings are for the data sent by the zigbee devices then. So in my case both lockstate and doorstate should be
Ah, right. New one it is.
How can I do that? I only see the one read option next to the list of attributes. |
For me yes, but it seem it don't make a big difference for the moment.
Easy, just double clic on the attribute you want to read (this one need to be enabled) then "read" button on the new popup. Just don't use the "read" button above the attribute table. If the attribute is still disabled after that, I think we have a problem, it will be like the attribute not existing at all (or making a bad request to read it) |
Hello, some improvement ^^ ? |
Impossible as the attribute is grey, even after making sure the attribute is marked as 'public' I have to admit that considering the amount of time I've spent trying to figure out how deconz and the DDFs work versus the progress I've made I'll probably not be pursuing this any further. Thanks for your help though. |
@brujoand what did your last DDF look like? and what works/dosnt? |
@ZeppDK I actually ended up migrating everything to zigbee2mqtt instead so I don't have any copies other than what's in this PR. I did get lock/unlock to work I think. Or it might have been the existing support that did that. There wasn't really any way to tell. But I know for certain I was able to expose the open/closed state. But yeah. That's about it. |
So after creating #5739 I wanted to try to add support for showing the state of the door (open/closed) in addition to the lockstatus for this device. I have no idea what I'm doing so please throw all the feedback at me.
This PR is functionally working, but only by trial and error, and has one flaw.
config/lock
works as expected butstatus/lockstatus
does not. I'm assuming this is because I don't understand how to supply a proper enum return value. I did try to create lockstatus.js to work around this, but to no avail.I also have no idea what the bindings are for, but they were suggested by the DDF editor so I kept them. Could someone please elaborate on what this achieves?
C++ support was added for this lock with #3827, and to test this I changed my config to allow bronze DDFs. With that setup I could lock and unlock the app through the rest API, but I don't know if that's due to my DDF being fantastic, or to the existing C++ functionality. I would assume only the DDF are used in this case.
This is the output currently get from the api:
Where
config/battery
config/lock
andstatus/open
work as expected whilestatus/lockstatus
does not.