diff --git a/nspanel_esphome.yaml b/nspanel_esphome.yaml index 3e5de18..fbbbe15 100644 --- a/nspanel_esphome.yaml +++ b/nspanel_esphome.yaml @@ -539,6 +539,8 @@ api: else id(disp1).set_component_text_printf("icon_state", "%s", page_icon.c_str()); id(disp1).set_component_text_printf("page_label", "%s", page_title.c_str()); + id(disp1).set_component_text_printf("code_format", "%s", code_format.c_str()); + - lambda: |- # Alarm page - Button's icons id(disp1).set_component_text_printf("bt_home_icon", "\uE689"); //mdi:shield-home id(disp1).set_component_text_printf("bt_away_icon", "\uE99C"); //mdi:shield-lock @@ -547,15 +549,6 @@ api: id(disp1).set_component_text_printf("bt_bypass_icon", "\uF19F"); //mdi:shield-edit id(disp1).set_component_text_printf("bt_disarm_icon", "\uE99D"); //mdi:shield-off - - # Supported features - # ARM_HOME = 1 - # ARM_AWAY = 2 - # ARM_NIGHT = 4 - # TRIGGER = 8 - # ARM_CUSTOM_BYPASS = 16 - # ARM_VACATION = 32 - - lambda: |- # Alarm - Buttons if (supported_features & 1) // Alarm - Button - Home { @@ -945,13 +938,20 @@ text_sensor: id(disp1).set_component_text_printf("climate.button07_icon", "%s", "\uE424"); //mdi:power id(addon_climate_update_page_climate); } - else if (page=="fan") + else if (page=="fan") { id(disp1).set_component_text_printf("fan.button_on", "%s", "\uE20F"); //mdi:fan id(disp1).set_component_text_printf("fan.button_off", "%s", "\uE81C"); //mdi:fan-off id(disp1).set_component_text_printf("fan.button_up", "%s", "\uF46D"); //mdi:fan-chevron-up id(disp1).set_component_text_printf("fan.button_down", "%s", "\uF46C"); //mdi:fan-chevron-down } + else if (page=="keyb_num") + { + id(disp1).set_component_text_printf("keyb_num.bview", "%s", "\uE207"); //mdi:eye + id(disp1).set_component_text_printf("keyb_num.bclose", "%s", "\uE158"); //mdi:close-circle + id(disp1).set_component_text_printf("keyb_num.bclear", "%s", "\uE641"); //mdi:eraser-variant + id(disp1).set_component_text_printf("keyb_num.benter", "%s", "\uE12B"); //mdi:check + } } else if (page=="boot" and component=="timeout" and stof(value) >= 5) id(disp1).send_command_printf("page %i", id(wakeup_page_id)); @@ -988,7 +988,11 @@ text_sensor: ESP_LOGD("text_sensor.localevent", "embedded=%i", embedded); } if (domain == "climate") id(service_call_climate)->execute(entity.c_str(), key.c_str(), value.c_str(), (embedded==1)); - else if (domain == "alarm_control_panel") id(service_call_alarm_control_panel)->execute(entity.c_str(), value.c_str()); + else if (domain == "alarm_control_panel") + { + std::string code_format = doc["code_format"]; + id(service_call_alarm_control_panel)->execute(entity.c_str(), key.c_str(), value.c_str()); // DEBUG - Need to open the pin code page first, code_format.c_str()); + } else if (domain == "light") id(ha_call_service)->execute("light.turn_on", key.c_str(), value.c_str(), entity.c_str()); else if (domain == "cover") { @@ -1491,6 +1495,7 @@ script: mode: restart parameters: entity: string + key: string pin: string then: - lambda: |- diff --git a/nspanel_eu.HMI b/nspanel_eu.HMI index 4d48c1d..60f47d4 100644 Binary files a/nspanel_eu.HMI and b/nspanel_eu.HMI differ diff --git a/nspanel_eu.tft b/nspanel_eu.tft index 592a02d..1c84c5a 100644 Binary files a/nspanel_eu.tft and b/nspanel_eu.tft differ diff --git a/nspanel_eu_code/alarm.txt b/nspanel_eu_code/alarm.txt index cc39d72..60d59ab 100644 --- a/nspanel_eu_code/alarm.txt +++ b/nspanel_eu_code/alarm.txt @@ -74,6 +74,13 @@ Variable (string) va0 Text : Max. Text Size: 10 +Variable (string) code_format + Attributes + ID : 34 + Scope : local + Text : + Max. Text Size: 15 + Text page_label Attributes ID : 1 @@ -299,9 +306,13 @@ Hotspot bt_home Events Touch Press Event bt_home_pic.pic=134 + bt_home_text.bco=65024 + bt_home_text.pco=0 + bt_home_icon.bco=65024 + bt_home_icon.pco=0 Touch Release Event - lastclick.txt="{\"domain\": \"alarm\", \"key\": \"home\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\"}" + lastclick.txt="{\"domain\": \"alarm\", \"key\": \"home\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\", \"code_format\": \""+code_format.txt+"\"}" printh 92 prints "localevent",0 printh 00 @@ -319,9 +330,13 @@ Hotspot bt_away Events Touch Press Event bt_away_pic.pic=134 + bt_away_text.bco=65024 + bt_away_text.pco=0 + bt_away_icon.bco=65024 + bt_away_icon.pco=0 Touch Release Event - lastclick.txt="{\"domain\": \"alarm\", \"key\": \"away\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\"}" + lastclick.txt="{\"domain\": \"alarm\", \"key\": \"away\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\", \"code_format\": \""+code_format.txt+"\"}" printh 92 prints "localevent",0 printh 00 @@ -339,9 +354,13 @@ Hotspot bt_night Events Touch Press Event bt_night_pic.pic=134 + bt_night_text.bco=65024 + bt_night_text.pco=0 + bt_night_icon.bco=65024 + bt_night_icon.pco=0 Touch Release Event - lastclick.txt="{\"domain\": \"alarm\", \"key\": \"night\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\"}" + lastclick.txt="{\"domain\": \"alarm\", \"key\": \"night\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\", \"code_format\": \""+code_format.txt+"\"}" printh 92 prints "localevent",0 printh 00 @@ -359,9 +378,13 @@ Hotspot bt_vacat Events Touch Press Event bt_vacat_pic.pic=134 + bt_vacat_text.bco=65024 + bt_vacat_text.pco=0 + bt_vacat_icon.bco=65024 + bt_vacat_icon.pco=0 Touch Release Event - lastclick.txt="{\"domain\": \"alarm\", \"key\": \"vacation\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\"}" + lastclick.txt="{\"domain\": \"alarm\", \"key\": \"vacation\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\", \"code_format\": \""+code_format.txt+"\"}" printh 92 prints "localevent",0 printh 00 @@ -379,9 +402,13 @@ Hotspot bt_bypass Events Touch Press Event bt_bypass_pic.pic=134 + bt_bypass_text.bco=65024 + bt_bypass_text.pco=0 + bt_bypass_icon.bco=65024 + bt_bypass_icon.pco=0 Touch Release Event - lastclick.txt="{\"domain\": \"alarm\", \"key\": \"bypass\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\"}" + lastclick.txt="{\"domain\": \"alarm\", \"key\": \"bypass\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\", \"code_format\": \""+code_format.txt+"\"}" printh 92 prints "localevent",0 printh 00 @@ -399,9 +426,13 @@ Hotspot bt_disarm Events Touch Press Event bt_disarm_pic.pic=134 + bt_disarm_text.bco=65024 + bt_disarm_text.pco=0 + bt_disarm_icon.bco=65024 + bt_disarm_icon.pco=0 Touch Release Event - lastclick.txt="{\"domain\": \"alarm\", \"key\": \"disarm\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\"}" + lastclick.txt="{\"domain\": \"alarm\", \"key\": \"disarm\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\", \"code_format\": \""+code_format.txt+"\"}" printh 92 prints "localevent",0 printh 00 diff --git a/nspanel_eu_code/keyb_num.txt b/nspanel_eu_code/keyb_num.txt new file mode 100644 index 0000000..c0f3068 --- /dev/null +++ b/nspanel_eu_code/keyb_num.txt @@ -0,0 +1,326 @@ +Page keyb_num + Attributes + ID : 0 + Scope : local + Dragging : 0 + Send Component ID : disabled + Locked : no + Swide up page ID : disabled + Swide down page ID : disabled + Swide left page ID : disabled + Swide right page ID: disabled + + Events + Preinitialize Event + dim=home.brightness.val + if(api==0) + { + page page_id.val + }else + { + aux.txt="{\"page\": \"keyb_num\", \"component\": \"currentpage\", \"value\": \"pagechange\", \"entity\": \""+entity.txt+"\"}" + printh 92 + prints "nspanelevent",0 + printh 00 + prints aux.txt,0 + printh 00 + printh FF FF FF + } + + Touch Press Event + aux.txt="{\"page\": \"keyb_num\", \"component\": \"touchevent\", \"value\": \"press\", \"entity\": \""+entity.txt+"\"}" + printh 92 + prints "touchevent",0 + printh 00 + prints aux.txt,0 + printh 00 + printh FF FF FF + + Touch Release Event + aux.txt="{\"page\": \"keyb_num\", \"component\": \"touchevent\", \"value\": \"release\", \"entity\": \""+entity.txt+"\"}" + printh 92 + prints "touchevent",0 + printh 00 + prints aux.txt,0 + printh 00 + printh FF FF FF + +Variable (int32) page_id + Attributes + ID : 17 + Scope: local + Value: 0 + +Variable (string) key + Attributes + ID : 19 + Scope : local + Text : + Max. Text Size: 10 + +Variable (string) entity + Attributes + ID : 20 + Scope : local + Text : + Max. Text Size: 100 + +Variable (string) domain + Attributes + ID : 21 + Scope : local + Text : alarm + Max. Text Size: 10 + +Variable (string) aux + Attributes + ID : 22 + Scope : local + Text : + Max. Text Size: 100 + +Variable (string) value + Attributes + ID : 23 + Scope : local + Text : + Max. Text Size: 10 + +Text t0 + Attributes + ID : 1 + Scope : local + Dragging : 0 + Send Component ID : disabled + Associated Keyboard: none + Text : + Max. Text Size : 10 + +Text pin + Attributes + ID : 2 + Scope : local + Dragging : 0 + Send Component ID : disabled + Associated Keyboard: none + Text : + Max. Text Size : 25 + +Text t1 + Attributes + ID : 18 + Scope : local + Dragging : 0 + Send Component ID : disabled + Associated Keyboard: none + Text : Alarm + Max. Text Size : 10 + +Button b1 + Attributes + ID : 3 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : 1 + Max. Text Size : 1 + + Events + Touch Release Event + pin.txt+=b1.txt + +Button bclose + Attributes + ID : 4 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : X + Max. Text Size : 10 + + Events + Touch Release Event + page page_id.val + +Button b2 + Attributes + ID : 5 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : 2 + Max. Text Size : 1 + + Events + Touch Release Event + pin.txt+=b2.txt + +Button b3 + Attributes + ID : 6 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : 3 + Max. Text Size : 1 + + Events + Touch Release Event + pin.txt+=b3.txt + +Button b4 + Attributes + ID : 7 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : 4 + Max. Text Size : 1 + + Events + Touch Release Event + pin.txt+=b4.txt + +Button b5 + Attributes + ID : 8 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : 5 + Max. Text Size : 1 + + Events + Touch Release Event + pin.txt+=b5.txt + +Button b6 + Attributes + ID : 9 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : 6 + Max. Text Size : 1 + + Events + Touch Release Event + pin.txt+=b6.txt + +Button b7 + Attributes + ID : 10 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : 7 + Max. Text Size : 1 + + Events + Touch Release Event + pin.txt+=b7.txt + +Button b8 + Attributes + ID : 11 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : 8 + Max. Text Size : 1 + + Events + Touch Release Event + pin.txt+=b8.txt + +Button b9 + Attributes + ID : 12 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : 9 + Max. Text Size : 1 + + Events + Touch Release Event + pin.txt+=b9.txt + +Button bclear + Attributes + ID : 13 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : < + Max. Text Size : 5 + + Events + Touch Release Event + pin.txt="" + +Button b0 + Attributes + ID : 14 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : 0 + Max. Text Size : 1 + + Events + Touch Release Event + pin.txt+=b0.txt + +Button benter + Attributes + ID : 15 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : OK + Max. Text Size : 3 + + Events + Touch Release Event + aux.txt="{\"domain\": \"keyb_num\", \"key\": "+key.txt+", \"value\": "+value.txt+", \"entity\": \""+entity.txt+"\", \"base_domain\": "+domain.txt+"\"}" + printh 92 + prints "localevent",0 + printh 00 + prints aux.txt,0 + printh 00 + printh FF FF FF + +Button bview + Attributes + ID : 16 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : O + Max. Text Size : 3 + + Events + Touch Press Event + if(pin.pw==1) + { + pin.pw=0 + }else + { + pin.pw=1 + } + diff --git a/nspanel_us.HMI b/nspanel_us.HMI index da98489..9fa31e8 100644 Binary files a/nspanel_us.HMI and b/nspanel_us.HMI differ diff --git a/nspanel_us.tft b/nspanel_us.tft index 099eee2..a037dcd 100644 Binary files a/nspanel_us.tft and b/nspanel_us.tft differ diff --git a/nspanel_us_code/alarm.txt b/nspanel_us_code/alarm.txt index cc39d72..60d59ab 100644 --- a/nspanel_us_code/alarm.txt +++ b/nspanel_us_code/alarm.txt @@ -74,6 +74,13 @@ Variable (string) va0 Text : Max. Text Size: 10 +Variable (string) code_format + Attributes + ID : 34 + Scope : local + Text : + Max. Text Size: 15 + Text page_label Attributes ID : 1 @@ -299,9 +306,13 @@ Hotspot bt_home Events Touch Press Event bt_home_pic.pic=134 + bt_home_text.bco=65024 + bt_home_text.pco=0 + bt_home_icon.bco=65024 + bt_home_icon.pco=0 Touch Release Event - lastclick.txt="{\"domain\": \"alarm\", \"key\": \"home\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\"}" + lastclick.txt="{\"domain\": \"alarm\", \"key\": \"home\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\", \"code_format\": \""+code_format.txt+"\"}" printh 92 prints "localevent",0 printh 00 @@ -319,9 +330,13 @@ Hotspot bt_away Events Touch Press Event bt_away_pic.pic=134 + bt_away_text.bco=65024 + bt_away_text.pco=0 + bt_away_icon.bco=65024 + bt_away_icon.pco=0 Touch Release Event - lastclick.txt="{\"domain\": \"alarm\", \"key\": \"away\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\"}" + lastclick.txt="{\"domain\": \"alarm\", \"key\": \"away\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\", \"code_format\": \""+code_format.txt+"\"}" printh 92 prints "localevent",0 printh 00 @@ -339,9 +354,13 @@ Hotspot bt_night Events Touch Press Event bt_night_pic.pic=134 + bt_night_text.bco=65024 + bt_night_text.pco=0 + bt_night_icon.bco=65024 + bt_night_icon.pco=0 Touch Release Event - lastclick.txt="{\"domain\": \"alarm\", \"key\": \"night\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\"}" + lastclick.txt="{\"domain\": \"alarm\", \"key\": \"night\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\", \"code_format\": \""+code_format.txt+"\"}" printh 92 prints "localevent",0 printh 00 @@ -359,9 +378,13 @@ Hotspot bt_vacat Events Touch Press Event bt_vacat_pic.pic=134 + bt_vacat_text.bco=65024 + bt_vacat_text.pco=0 + bt_vacat_icon.bco=65024 + bt_vacat_icon.pco=0 Touch Release Event - lastclick.txt="{\"domain\": \"alarm\", \"key\": \"vacation\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\"}" + lastclick.txt="{\"domain\": \"alarm\", \"key\": \"vacation\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\", \"code_format\": \""+code_format.txt+"\"}" printh 92 prints "localevent",0 printh 00 @@ -379,9 +402,13 @@ Hotspot bt_bypass Events Touch Press Event bt_bypass_pic.pic=134 + bt_bypass_text.bco=65024 + bt_bypass_text.pco=0 + bt_bypass_icon.bco=65024 + bt_bypass_icon.pco=0 Touch Release Event - lastclick.txt="{\"domain\": \"alarm\", \"key\": \"bypass\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\"}" + lastclick.txt="{\"domain\": \"alarm\", \"key\": \"bypass\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\", \"code_format\": \""+code_format.txt+"\"}" printh 92 prints "localevent",0 printh 00 @@ -399,9 +426,13 @@ Hotspot bt_disarm Events Touch Press Event bt_disarm_pic.pic=134 + bt_disarm_text.bco=65024 + bt_disarm_text.pco=0 + bt_disarm_icon.bco=65024 + bt_disarm_icon.pco=0 Touch Release Event - lastclick.txt="{\"domain\": \"alarm\", \"key\": \"disarm\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\"}" + lastclick.txt="{\"domain\": \"alarm\", \"key\": \"disarm\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\", \"code_format\": \""+code_format.txt+"\"}" printh 92 prints "localevent",0 printh 00 diff --git a/nspanel_us_code/keyb_num.txt b/nspanel_us_code/keyb_num.txt new file mode 100644 index 0000000..c0f3068 --- /dev/null +++ b/nspanel_us_code/keyb_num.txt @@ -0,0 +1,326 @@ +Page keyb_num + Attributes + ID : 0 + Scope : local + Dragging : 0 + Send Component ID : disabled + Locked : no + Swide up page ID : disabled + Swide down page ID : disabled + Swide left page ID : disabled + Swide right page ID: disabled + + Events + Preinitialize Event + dim=home.brightness.val + if(api==0) + { + page page_id.val + }else + { + aux.txt="{\"page\": \"keyb_num\", \"component\": \"currentpage\", \"value\": \"pagechange\", \"entity\": \""+entity.txt+"\"}" + printh 92 + prints "nspanelevent",0 + printh 00 + prints aux.txt,0 + printh 00 + printh FF FF FF + } + + Touch Press Event + aux.txt="{\"page\": \"keyb_num\", \"component\": \"touchevent\", \"value\": \"press\", \"entity\": \""+entity.txt+"\"}" + printh 92 + prints "touchevent",0 + printh 00 + prints aux.txt,0 + printh 00 + printh FF FF FF + + Touch Release Event + aux.txt="{\"page\": \"keyb_num\", \"component\": \"touchevent\", \"value\": \"release\", \"entity\": \""+entity.txt+"\"}" + printh 92 + prints "touchevent",0 + printh 00 + prints aux.txt,0 + printh 00 + printh FF FF FF + +Variable (int32) page_id + Attributes + ID : 17 + Scope: local + Value: 0 + +Variable (string) key + Attributes + ID : 19 + Scope : local + Text : + Max. Text Size: 10 + +Variable (string) entity + Attributes + ID : 20 + Scope : local + Text : + Max. Text Size: 100 + +Variable (string) domain + Attributes + ID : 21 + Scope : local + Text : alarm + Max. Text Size: 10 + +Variable (string) aux + Attributes + ID : 22 + Scope : local + Text : + Max. Text Size: 100 + +Variable (string) value + Attributes + ID : 23 + Scope : local + Text : + Max. Text Size: 10 + +Text t0 + Attributes + ID : 1 + Scope : local + Dragging : 0 + Send Component ID : disabled + Associated Keyboard: none + Text : + Max. Text Size : 10 + +Text pin + Attributes + ID : 2 + Scope : local + Dragging : 0 + Send Component ID : disabled + Associated Keyboard: none + Text : + Max. Text Size : 25 + +Text t1 + Attributes + ID : 18 + Scope : local + Dragging : 0 + Send Component ID : disabled + Associated Keyboard: none + Text : Alarm + Max. Text Size : 10 + +Button b1 + Attributes + ID : 3 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : 1 + Max. Text Size : 1 + + Events + Touch Release Event + pin.txt+=b1.txt + +Button bclose + Attributes + ID : 4 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : X + Max. Text Size : 10 + + Events + Touch Release Event + page page_id.val + +Button b2 + Attributes + ID : 5 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : 2 + Max. Text Size : 1 + + Events + Touch Release Event + pin.txt+=b2.txt + +Button b3 + Attributes + ID : 6 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : 3 + Max. Text Size : 1 + + Events + Touch Release Event + pin.txt+=b3.txt + +Button b4 + Attributes + ID : 7 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : 4 + Max. Text Size : 1 + + Events + Touch Release Event + pin.txt+=b4.txt + +Button b5 + Attributes + ID : 8 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : 5 + Max. Text Size : 1 + + Events + Touch Release Event + pin.txt+=b5.txt + +Button b6 + Attributes + ID : 9 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : 6 + Max. Text Size : 1 + + Events + Touch Release Event + pin.txt+=b6.txt + +Button b7 + Attributes + ID : 10 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : 7 + Max. Text Size : 1 + + Events + Touch Release Event + pin.txt+=b7.txt + +Button b8 + Attributes + ID : 11 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : 8 + Max. Text Size : 1 + + Events + Touch Release Event + pin.txt+=b8.txt + +Button b9 + Attributes + ID : 12 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : 9 + Max. Text Size : 1 + + Events + Touch Release Event + pin.txt+=b9.txt + +Button bclear + Attributes + ID : 13 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : < + Max. Text Size : 5 + + Events + Touch Release Event + pin.txt="" + +Button b0 + Attributes + ID : 14 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : 0 + Max. Text Size : 1 + + Events + Touch Release Event + pin.txt+=b0.txt + +Button benter + Attributes + ID : 15 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : OK + Max. Text Size : 3 + + Events + Touch Release Event + aux.txt="{\"domain\": \"keyb_num\", \"key\": "+key.txt+", \"value\": "+value.txt+", \"entity\": \""+entity.txt+"\", \"base_domain\": "+domain.txt+"\"}" + printh 92 + prints "localevent",0 + printh 00 + prints aux.txt,0 + printh 00 + printh FF FF FF + +Button bview + Attributes + ID : 16 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : O + Max. Text Size : 3 + + Events + Touch Press Event + if(pin.pw==1) + { + pin.pw=0 + }else + { + pin.pw=1 + } + diff --git a/nspanel_us_land.HMI b/nspanel_us_land.HMI index c10d98f..9300861 100644 Binary files a/nspanel_us_land.HMI and b/nspanel_us_land.HMI differ diff --git a/nspanel_us_land.tft b/nspanel_us_land.tft index 681043f..0ff50b0 100644 Binary files a/nspanel_us_land.tft and b/nspanel_us_land.tft differ diff --git a/nspanel_us_land_code/alarm.txt b/nspanel_us_land_code/alarm.txt index cc39d72..60d59ab 100644 --- a/nspanel_us_land_code/alarm.txt +++ b/nspanel_us_land_code/alarm.txt @@ -74,6 +74,13 @@ Variable (string) va0 Text : Max. Text Size: 10 +Variable (string) code_format + Attributes + ID : 34 + Scope : local + Text : + Max. Text Size: 15 + Text page_label Attributes ID : 1 @@ -299,9 +306,13 @@ Hotspot bt_home Events Touch Press Event bt_home_pic.pic=134 + bt_home_text.bco=65024 + bt_home_text.pco=0 + bt_home_icon.bco=65024 + bt_home_icon.pco=0 Touch Release Event - lastclick.txt="{\"domain\": \"alarm\", \"key\": \"home\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\"}" + lastclick.txt="{\"domain\": \"alarm\", \"key\": \"home\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\", \"code_format\": \""+code_format.txt+"\"}" printh 92 prints "localevent",0 printh 00 @@ -319,9 +330,13 @@ Hotspot bt_away Events Touch Press Event bt_away_pic.pic=134 + bt_away_text.bco=65024 + bt_away_text.pco=0 + bt_away_icon.bco=65024 + bt_away_icon.pco=0 Touch Release Event - lastclick.txt="{\"domain\": \"alarm\", \"key\": \"away\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\"}" + lastclick.txt="{\"domain\": \"alarm\", \"key\": \"away\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\", \"code_format\": \""+code_format.txt+"\"}" printh 92 prints "localevent",0 printh 00 @@ -339,9 +354,13 @@ Hotspot bt_night Events Touch Press Event bt_night_pic.pic=134 + bt_night_text.bco=65024 + bt_night_text.pco=0 + bt_night_icon.bco=65024 + bt_night_icon.pco=0 Touch Release Event - lastclick.txt="{\"domain\": \"alarm\", \"key\": \"night\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\"}" + lastclick.txt="{\"domain\": \"alarm\", \"key\": \"night\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\", \"code_format\": \""+code_format.txt+"\"}" printh 92 prints "localevent",0 printh 00 @@ -359,9 +378,13 @@ Hotspot bt_vacat Events Touch Press Event bt_vacat_pic.pic=134 + bt_vacat_text.bco=65024 + bt_vacat_text.pco=0 + bt_vacat_icon.bco=65024 + bt_vacat_icon.pco=0 Touch Release Event - lastclick.txt="{\"domain\": \"alarm\", \"key\": \"vacation\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\"}" + lastclick.txt="{\"domain\": \"alarm\", \"key\": \"vacation\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\", \"code_format\": \""+code_format.txt+"\"}" printh 92 prints "localevent",0 printh 00 @@ -379,9 +402,13 @@ Hotspot bt_bypass Events Touch Press Event bt_bypass_pic.pic=134 + bt_bypass_text.bco=65024 + bt_bypass_text.pco=0 + bt_bypass_icon.bco=65024 + bt_bypass_icon.pco=0 Touch Release Event - lastclick.txt="{\"domain\": \"alarm\", \"key\": \"bypass\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\"}" + lastclick.txt="{\"domain\": \"alarm\", \"key\": \"bypass\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\", \"code_format\": \""+code_format.txt+"\"}" printh 92 prints "localevent",0 printh 00 @@ -399,9 +426,13 @@ Hotspot bt_disarm Events Touch Press Event bt_disarm_pic.pic=134 + bt_disarm_text.bco=65024 + bt_disarm_text.pco=0 + bt_disarm_icon.bco=65024 + bt_disarm_icon.pco=0 Touch Release Event - lastclick.txt="{\"domain\": \"alarm\", \"key\": \"disarm\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\"}" + lastclick.txt="{\"domain\": \"alarm\", \"key\": \"disarm\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\", \"code_format\": \""+code_format.txt+"\"}" printh 92 prints "localevent",0 printh 00 diff --git a/nspanel_us_land_code/keyb_num.txt b/nspanel_us_land_code/keyb_num.txt new file mode 100644 index 0000000..c0f3068 --- /dev/null +++ b/nspanel_us_land_code/keyb_num.txt @@ -0,0 +1,326 @@ +Page keyb_num + Attributes + ID : 0 + Scope : local + Dragging : 0 + Send Component ID : disabled + Locked : no + Swide up page ID : disabled + Swide down page ID : disabled + Swide left page ID : disabled + Swide right page ID: disabled + + Events + Preinitialize Event + dim=home.brightness.val + if(api==0) + { + page page_id.val + }else + { + aux.txt="{\"page\": \"keyb_num\", \"component\": \"currentpage\", \"value\": \"pagechange\", \"entity\": \""+entity.txt+"\"}" + printh 92 + prints "nspanelevent",0 + printh 00 + prints aux.txt,0 + printh 00 + printh FF FF FF + } + + Touch Press Event + aux.txt="{\"page\": \"keyb_num\", \"component\": \"touchevent\", \"value\": \"press\", \"entity\": \""+entity.txt+"\"}" + printh 92 + prints "touchevent",0 + printh 00 + prints aux.txt,0 + printh 00 + printh FF FF FF + + Touch Release Event + aux.txt="{\"page\": \"keyb_num\", \"component\": \"touchevent\", \"value\": \"release\", \"entity\": \""+entity.txt+"\"}" + printh 92 + prints "touchevent",0 + printh 00 + prints aux.txt,0 + printh 00 + printh FF FF FF + +Variable (int32) page_id + Attributes + ID : 17 + Scope: local + Value: 0 + +Variable (string) key + Attributes + ID : 19 + Scope : local + Text : + Max. Text Size: 10 + +Variable (string) entity + Attributes + ID : 20 + Scope : local + Text : + Max. Text Size: 100 + +Variable (string) domain + Attributes + ID : 21 + Scope : local + Text : alarm + Max. Text Size: 10 + +Variable (string) aux + Attributes + ID : 22 + Scope : local + Text : + Max. Text Size: 100 + +Variable (string) value + Attributes + ID : 23 + Scope : local + Text : + Max. Text Size: 10 + +Text t0 + Attributes + ID : 1 + Scope : local + Dragging : 0 + Send Component ID : disabled + Associated Keyboard: none + Text : + Max. Text Size : 10 + +Text pin + Attributes + ID : 2 + Scope : local + Dragging : 0 + Send Component ID : disabled + Associated Keyboard: none + Text : + Max. Text Size : 25 + +Text t1 + Attributes + ID : 18 + Scope : local + Dragging : 0 + Send Component ID : disabled + Associated Keyboard: none + Text : Alarm + Max. Text Size : 10 + +Button b1 + Attributes + ID : 3 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : 1 + Max. Text Size : 1 + + Events + Touch Release Event + pin.txt+=b1.txt + +Button bclose + Attributes + ID : 4 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : X + Max. Text Size : 10 + + Events + Touch Release Event + page page_id.val + +Button b2 + Attributes + ID : 5 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : 2 + Max. Text Size : 1 + + Events + Touch Release Event + pin.txt+=b2.txt + +Button b3 + Attributes + ID : 6 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : 3 + Max. Text Size : 1 + + Events + Touch Release Event + pin.txt+=b3.txt + +Button b4 + Attributes + ID : 7 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : 4 + Max. Text Size : 1 + + Events + Touch Release Event + pin.txt+=b4.txt + +Button b5 + Attributes + ID : 8 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : 5 + Max. Text Size : 1 + + Events + Touch Release Event + pin.txt+=b5.txt + +Button b6 + Attributes + ID : 9 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : 6 + Max. Text Size : 1 + + Events + Touch Release Event + pin.txt+=b6.txt + +Button b7 + Attributes + ID : 10 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : 7 + Max. Text Size : 1 + + Events + Touch Release Event + pin.txt+=b7.txt + +Button b8 + Attributes + ID : 11 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : 8 + Max. Text Size : 1 + + Events + Touch Release Event + pin.txt+=b8.txt + +Button b9 + Attributes + ID : 12 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : 9 + Max. Text Size : 1 + + Events + Touch Release Event + pin.txt+=b9.txt + +Button bclear + Attributes + ID : 13 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : < + Max. Text Size : 5 + + Events + Touch Release Event + pin.txt="" + +Button b0 + Attributes + ID : 14 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : 0 + Max. Text Size : 1 + + Events + Touch Release Event + pin.txt+=b0.txt + +Button benter + Attributes + ID : 15 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : OK + Max. Text Size : 3 + + Events + Touch Release Event + aux.txt="{\"domain\": \"keyb_num\", \"key\": "+key.txt+", \"value\": "+value.txt+", \"entity\": \""+entity.txt+"\", \"base_domain\": "+domain.txt+"\"}" + printh 92 + prints "localevent",0 + printh 00 + prints aux.txt,0 + printh 00 + printh FF FF FF + +Button bview + Attributes + ID : 16 + Scope : local + Dragging : 0 + Send Component ID: disabled + State : unpressed + Text : O + Max. Text Size : 3 + + Events + Touch Press Event + if(pin.pw==1) + { + pin.pw=0 + }else + { + pin.pw=1 + } +