gwww / elkm1

ElkM1 Python package
MIT License
19 stars 8 forks source link

Question: Ever seen Keypad Zero? #41

Closed jimboca closed 2 years ago

jimboca commented 3 years ago

I have a user who is seeing Keypad Zero: 2021-02-22 11:47:59,174 ELK-91721 elkm1_lib.elk DEBUG elk:_got_data: got_data '17IC000000000000006000076'

From the Elk RS232 protocol doc, 17IC is the length and command for: Send Valid User Number and Invaild Code (IC) , so this breaks this out to: 17IC 00 00 00 00 00 00 006 00 0076

The 006 means it is user #6, but the 00 after that means it's keypad zero which makes no sense to me? Any idea why it shows as keypad zero? I've asked Elk support but I am not getting an answer. Also, anyway to get a callback registered for that?

Right after the IC we do see an LD so I get a callback on the Area for user 6, but now way to know what keypad it is coming from. He is using M1TouchPro app and has a keypad set, I do the same on my system and I do get a proper Keypad number.

gwww commented 3 years ago

I'm not sure why you are getting a keypad # of zero. I have a theory that when arming/disarming the system using the API (i.e.: not a physical keypad) it uses a keypad number of 0. However, just a theory, and it doesn't make sense when I look at the library code. This line of code: https://github.com/gwww/elkm1/blob/main/elkm1_lib/keypads.py#L39, the keypad param would be -1 if IC returned a keypad number of 0. A -1 should throw an exception -- and I've tested this code many many times and have never seen that exception. So, really not sure what is going on.

What keypads does this person have programmed on their system? Myself I have keypads 1-3. I'm wondering what happens if the person didn't have a keypad 1 programmed and that causes a 0 to be used. Does the person who has this problem not see an exception? That doesn't add up if they don't.

Elk support is the right path to keep poking. I poke on their forum when I get a chance to look at this again.

Anyway, congrats on successfully using this library! It has quite a bit of use through Home Assistant and there are no problem reports.

jimboca commented 3 years ago

Thanks, it's really working out great. Your library has made it much easier!

We still can not figure this out, and the email contact I had at Elk is not responding, so I registered for their forum and posted the question: https://www.elkproducts.com/forums/topic/receiving-keypad-zero-from-api/

jimboca commented 3 years ago

I got an email response from ELK.

I use M1TouchPro with my home system and I get the same thing as Jim.

I enter User Code #1 using M1TouchPro and the M1 replies with: 17IC00000000000000001007B\r\n

Not sure but I'm guessing that M1TouchPro (being a virtual keypad) might be sending a Keypad address number greater than 16. The limit for the number of keypads is 16. I?ll have to contact the App developer to ask about that.