[SOLVED] BasicUI - keypad

Tags: #<Tag:0x00007fc3f7474998>

Hi,
I would like to arm/disarm my alarm via BasicUI. I would need to enter a 4-digit code for this.

I have tried this:

Switch item=Tex_UDP_Send label="Alarm keypad" mappings=[KEY0="0", KEY1="1", KEY2="2", KEY3="3", KEY4="4", KEY5="5", KEY6="6", KEY7="7", KEY8="8", KEY9="9", KEYN="N", KEYY="Y"]

But this gets very messy. I guess “switch” was not designed for that many selection options.

I also tried this:

Selection item=Tex_UDP_Send label="Alarm keypad" mappings=[KEY0="0", KEY1="1", KEY2="2", KEY3="3", KEY4="4", KEY5="5", KEY6="6", KEY7="7", KEY8="8", KEY9="9", KEYN="N", KEYY="Y"]

From a layout perspective, this is ok. However, it is more difficult to enter your 4 digit code (open selection - select digit 1 - reopen selection - select digit 2 - …).

Do I have other options for this?

Dries

This should be what you are looking for :slight_smile:

Switch item=Tex_UDP_Send label="Alarm keypad" mappings=[KEY1="1", KEY2="2", KEY3="3"]
Switch item=Tex_UDP_Send label=""             mappings=[KEY4="4", KEY5="5", KEY6="6"]
Switch item=Tex_UDP_Send label=""             mappings=[KEY7="7", KEY8="8", KEY9="9"]
Switch item=Tex_UDP_Send label=""             mappings=[KEYN="❌", KEY0="0", KEYY="✔️"]

Please post a screenshot for others :wink:

5 Likes

Not bad… not bad at all!
Thanks!

On Android:

On my desktop:

The Android-version looks better, and luckily that is what I will be using.

Thanks

1 Like

ah, I’ve missed icon="" for the latter three

1 Like

Haha, I just came to the same conclusion.

The icon="" didn’t work, but icon=“none” did the trick.

		Switch item=Tex_UDP_Send label="Alarm klavier" 	icon="alarm"	mappings=[KEY1="1", KEY2="2", KEY3="3"]
		Switch item=Tex_UDP_Send label=""	icon="none"					mappings=[KEY4="4", KEY5="5", KEY6="6"]
		Switch item=Tex_UDP_Send label=""	icon="none"					mappings=[KEY7="7", KEY8="8", KEY9="9"]
		Switch item=Tex_UDP_Send label=""	icon="none"					mappings=[KEYN="X", KEY0="0", KEYY="✓"]

If you want a HABPanel version also, check out:

:slight_smile:

1 Like

Mind posting your rules? I’m trying to do the basic alarm example as well, but am stuck trying to get the keypad to concatenate values into a code to test.

I think a basic “alarm” example with a generic set of items not tied to any one binding would be very helpful for beginners.

Hi,
I’m happy to share my rules. However, I’m not convinced it would help you. In my case, the keypad values do not need to be concatenated. Every individual keypress is send as a separate command to my alarm system.

This is the endresult in BasicUI:

