Hi,
So, I am using a 4 x 4 matrix keypad for a project. But I like to be able to change the layout of the keys using an automation, boolean or a switch inside HA. For instance change ABCD to EFGH and back. or 1234567890 to other digests or characters. Any suggestions?
just create a second keypad in your config that’s identical to the one you have except give this one a new name and ID, also change the keys to letters instead of numbers. You can then create a switch that either read the input from keypad1 or keypad2. You could likely create an automation for example if “*5” then toggle keypad to the other one. This way you can switch back and forth from the keypad itself rather than having to go to HA and toggle a switch.
Ive already tried different methods but nothing worked so far.
I tried creating two different key collectors for each layout, that didn’t work.
The keys are defined in key configuration and cant be modified. So, I tired to have two different key configuration or add the extra digests, that didn’t work either.
Could you be a bit more specific as to what you mean by second keypad?
Thanks
you make a second keypad in your config just like the one you have now except give it a new name, ID, and instead of making the keys (123…) you make the keys (abcd…)
you make a second keypad just like the first one except give it a new name/id and change the keys from numbers to letters. This will give you 2 keypads, keypad1 returns numbers and keypad2 returns letters.
Well… if I could get the layout to change I could have full alphabet, that was the idea. I am working on a project to build a box to control HA. My first attempt went pretty well, with OLED screen, a knob, LED lights and a keypad. Then I thought having to type things would make it a lot easier to trigger automation or do more with the box. it works great so far where I type AC and it toggles my AC On/Off.
Oh, I see. I had thought of doing something similar with my keypad but instead of switching to an alphabet, just using numeric codes but, my use case was much more specific to my garage where the keypad is installed and there would just be a few entities to remember codes for. That’s a cool idea though but it seems like it could easily get confusing which layout your using without some kind of external indicator as you’d need at least 3 seperate key collectors to incorporate a usable alphabet. Just throwing this out there if you want it. before going with an actual keypad i made a project that uses a button, rotary encoder, and a 4x20 lcd. The idea was for it to work like a combination lock so it starts at zero and clockwise rotation increases the numbers, and decreses on counter-clockwise. when you stop on a number and push the button it locks that number in on the lcd and then moves to the next space for a new number etc. If the numbers entered match a pre-set code it performs an action based on what code is entered. If you want that code, you could easily modify it to rotate through an alphabet or numbers and you can actually see if your selecting a number or a letter. It fully works, I never moved it off my workbench due to the waterproofing needs i needed because it was going to be installed outdoors.
you would have to change it around to make it work for what you are doing but you should be able to just fine. This expects the user to enter 3 integers and you would likely need a different number for different things.
If you want to use it as is and make a digital combination lock, this is where you’d set the code. So here the correct code is 11-22-25.
you could also just duplicate this section and make multiple “if” statements for different codes like this and then depending on which code you enter, you can have different actions happen.
no problem. If you don’t mind, I’d love to see what your building. I’ve been struggling to come up with new things to build and i’m always looking for ideas and inspiration even if it isn’t a finished project.
This is the “MyBox” project I am currently working. It’s my first attempt but it needs some adjustments. I shouldn’t have used keypad.
I have created 6 pages for the OLED so far, showing me the status of some sensors from HA. Ive also created some automations to turn On/Off some lights or devices using certain key strokes on the keypad.