Sitemap definition:

		Text label="Alarm" icon="shield" {
			Switch item=Tex_QuickArm 					label="Alarm"						mappings=[ON="Nu inschakelen"]			visibility=[Tex_QuickArm_visibility==ON]
			Text item=gAllecontacten 					label="[%d contacten staan open]" 	icon="window"							visibility=[Tex_QuickArm_visibility==OFF]  {		
				Text item=Tex_Zone_Z001   				visibility=[Tex_Zone_Z001!=0]
				Text item=Tex_Zone_Z002   				visibility=[Tex_Zone_Z002!=0]
				Text item=Tex_Zone_Z003   				visibility=[Tex_Zone_Z003!=0]
				Text item=Tex_Zone_Z004   				visibility=[Tex_Zone_Z004!=0]
				Text item=Tex_Zone_Z005   				visibility=[Tex_Zone_Z005!=0]
				Text item=Tex_Zone_Z006   				visibility=[Tex_Zone_Z006!=0]
				Text item=Tex_Zone_Z007   				visibility=[Tex_Zone_Z007!=0]
				Text item=Tex_Zone_Z008   				visibility=[Tex_Zone_Z008!=0]
				Text item=Tex_Zone_Z009   				visibility=[Tex_Zone_Z009!=0]
				Text item=Tex_Zone_Z010   				visibility=[Tex_Zone_Z010!=0]
			}
			Frame label="Alarm status" {			
				Text item=Tex_Alarm_Status					label="Het alarm is" 		valuecolor=[0="green", 1="red", 2="orange", 3="red", 4="red"]			
				Text item=Tex_Alarm_Status_Update			label="op"
				Text item=Tex_Alarm_ArmDisarmUser					label="door de gebruiker"
			}
			Frame label="Alarm klavier" {
			Text item=Tex_Alarm_Textline1				label="Alarm scherm"
			Text item=Tex_Alarm_Textline2				label=""				icon="none"	
			Switch item=Tex_Alarm_Keypad 					label="Alarm klavier" 	icon="alarm"				mappings=[KEY1="1", KEY2="2", KEY3="3"]			visibility=[Tex_Alarm_Keypad_visibility==ON]
			Switch item=Tex_Alarm_Keypad 					label=""				icon="none"					mappings=[KEY4="4", KEY5="5", KEY6="6"]			visibility=[Tex_Alarm_Keypad_visibility==ON]
			Switch item=Tex_Alarm_Keypad 					label=""				icon="none"					mappings=[KEY7="7", KEY8="8", KEY9="9"]			visibility=[Tex_Alarm_Keypad_visibility==ON]
			Switch item=Tex_Alarm_Keypad 					label=""				icon="none"					mappings=[KEYN="❌", KEY0="0", KEYY="✔️"]		visibility=[Tex_Alarm_Keypad_visibility==ON]
			// Selection item=Tex_Alarm_Keypad label="Alarm klavier" icon="alarm"	mappings=[KEYO="Weglaten", KEYC="Deurbel", KEYP="Part", KEYA="Area", KEYR="Reset", KEYU="Pijl omhoog", KEYD="Pijl omlaag", KEYM="Menu", KEYF="Brandgevaar", "KEY+"="Medisch gevaar", KEYH="Keypad PA"]			visibility=[Tex_Alarm_Keypad_visibility==ON]
			}
			Frame label="Historiek" {
				Text item=Tex_History_01								icon="none"
				Text item=Tex_History_02								icon="none"
				Text item=Tex_History_03								icon="none"
				Text item=Tex_History_04								icon="none"
				Text item=Tex_History_05								icon="none"
				Text item=Tex_History_06								icon="none"
				Text item=Tex_History_07								icon="none"
				Text item=Tex_History_08								icon="none"
				Text item=Tex_History_09								icon="none"
				Text item=Tex_History_10								icon="none"
			}
			Frame label="Status Alarmcontacten" {
				Group item=gDeur
				Group item=gRamen
				Group item=gRaamcontact
				Group item=gGlasbreuk
			}

Some rules I use to drive the sitemap:

// ***************************
// Arm alarm by one button
// ***************************

rule "Quick Arm"
	// Arm the alarm by a single switch. It automatically logs on to the alarm using code 9999 and sets the alarm to "armed". First it checks if certain doors/windows are open. 
	// Your alarm system requires a dummy user (with code 9999) to arm the alarm. Obviously, this user is not allowed to do anything else (disarm, change settings, view status,...).
	// Please verify if your "quick arm user" is not able to disarm your alarm.
when   
    Item  Tex_QuickArm changed
then
    if (Tex_QuickArm.state == ON) {
		if((gAlarmcontact.members.filter(s | s.state != 0).size == 0) && (Tex_Alarm_Status.state == 0)) { 
			// If this is "true", that means all relevant contacts (windows, doors) are closed and the alarm is currently disarmed. Now we can proceed with arming the alarm.
			// 500ms sleep is introduced between each button press, so the Texecom has time to process the UDP packets in the right order.
			// The get LSTATUS is temporarily turned off. I think Texecom gets confused if we ask LSTATUS while keying in a code.
			sendCommand(Tex_Get_LSTATUS, OFF)
			Thread::sleep(500)
			sendCommand(Tex_UDP_Send, "KEY9")
			Thread::sleep(500)
			sendCommand(Tex_UDP_Send, "KEY9")
			Thread::sleep(500)
			sendCommand(Tex_UDP_Send, "KEY9")
			Thread::sleep(500)
			sendCommand(Tex_UDP_Send, "KEY9")
			Thread::sleep(1000)
			sendCommand(Tex_UDP_Send, "KEYY")
			// Sometimes the first KEYY is not processed/received by Texecom, that's why we send it twice (it doesn't harm either)
			Thread::sleep(750)
			sendCommand(Tex_UDP_Send, "KEYY")
			Thread::sleep(250)
			sendCommand(Tex_Get_LSTATUS, ON)
			// Put the alarm in exit mode
			postUpdate(Tex_Alarm_Status, "2")
			postUpdate(Tex_QuickArm, OFF)				
		} else {
			logInfo("Alarm","Snel wapenen gefaald wegens openstaande contacten of het alarm niet in de juiste status")
			postUpdate(Tex_QuickArm, OFF)	
		}
    } else {
	    /* Do Nothing - luckily there is no one-button-disarm */
   }
end


rule "Quick Arm Visibility"
	// Determines if the "quick arm" option is visible or not
when   
    Item  gAlarmcontact changed or
	Item  Tex_Alarm_Status changed
then
	if((gAlarmcontact.members.filter(s | s.state != 0).size == 0) && (Tex_Alarm_Status.state == 0)) { 
		// If this is "true", quick arm can be visible
		sendCommand(Tex_QuickArm_visibility, ON)
	} else {
		sendCommand(Tex_QuickArm_visibility, OFF)
	}

end

// ***************************
// Limit access to alarm keypad
// ***************************

rule "Limit access to alarm keypad"
	// After 20 key presses, there might be someone trying out various codes. The keypad will become unavailable for 5 minutes.
	
when   
    Item Tex_Alarm_Keypad received update
then
	var teller = Tex_Alarm_Keypad_counter.state as DecimalType + 1
	postUpdate(Tex_Alarm_Keypad_counter, teller)
	if (Tex_Alarm_Keypad_counter.state < 21) {
		sendCommand(Tex_UDP_Send, Tex_Alarm_Keypad.state.toString)
	}
	else {
		sendCommand(Tex_Alarm_Keypad_visibility, OFF)
		logInfo("Alarm","Er zijn teveel pogingen geweest. Keypad wordt tijdelijk afgesloten")
	}
	
end

rule "Reset access to alarm keypad"

when   
   	Time cron "0 0/5 * 1/1 * ? *"
then
	// logInfo("Alarm","Teller alarmklavier reset")	
	sendCommand(Tex_Alarm_Keypad_counter, "0")
	sendCommand(Tex_Alarm_Keypad_visibility, ON)
end

// ***************************
// Display the history of the last 10 events
// ***************************

rule "History of last 10 events - part 1"

when   
    Item Tex_History_00 changed
then
	postUpdate(Tex_History_10, Tex_History_09.state.toString)
	postUpdate(Tex_History_09, Tex_History_08.state.toString)
	postUpdate(Tex_History_08, Tex_History_07.state.toString)
	postUpdate(Tex_History_07, Tex_History_06.state.toString)
	postUpdate(Tex_History_06, Tex_History_05.state.toString)
	postUpdate(Tex_History_05, Tex_History_04.state.toString)
	postUpdate(Tex_History_04, Tex_History_03.state.toString)
	postUpdate(Tex_History_03, Tex_History_02.state.toString)
	postUpdate(Tex_History_02, Tex_History_01.state.toString)
	postUpdate(Tex_History_01, Tex_History_00.state.toString)
	Thread::sleep(100)
	Tex_History_10.label = Tex_History_10.state.toString
	Tex_History_09.label = Tex_History_09.state.toString	
	Tex_History_08.label = Tex_History_08.state.toString
	Tex_History_07.label = Tex_History_07.state.toString
	Tex_History_06.label = Tex_History_06.state.toString
	Tex_History_05.label = Tex_History_05.state.toString
	Tex_History_04.label = Tex_History_04.state.toString		
	Tex_History_03.label = Tex_History_03.state.toString		
	Tex_History_02.label = Tex_History_02.state.toString			
	Tex_History_01.label = Tex_History_01.state.toString
end


rule "History of last 10 events - part 2 - ramen"

when   
    Item gRamen received update

then
	// Hack to get at the most recently changed window contact
	Thread::sleep(100) // experiment with this value, the purpose is to give persistence time to save the state so lastUpdate will work properly. You may not need it at all but if the wrong button keeps coming up, make this sleep longer
	var event = gRamen.members.sortBy[lastUpdate].last
	var event_update = event.lastUpdate.toDateTime.toString("dd-MM-yy HH:mm")
	var event_label = event.label.toString.split("   ")
	var event_status = transform("MAP","windows.map",event.state.toString)
	postUpdate(Tex_History_00, event_update + " - " + event_label.get(0) + " - " + event_status)	
end

rule "History of last 10 events - part 3 - deuren"

when   
    Item gDeur received update

then
	// Hack to get at the most recently changed window contact
	Thread::sleep(100) // experiment with this value, the purpose is to give persistence time to save the state so lastUpdate will work properly. You may not need it at all but if the wrong button keeps coming up, make this sleep longer
	var event = gDeur.members.sortBy[lastUpdate].last
	var event_update = event.lastUpdate.toDateTime.toString("dd-MM-yy HH:mm")
	var event_label = event.label.toString.split("   ")
	var event_status = transform("MAP","tex_contacts.map",event.state.toString)
	postUpdate(Tex_History_00, event_update + " - " + event_label.get(0) + " - " + event_status)
end

rule "History of last 10 events - part 4 - glasbreuk"

when   
    Item gGlasbreuk received update

then
	// Hack to get at the most recently changed window contact
	Thread::sleep(100) // experiment with this value, the purpose is to give persistence time to save the state so lastUpdate will work properly. You may not need it at all but if the wrong button keeps coming up, make this sleep longer
	var event = gGlasbreuk.members.sortBy[lastUpdate].last
	var event_update = event.lastUpdate.toDateTime.toString("dd-MM-yy HH:mm")
	var event_label = event.label.toString.split("   ")
	var event_status = transform("MAP","tex_contacts.map",event.state.toString)
	postUpdate(Tex_History_00, event_update + " - " + event_label.get(0) + " - " + event_status)
end

rule "History of last 10 events - part 5 - alarm status"

when   
    Item Tex_Alarm_Status changed

then
	var event = Tex_Alarm_Status
	var event_update = event.lastUpdate.toDateTime.toString("dd-MM-yy HH:mm")
	var event_status = transform("MAP","tex_alarmstatus.map",event.state.toString)
	var event_user = transform("MAP","tex_alarmusers.map",Tex_Alarm_ArmDisarmUser.state.toString)
    if (Tex_Alarm_Status.state != 2) {
		postUpdate(Tex_History_00, event_update + " - alarm " + event_status + " door " + event_user)
	}
end

Let me know if you have questions…

1 Like

Thanks for getting back to me. You are right, it won’t solve my issue. I’m trying to replace an old
standalone Ademco alarm with OpenHAB + Arduino. I need to handle the keypad in the basic ui (for HABdroid), so need to collect the keypresses and compare to a saved password. Maybe someone out there has coded this up. Meanwhile, I’ll keep reading docs and trying to sort it out.

That doesn’t sound like a secure solution. And I guess the reason you have an alarm, is security.
If your rule must do “If password = 1234 then sendCommand(Alarmstatus, OFF)”, then anyone who has access to your OpenHAB is able to retrieve your alarm code and switch it off.

If my insurance company would know I have coded my alarm code in my rules (allowing it to switch off my alarm), it will not compensate me, even though I am insured against theft. For them it’s the same thing as writing the alarm code on my front door.

So I would look for a solution where you only send a alarm code from OH to your alarm, and your alarm system should determine if that code is valid (and honestly, even this approach is “grey area” when you ask an insurance company).

Anyway, good luck!

Dries

I agree, security of the entire OpenHab system is required.

Hello everyone,

@Dries It for sure depends on your insurance contract but for general household insurances this is not an issue. They will nevertheless pay if they do not see culpable negligence, such as leaving the door open or unlocked. Having a plaintext password in a secure environment (such as a server with username and password) does not violate that from my point of view.

But I agree, it is not the safest solution, but it does serve my purpose to have the code entered in the rule. Also I am not a programmer (so coding might be a bit stupid), but I developed a solution that works for me, maybe it helps you @JohnChiasson to get some ideas and use parts of it. See in the screenshot what it looks like in BasicUI. Due to size restrictions it only contains 6 numbers, but equals over 45000 of possible combinations, which is enough for me:

SITEMAP

Text item=door_entrance label="Haustür [%s]"
Text item=ema_status
Switch item=keypad icon="none" mappings=[1="1",2="2",3="3",4="4",5="5",6="6"]
//vswitch below can only activate, deactivate with code only
Switch item=vswitch_ema_activate icon="none" mappings=[1="aktivieren"]
Text item=keyentered

ITEMS

Switch alarm "Alarm" <alarm> { channel="..." }
Number keypad "PIN" <lock>
String ema_status "EMA: [%s]" <shield>
Number vswitch_ema_activate "EMA:"
Switch ema
String key1 "key1: [%s]"
String key2 "key2: [%s]"
String key3 "key3: [%s]"
String key4 "key4: [%s]"
String key5 "key5: [%s]"
String keycounter "keycounter: [%s]"
String keyentered "Key entered: [%s]"

RULES

var int int_zero = 0
var int int_one = 1

var int key_digit_1 = 0
var int key_digit_2 = 0
var int key_digit_3 = 0
var int key_digit_4 = 0
var int key_digit_5 = 0
var int key_count = 0

var String unarmed = "inaktiv"
var String armed = "aktiv"



//set new status armed
	rule "EMA activate"
		when
			Item vswitch_ema_activate received command 1
		then
			postUpdate(ema_status,armed)
		end
	
//set new status unarmed	
	rule "EMA deactivate"
		when
			Item vswitch_ema_activate received command 0
		then
				postUpdate(ema_status,unarmed)
		end


	
//Key Pad Code Comparison and alarm system action
	rule "Key Digit"
		when
			Item keypad received command
		then
			//define correct keypad code here
			var int code_1 = 1
			var int code_2 = 2
			var int code_3 = 3
			var int code_4 = 2
			var int code_5 = 1

			//counter used for comparison of current keypad digit status to save the value in the correct variable
			//will be reset after 6 digits have been entered - see below
			if(	key_count == 0) {
						//read status of the keypad and write it to the variable
					key_digit_1 = (keypad.state as DecimalType).intValue
					postUpdate(key1,key_digit_1)
						//counter +1 to allow entry of next number into other variable
					key_count = key_count + 1
					postUpdate(keycounter,key_count)
						//display the just entered number in the updated text in the UI
					keyentered.postUpdate(key_digit_1.toString + "-" + key_digit_2.toString + "-" + key_digit_3.toString + "-" + key_digit_4.toString + "-" + key_digit_5.toString)
					}
				else if (key_count == 1) {
					key_count = key_count + 1
					key_digit_2 = (keypad.state as DecimalType).intValue
					postUpdate(key2,key_digit_2)
					postUpdate(keycounter,key_count)
					keyentered.postUpdate(key_digit_1.toString + "-" + key_digit_2.toString + "-" + key_digit_3.toString + "-" + key_digit_4.toString + "-" + key_digit_5.toString)
					}
				else if (key_count == 2) {
					key_digit_3 = (keypad.state as DecimalType).intValue
					postUpdate(key3,key_digit_3)
					key_count = key_count + 1
					postUpdate(keycounter,key_count)
					keyentered.postUpdate(key_digit_1.toString + "-" + key_digit_2.toString + "-" + key_digit_3.toString + "-" + key_digit_4.toString + "-" + key_digit_5.toString)
					}
				else if (key_count == 3) {
					key_digit_4 = (keypad.state as DecimalType).intValue
					postUpdate(key4,key_digit_4)
					key_count = key_count + 1
					postUpdate(keycounter,key_count)
					keyentered.postUpdate(key_digit_1.toString + "-" + key_digit_2.toString + "-" + key_digit_3.toString + "-" + key_digit_4.toString + "-" + key_digit_5.toString)
					}
				else if (key_count == 4) {
					key_digit_5 = (keypad.state as DecimalType).intValue
					key_count = key_count + 1
					postUpdate(key5,key_digit_5)
					postUpdate(keycounter,key_count)
					keyentered.postUpdate(key_digit_1.toString + "-" + key_digit_2.toString + "-" + key_digit_3.toString + "-" + key_digit_4.toString + "-" + key_digit_5.toString)
		
			//code comparison - if correct, deactivate alarm system, reset variables, counter and displayed code
			if(	key_digit_1 == code_1 &&
				key_digit_2 == code_2 &&
				key_digit_3 == code_3 &&
				key_digit_4 == code_4 &&
				key_digit_5 == code_5) {
	 
				var String success = "korrekt"
				postUpdate(ema_status,success)
				sendCommand(vswitch_ema_activate, 0)
				sendCommand(alarm, OFF)
				key_count = 0
				key_digit_1 = 0
				key_digit_2 = 0
				key_digit_3 = 0
				key_digit_4 = 0
				key_digit_5 = 0
				keyentered.postUpdate(key_digit_1.toString + "-" + key_digit_2.toString + "-" + key_digit_3.toString + "-" + key_digit_4.toString + "-" + key_digit_5.toString)
				Thread::sleep(5000)
				postUpdate(ema_status,unarmed)
				postUpdate(key1,key_digit_1)
				postUpdate(key2,key_digit_2)
				postUpdate(key3,key_digit_3)
				postUpdate(key4,key_digit_4)
				postUpdate(key5,key_digit_5)
				postUpdate(keycounter,key_count)	
				}
			
			
				//if one of the code elements does not match, activate alarm system
				else if( 	
					key_digit_1 != code_1 ||
					key_digit_2 != code_2 || 
					key_digit_3 != code_3 ||
					key_digit_4 != code_4 ||
					key_digit_5 != code_5) {
			
					var String failed = "falsch"
					postUpdate(ema_status,failed)
					sendCommand(vswitch_ema_activate, 1)
					key_count = 0
					key_digit_1 = 0
					key_digit_2 = 0
					key_digit_3 = 0
					key_digit_4 = 0
					key_digit_5 = 0
					keyentered.postUpdate(key_digit_1.toString + "-" + key_digit_2.toString + "-" + key_digit_3.toString + "-" + key_digit_4.toString + "-" + key_digit_5.toString)
					Thread::sleep(5000)
					postUpdate(ema_status,armed)
					postUpdate(key1,key_digit_1)
					postUpdate(key2,key_digit_2)
					postUpdate(key3,key_digit_3)
					postUpdate(key4,key_digit_4)
					postUpdate(key5,key_digit_5)
					postUpdate(keycounter,key_count)	
					}
			}
		end
2 Likes

For anyone who is working towards the same idea, I’ve learned the MySensors binding doesn’t query the child sensors state on startup. Without this functionality, the binding won’t know the door / window contacts states until they change. For any alarm type system, both the controller and sensor nodes need to query states on startup. Anyone have another suggestion for an arduino based system that implements that functionality?

There is rule code in this widget thread that will deal with capturing keypad entries with a mask and concatenating ready for validation:

It’s not a full alarm system example but it is binding free from a keypad entry point of view and you can easily adjust the validation code and sendCommand(Alarmstatus, OFF) equivalent to suit your needs. If my alarm code reaches a stable state I’ll share it but at the moment it still has a few too many //TODO comments in it.

I like the BasicUI sample above, nice to have an alternative to the HABPanel widget.

The whole discussion about insurance is something that I’ve thought about and for me it’s not a major concern as I’m only dealing with my residential and house insurance is not relevant to any alarm system I can avoid that specific issue. The security aspect is important in itself and you should always take appropriate system precautions but if I have a plain text copy of a PIN for now I can live with, although it’s on my to do list for one day.

In relation to someone getting at my OH instance and turning off the alarm, yes they could but in reality the people occupying the house have enough troubles using the pretty side of the UI technology so if somebody wants to go to the level of hacking their way in, reverse engineering my OH configuration to disable the alarm then good luck to them. I’m not protecting anything so valuable that I need to worry about that level of a sophisticated attack so I soon reach the conclusion that if someone was going to go to that level of effort I’m not going to keep them out.

But certainly everyone has to assess their own levels of comfort and meet their insurance requirements.

John not sure about MySensors as I’ve not seen it before but you might want to post a new thread before diverting this. Include more details about your requirements, what you have hardware wise what you’d prefer and see what others have to add or suggest.

I had managed to sort out a keypad using the Basic UI, but lost the code on an OS upgrade gone wrong. The examples everyone posted did help. I eventually plan to try a panel, but the basic ui on a phone is needed as a backup.

Agree, the mysensors issue should go in a separate thread so I’ll write it up when I get a chance.

The same rule code can be used behind the BasicUI and HabPanel so it’s easy enough to use them both as and when you like, just pick the rules you prefer and then adapt the keypad UIs to suit.

I like this, is it me or does the keypad button set continue from where it was last used, or could it clear after a time out of no use, so to start code entry with a “clean sheet”, sorry my bad, it does clear after ( 5000 )

[quote=“Chod, post:17, topic:28818”]
ear after


[/quote]’

In 1st frame only one key gets selected at a time
same behaviour in not in 2nd and 3rd frame. Any suggestion to get same behaviour in 2nd and 3rd. I do not want user to select multiple keys at same time. One key at a time .

Sitemap code :
sitemap keypad label=“KeyPad”
{
Frame label=“Alexa” {

Switch item=Bathroom_Power_A label=" keypad" icon=“alarm” mappings=[KEY1=“1”, KEY2=“2”, KEY3=“3”,KEY4=“4”, KEY5=“5”, KEY6=“6”,KEY7=“7”, KEY8=“8”, KEY9=“9”,KEYN=“X”]
// /Switch item=Bathroom_Power_A label="" icon=“alarm”/ mappings=[KEY4=“4”, KEY5=“5”, KEY6=“6”]
// Switch item=Bathroom_Power_A label="" icon=“alarm” mappings=[KEY7=“7”, KEY8=“8”, KEY9=“9”]
// Switch item=Bathroom_Power_A label="" icon=“alarm” mappings=[KEYN=“X”, KEY0=“0”, KEYY=“✓”]
}
Frame label=“Alexa 2”
Frame {
Frame {
Switch item=Bathroom_Power label=“Alarm klavier” icon=“alarm” mappings=[KEY1=“1”, KEY2=“2”, KEY3=“3”]
}
Frame{
Switch item=Bathroom_Power label="" icon=“none” mappings=[KEY4=“4”, KEY5=“5”, KEY6=“6”]
}
Frame{
Switch item=Bathroom_Power label="" icon=“none” mappings=[KEY7=“7”, KEY8=“8”, KEY9=“9”]
}
Frame{ Switch item=Bathroom_Power label="" icon=“none” mappings=[KEYN=“X”, KEY0=“0”, KEYY=“✓”]
}
}

Frame label="Alexa3" {

Switch item=Bathroom_Power_A label=" keypad" icon=“alarm” mappings=[KEY1=“1”, KEY2=“2”, KEY3=“3”]
Switch item=Bathroom_Power_A label="" icon=“alarm” mappings=[KEY4=“4”, KEY5=“5”, KEY6=“6”]
Switch item=Bathroom_Power_A label="" icon=“alarm” mappings=[KEY7=“7”, KEY8=“8”, KEY9=“9”]
Switch item=Bathroom_Power_A label="" icon=“alarm” mappings=[KEYN=“X”, KEY0=“0”, KEYY=“✓”]
}
}

Hi @Dries

Could you please share your Item definition ?

Best Nanna

Related to the key pad?
They are pretty simple:

/* Alarm keypad */
String Tex_Alarm_Keypad					"Alarm klavier"																				<alarm>					(gAlarm)
Number Tex_Alarm_Keypad_counter			"Alarm klavier - teller"																	<text>					(gAlarm)
Switch Tex_Alarm_Keypad_visibility		"Alarm klavier zichtbaar"																	<lock>					(gAlarm)