diff --git a/ReleaseNotes.md b/ReleaseNotes.md index 66d81d2..747fafe 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -67,6 +67,8 @@ Now you can control an Alarm Control Panel from your NSPanel, which will allow y For more details, instructions and security considerations, please take a look at the [Alarm Control Panel docs](/docs/en/alarm.md). +**Important:** At this moment, this funcionality is available only for alarms without a code or alarms using a numeric code. Alarms with text code are not yet supported. +   ### 3. Support to sensor display precision from Home Assistant Now the values shown in your panel will follow the [sensor display precision](https://www.home-assistant.io/blog/2023/03/01/release-20233/#sensor-display-precision) provided by Home Assistant. diff --git a/docs/en/alarm.md b/docs/en/alarm.md index 596e374..08e40d7 100644 --- a/docs/en/alarm.md +++ b/docs/en/alarm.md @@ -2,7 +2,7 @@ You can control an Alarm Control Panel from your NSPanel, which will allow you to set the alarm mode between the standard modes supported by Home Assistant (Home, Away, Night, Vacation or Custom bypass) or disarm the alarm. -Currently, only alarms without a code will be supported. If your alarm requires a code, you will still be able to display it on your NSPanel, however, when you click in any button it will send services calls to Home Assistant without the code and it will fail for the service where a code is requires. +Currently, only alarms without a code or alarms with a numeric code will be supported. If your alarm requires a text code, you will still be able to display it on your NSPanel, however, when you click in any button it will send services calls to Home Assistant without the code and it will fail for the calls where a code is required.   ### Security advisory @@ -12,8 +12,15 @@ Based on that, we hardly reccoment the use of API encryption for all users contr   ## Configuration +### Allow the device to make Home Assistant service calls +First, you have to configure your Home Assistant to allow your panel to make service calls. All other services are called from the Blueprint, however this requires the ESPHome to send an event containing in plain text all the information needed to the service call, which could be a security issue, so all the alarm calls will be driven by the panel to ensure a safer environment.
+To enable this option, go to your ESPHome integrations panel (Settings > Devices and Services > ESPHome) and click "Configure" next to the entry related to your panel:
+<< ADD SCREENSHOT >>
+Then check the option "Allow the device to make Home Assistant service calls":
+<< ADD SCREENSHOT >>
+### Blueprint settings Open the automation based on the NSPanel Blueprint and look for a section related to "Alarm Control Panel".
-Select your alarm control panel entity, click "Save", and your are done. :)
+Select your alarm control panel entity, click "Save", and your are done. :sunglasses:
<<< ADD SCREENSHOT >>>>   diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index 97d9990..93c4009 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -4064,8 +4064,8 @@ variables: home: Home away: Away night: Night - vacation: Vacation - bypass: Bypass + vacation: Holiday + bypass: Custom bypass disarm: Disarm es: #Spanish weekdays: @@ -5025,7 +5025,7 @@ variables: away: Ausente night: Noturno vacation: FĂ©rias - bypass: bypass + bypass: Personalizado disarm: Desarmar ro: #Romanian weekdays: @@ -6442,6 +6442,7 @@ action: - condition: trigger id: service_call - '{{ trigger.event.data.service is defined and trigger.event.data.service is string and trigger.event.data.service | length > 0 }}' + - '{{ trigger.event.data.service is not match "alarm_control_panel." }}' # Prevent the use of this call for alarm control due to safety reasons - '{{ trigger.event.data.entity is defined and trigger.event.data.entity is string and trigger.event.data.entity | length > 0 }}' sequence: - &variable_nspanel_event diff --git a/nspanel_esphome.yaml b/nspanel_esphome.yaml index fbbbe15..28e9dfd 100644 --- a/nspanel_esphome.yaml +++ b/nspanel_esphome.yaml @@ -530,7 +530,6 @@ api: ESP_LOGD("service.alarm_settings", "supported_features: %i", supported_features); ESP_LOGD("service.alarm_settings", "code_format: %s", code_format.c_str()); ESP_LOGD("service.alarm_settings", "entity: %s", entity.c_str()); - ESP_LOGD("service.alarm_settings", "mui_alarm[1]: %s", mui_alarm[1].c_str()); } - lambda: |- # Alarm page - Header @@ -540,6 +539,7 @@ api: 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()); + id(disp1).set_component_text_printf("entity", "%s", entity.c_str()); - lambda: |- # Alarm page - Button's icons id(disp1).set_component_text_printf("bt_home_icon", "\uE689"); //mdi:shield-home @@ -988,10 +988,33 @@ 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") + else if (domain == "alarm") { 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()); + std::string title = doc["mui"]; + if (code_format=="number") + { + id(disp1).send_command_printf("page keyb_num"); + id(disp1).set_component_value("keyb_num.page_id", 23); //Calling from Alarm page + id(disp1).set_component_text_printf("keyb_num.domain", "%s", domain.c_str()); + id(disp1).set_component_text_printf("keyb_num.key", "%s", key.c_str()); + id(disp1).set_component_text_printf("keyb_num.value", "%s", value.c_str()); + id(disp1).set_component_text_printf("keyb_num.entity", "%s", entity.c_str()); + id(disp1).set_component_text_printf("keyb_num.title", "%s", title.c_str()); + } + else id(service_call_alarm_control_panel)->execute(entity.c_str(), key.c_str(), code_format.c_str(), ""); + } + else if (domain == "keyb_num") + { + std::string base_domain = doc["base_domain"]; + if (base_domain == "alarm") + { + std::string code_format = doc["code_format"]; + std::string pin = doc["pin"]; + id(service_call_alarm_control_panel)->execute(entity.c_str(), key.c_str(), code_format.c_str(), pin.c_str()); + } + else if (base_domain == "" or base_domain.empty()) base_domain = "home"; + id(disp1).send_command_printf("page %s", base_domain.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") @@ -1496,20 +1519,43 @@ script: parameters: entity: string key: string + code_format: string pin: string then: - lambda: |- - if (${verbose_log}) ESP_LOGD("service_call_alarm_control_panel", "ESPHome remote service call"); - HomeassistantServiceResponse resp; - HomeassistantServiceMap resp_kv; - resp.service = "alarm_control_panel.XXXX"; // DEBUG - resp_kv.key = "entity_id"; - resp_kv.value = entity.c_str(); - resp.data.push_back(resp_kv); - resp_kv.key = "pin"; // DEBUG - resp_kv.value = pin.c_str(); - resp.data.push_back(resp_kv); - id(api_server).send_homeassistant_service_call(resp); + if (${verbose_log}) + { + ESP_LOGD("service_call_alarm_control_panel", "ESPHome remote service call"); + ESP_LOGD("service_call_alarm_control_panel", "entity=%s", entity.c_str()); + ESP_LOGD("service_call_alarm_control_panel", "key=%s", key.c_str()); + ESP_LOGD("service_call_alarm_control_panel", "code_format=%s", code_format.c_str()); + ESP_LOGD("service_call_alarm_control_panel", "pin=%s", entity.c_str()); + } + std::string service = ""; + if (key=="home") service = "alarm_control_panel.alarm_arm_home"; + else if (key=="away") service = "alarm_control_panel.alarm_arm_away"; + else if (key=="night") service = "alarm_control_panel.alarm_arm_night"; + else if (key=="vacation") service = "alarm_control_panel.alarm_arm_vacation"; + else if (key=="bypass") service = "alarm_control_panel.alarm_arm_custom_bypass"; + else if (key=="disarm") service = "alarm_control_panel.alarm_disarm"; + if (${verbose_log}) ESP_LOGD("service_call_alarm_control_panel", "service=%s", service.c_str()); + if (service != "" and not service.empty()) + { + if (${verbose_log}) ESP_LOGD("service_call_alarm_control_panel", "ESPHome remote service call"); + HomeassistantServiceResponse resp; + HomeassistantServiceMap resp_kv; + resp.service = service.c_str(); + resp_kv.key = "entity_id"; + resp_kv.value = entity.c_str(); + resp.data.push_back(resp_kv); + if (pin != "" and not pin.empty()) + { + resp_kv.key = "code"; + resp_kv.value = pin.c_str(); + resp.data.push_back(resp_kv); + } + id(api_server).send_homeassistant_service_call(resp); + } - id: service_call_climate mode: restart diff --git a/nspanel_eu.HMI b/nspanel_eu.HMI index 60f47d4..9a8f354 100644 Binary files a/nspanel_eu.HMI and b/nspanel_eu.HMI differ diff --git a/nspanel_eu.tft b/nspanel_eu.tft index 1c84c5a..a692d34 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 60d59ab..87bb839 100644 --- a/nspanel_eu_code/alarm.txt +++ b/nspanel_eu_code/alarm.txt @@ -55,32 +55,32 @@ Page alarm Variable (string) lastclick Attributes - ID : 7 + ID : 5 Scope : local Text : Max. Text Size: 255 Variable (string) back_page Attributes - ID : 8 + ID : 6 Scope : local Text : home Max. Text Size: 15 -Variable (string) va0 - Attributes - ID : 9 - Scope : local - Text : - Max. Text Size: 10 - Variable (string) code_format Attributes - ID : 34 + ID : 31 Scope : local Text : Max. Text Size: 15 +Variable (string) entity + Attributes + ID : 32 + Scope : local + Text : + Max. Text Size: 100 + Text page_label Attributes ID : 1 @@ -93,7 +93,7 @@ Text page_label Text icon_state Attributes - ID : 6 + ID : 4 Scope : local Dragging : 0 Send Component ID : disabled @@ -103,7 +103,7 @@ Text icon_state Text bt_home_text Attributes - ID : 11 + ID : 8 Scope : local Dragging : 0 Send Component ID : disabled @@ -113,7 +113,7 @@ Text bt_home_text Text bt_away_text Attributes - ID : 13 + ID : 10 Scope : local Dragging : 0 Send Component ID : disabled @@ -123,7 +123,7 @@ Text bt_away_text Text bt_night_text Attributes - ID : 15 + ID : 12 Scope : local Dragging : 0 Send Component ID : disabled @@ -133,7 +133,7 @@ Text bt_night_text Text bt_vacat_text Attributes - ID : 17 + ID : 14 Scope : local Dragging : 0 Send Component ID : disabled @@ -143,7 +143,7 @@ Text bt_vacat_text Text bt_bypass_text Attributes - ID : 19 + ID : 16 Scope : local Dragging : 0 Send Component ID : disabled @@ -153,7 +153,7 @@ Text bt_bypass_text Text bt_disarm_text Attributes - ID : 21 + ID : 18 Scope : local Dragging : 0 Send Component ID : disabled @@ -163,7 +163,7 @@ Text bt_disarm_text Text bt_home_icon Attributes - ID : 22 + ID : 19 Scope : local Dragging : 0 Send Component ID : disabled @@ -173,7 +173,7 @@ Text bt_home_icon Text bt_away_icon Attributes - ID : 23 + ID : 20 Scope : local Dragging : 0 Send Component ID : disabled @@ -183,7 +183,7 @@ Text bt_away_icon Text bt_night_icon Attributes - ID : 24 + ID : 21 Scope : local Dragging : 0 Send Component ID : disabled @@ -193,7 +193,7 @@ Text bt_night_icon Text bt_vacat_icon Attributes - ID : 25 + ID : 22 Scope : local Dragging : 0 Send Component ID : disabled @@ -203,7 +203,7 @@ Text bt_vacat_icon Text bt_bypass_icon Attributes - ID : 26 + ID : 23 Scope : local Dragging : 0 Send Component ID : disabled @@ -213,7 +213,7 @@ Text bt_bypass_icon Text bt_disarm_icon Attributes - ID : 27 + ID : 24 Scope : local Dragging : 0 Send Component ID : disabled @@ -223,56 +223,56 @@ Text bt_disarm_icon Picture alarm_exit Attributes - ID : 4 + ID : 2 Scope : local Dragging : 0 Send Component ID: disabled Picture bt_home_pic Attributes - ID : 10 + ID : 7 Scope : local Dragging : 0 Send Component ID: disabled Picture bt_away_pic Attributes - ID : 12 + ID : 9 Scope : local Dragging : 0 Send Component ID: disabled Picture bt_night_pic Attributes - ID : 14 + ID : 11 Scope : local Dragging : 0 Send Component ID: disabled Picture bt_vacat_pic Attributes - ID : 16 + ID : 13 Scope : local Dragging : 0 Send Component ID: disabled Picture bt_bypass_pic Attributes - ID : 18 + ID : 15 Scope : local Dragging : 0 Send Component ID: disabled Picture bt_disarm_pic Attributes - ID : 20 + ID : 17 Scope : local Dragging : 0 Send Component ID: disabled Hotspot alarm_back Attributes - ID : 5 + ID : 3 Scope : local Dragging : 0 Send Component ID: disabled @@ -298,7 +298,7 @@ Hotspot alarm_back Hotspot bt_home Attributes - ID : 28 + ID : 25 Scope : local Dragging : 0 Send Component ID: disabled @@ -312,7 +312,7 @@ Hotspot bt_home bt_home_icon.pco=0 Touch Release Event - lastclick.txt="{\"domain\": \"alarm\", \"key\": \"home\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\", \"code_format\": \""+code_format.txt+"\"}" + lastclick.txt="{\"domain\": \"alarm\", \"key\": \"home\", \"value\": \"click\", \"entity\": \""+entity.txt+"\", \"mui\": \""+bt_home_text.txt+"\", \"code_format\": \""+code_format.txt+"\"}" printh 92 prints "localevent",0 printh 00 @@ -322,7 +322,7 @@ Hotspot bt_home Hotspot bt_away Attributes - ID : 29 + ID : 26 Scope : local Dragging : 0 Send Component ID: disabled @@ -336,7 +336,7 @@ Hotspot bt_away bt_away_icon.pco=0 Touch Release Event - lastclick.txt="{\"domain\": \"alarm\", \"key\": \"away\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\", \"code_format\": \""+code_format.txt+"\"}" + lastclick.txt="{\"domain\": \"alarm\", \"key\": \"away\", \"value\": \"click\", \"entity\": \""+entity.txt+"\", \"mui\": \""+bt_away_text.txt+"\", \"code_format\": \""+code_format.txt+"\"}" printh 92 prints "localevent",0 printh 00 @@ -346,7 +346,7 @@ Hotspot bt_away Hotspot bt_night Attributes - ID : 30 + ID : 27 Scope : local Dragging : 0 Send Component ID: disabled @@ -360,7 +360,7 @@ Hotspot bt_night bt_night_icon.pco=0 Touch Release Event - lastclick.txt="{\"domain\": \"alarm\", \"key\": \"night\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\", \"code_format\": \""+code_format.txt+"\"}" + lastclick.txt="{\"domain\": \"alarm\", \"key\": \"night\", \"value\": \"click\", \"entity\": \""+entity.txt+"\", \"mui\": \""+bt_night_text.txt+"\", \"code_format\": \""+code_format.txt+"\"}" printh 92 prints "localevent",0 printh 00 @@ -370,7 +370,7 @@ Hotspot bt_night Hotspot bt_vacat Attributes - ID : 31 + ID : 28 Scope : local Dragging : 0 Send Component ID: disabled @@ -384,7 +384,7 @@ Hotspot bt_vacat bt_vacat_icon.pco=0 Touch Release Event - lastclick.txt="{\"domain\": \"alarm\", \"key\": \"vacation\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\", \"code_format\": \""+code_format.txt+"\"}" + lastclick.txt="{\"domain\": \"alarm\", \"key\": \"vacation\", \"value\": \"click\", \"entity\": \""+entity.txt+"\", \"mui\": \""+bt_vacat_text.txt+"\", \"code_format\": \""+code_format.txt+"\"}" printh 92 prints "localevent",0 printh 00 @@ -394,7 +394,7 @@ Hotspot bt_vacat Hotspot bt_bypass Attributes - ID : 32 + ID : 29 Scope : local Dragging : 0 Send Component ID: disabled @@ -408,7 +408,7 @@ Hotspot bt_bypass bt_bypass_icon.pco=0 Touch Release Event - lastclick.txt="{\"domain\": \"alarm\", \"key\": \"bypass\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\", \"code_format\": \""+code_format.txt+"\"}" + lastclick.txt="{\"domain\": \"alarm\", \"key\": \"bypass\", \"value\": \"click\", \"entity\": \""+entity.txt+"\", \"mui\": \""+bt_bypass_text.txt+"\", \"code_format\": \""+code_format.txt+"\"}" printh 92 prints "localevent",0 printh 00 @@ -418,7 +418,7 @@ Hotspot bt_bypass Hotspot bt_disarm Attributes - ID : 33 + ID : 30 Scope : local Dragging : 0 Send Component ID: disabled @@ -432,7 +432,7 @@ Hotspot bt_disarm bt_disarm_icon.pco=0 Touch Release Event - lastclick.txt="{\"domain\": \"alarm\", \"key\": \"disarm\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\", \"code_format\": \""+code_format.txt+"\"}" + lastclick.txt="{\"domain\": \"alarm\", \"key\": \"disarm\", \"value\": \"click\", \"entity\": \""+entity.txt+"\", \"mui\": \""+bt_disarm_text.txt+"\", \"code_format\": \""+code_format.txt+"\"}" printh 92 prints "localevent",0 printh 00 @@ -440,60 +440,3 @@ Hotspot bt_disarm printh 00 printh FF FF FF -Timer swipestore - Attributes - ID : 3 - Scope : local - Period (ms): 50 - Enabled : no - - Events - Timer Event - swipex=tch0 - swipey=tch1 - -TouchCap swipe - Attributes - ID : 2 - Scope: local - Value: 0 - - Events - Touch Press Event - swipestore.en=1 // Start swipestore timer - - Touch Release Event - swipestore.en=0 - // Touch has ended, x - if(tch0==0) - { - swipec=swipex-tch2 - // From Left to Right - if(swipec>swipedx) - { - //page - } - // Right to Left - swipec2=0-swipedx - if(swipec100) - { - //page - } - // Down to Up - swipec2=0-swipedy - if(swipec<-100) - { - //page - } - } - diff --git a/nspanel_eu_code/keyb_num.txt b/nspanel_eu_code/keyb_num.txt index c0f3068..73ba313 100644 --- a/nspanel_eu_code/keyb_num.txt +++ b/nspanel_eu_code/keyb_num.txt @@ -77,7 +77,7 @@ Variable (string) aux ID : 22 Scope : local Text : - Max. Text Size: 100 + Max. Text Size: 255 Variable (string) value Attributes @@ -106,7 +106,7 @@ Text pin Text : Max. Text Size : 25 -Text t1 +Text title Attributes ID : 18 Scope : local @@ -296,7 +296,7 @@ Button benter Events Touch Release Event - aux.txt="{\"domain\": \"keyb_num\", \"key\": "+key.txt+", \"value\": "+value.txt+", \"entity\": \""+entity.txt+"\", \"base_domain\": "+domain.txt+"\"}" + aux.txt="{\"domain\": \"keyb_num\", \"key\": \""+key.txt+"\", \"value\": \""+value.txt+"\", \"entity\": \""+entity.txt+"\", \"pin\": \""+pin.txt+"\", \"base_domain\": \""+domain.txt+"\"}" printh 92 prints "localevent",0 printh 00 diff --git a/nspanel_us.HMI b/nspanel_us.HMI index 9fa31e8..855a00b 100644 Binary files a/nspanel_us.HMI and b/nspanel_us.HMI differ diff --git a/nspanel_us.tft b/nspanel_us.tft index a037dcd..f7383ee 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 60d59ab..87bb839 100644 --- a/nspanel_us_code/alarm.txt +++ b/nspanel_us_code/alarm.txt @@ -55,32 +55,32 @@ Page alarm Variable (string) lastclick Attributes - ID : 7 + ID : 5 Scope : local Text : Max. Text Size: 255 Variable (string) back_page Attributes - ID : 8 + ID : 6 Scope : local Text : home Max. Text Size: 15 -Variable (string) va0 - Attributes - ID : 9 - Scope : local - Text : - Max. Text Size: 10 - Variable (string) code_format Attributes - ID : 34 + ID : 31 Scope : local Text : Max. Text Size: 15 +Variable (string) entity + Attributes + ID : 32 + Scope : local + Text : + Max. Text Size: 100 + Text page_label Attributes ID : 1 @@ -93,7 +93,7 @@ Text page_label Text icon_state Attributes - ID : 6 + ID : 4 Scope : local Dragging : 0 Send Component ID : disabled @@ -103,7 +103,7 @@ Text icon_state Text bt_home_text Attributes - ID : 11 + ID : 8 Scope : local Dragging : 0 Send Component ID : disabled @@ -113,7 +113,7 @@ Text bt_home_text Text bt_away_text Attributes - ID : 13 + ID : 10 Scope : local Dragging : 0 Send Component ID : disabled @@ -123,7 +123,7 @@ Text bt_away_text Text bt_night_text Attributes - ID : 15 + ID : 12 Scope : local Dragging : 0 Send Component ID : disabled @@ -133,7 +133,7 @@ Text bt_night_text Text bt_vacat_text Attributes - ID : 17 + ID : 14 Scope : local Dragging : 0 Send Component ID : disabled @@ -143,7 +143,7 @@ Text bt_vacat_text Text bt_bypass_text Attributes - ID : 19 + ID : 16 Scope : local Dragging : 0 Send Component ID : disabled @@ -153,7 +153,7 @@ Text bt_bypass_text Text bt_disarm_text Attributes - ID : 21 + ID : 18 Scope : local Dragging : 0 Send Component ID : disabled @@ -163,7 +163,7 @@ Text bt_disarm_text Text bt_home_icon Attributes - ID : 22 + ID : 19 Scope : local Dragging : 0 Send Component ID : disabled @@ -173,7 +173,7 @@ Text bt_home_icon Text bt_away_icon Attributes - ID : 23 + ID : 20 Scope : local Dragging : 0 Send Component ID : disabled @@ -183,7 +183,7 @@ Text bt_away_icon Text bt_night_icon Attributes - ID : 24 + ID : 21 Scope : local Dragging : 0 Send Component ID : disabled @@ -193,7 +193,7 @@ Text bt_night_icon Text bt_vacat_icon Attributes - ID : 25 + ID : 22 Scope : local Dragging : 0 Send Component ID : disabled @@ -203,7 +203,7 @@ Text bt_vacat_icon Text bt_bypass_icon Attributes - ID : 26 + ID : 23 Scope : local Dragging : 0 Send Component ID : disabled @@ -213,7 +213,7 @@ Text bt_bypass_icon Text bt_disarm_icon Attributes - ID : 27 + ID : 24 Scope : local Dragging : 0 Send Component ID : disabled @@ -223,56 +223,56 @@ Text bt_disarm_icon Picture alarm_exit Attributes - ID : 4 + ID : 2 Scope : local Dragging : 0 Send Component ID: disabled Picture bt_home_pic Attributes - ID : 10 + ID : 7 Scope : local Dragging : 0 Send Component ID: disabled Picture bt_away_pic Attributes - ID : 12 + ID : 9 Scope : local Dragging : 0 Send Component ID: disabled Picture bt_night_pic Attributes - ID : 14 + ID : 11 Scope : local Dragging : 0 Send Component ID: disabled Picture bt_vacat_pic Attributes - ID : 16 + ID : 13 Scope : local Dragging : 0 Send Component ID: disabled Picture bt_bypass_pic Attributes - ID : 18 + ID : 15 Scope : local Dragging : 0 Send Component ID: disabled Picture bt_disarm_pic Attributes - ID : 20 + ID : 17 Scope : local Dragging : 0 Send Component ID: disabled Hotspot alarm_back Attributes - ID : 5 + ID : 3 Scope : local Dragging : 0 Send Component ID: disabled @@ -298,7 +298,7 @@ Hotspot alarm_back Hotspot bt_home Attributes - ID : 28 + ID : 25 Scope : local Dragging : 0 Send Component ID: disabled @@ -312,7 +312,7 @@ Hotspot bt_home bt_home_icon.pco=0 Touch Release Event - lastclick.txt="{\"domain\": \"alarm\", \"key\": \"home\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\", \"code_format\": \""+code_format.txt+"\"}" + lastclick.txt="{\"domain\": \"alarm\", \"key\": \"home\", \"value\": \"click\", \"entity\": \""+entity.txt+"\", \"mui\": \""+bt_home_text.txt+"\", \"code_format\": \""+code_format.txt+"\"}" printh 92 prints "localevent",0 printh 00 @@ -322,7 +322,7 @@ Hotspot bt_home Hotspot bt_away Attributes - ID : 29 + ID : 26 Scope : local Dragging : 0 Send Component ID: disabled @@ -336,7 +336,7 @@ Hotspot bt_away bt_away_icon.pco=0 Touch Release Event - lastclick.txt="{\"domain\": \"alarm\", \"key\": \"away\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\", \"code_format\": \""+code_format.txt+"\"}" + lastclick.txt="{\"domain\": \"alarm\", \"key\": \"away\", \"value\": \"click\", \"entity\": \""+entity.txt+"\", \"mui\": \""+bt_away_text.txt+"\", \"code_format\": \""+code_format.txt+"\"}" printh 92 prints "localevent",0 printh 00 @@ -346,7 +346,7 @@ Hotspot bt_away Hotspot bt_night Attributes - ID : 30 + ID : 27 Scope : local Dragging : 0 Send Component ID: disabled @@ -360,7 +360,7 @@ Hotspot bt_night bt_night_icon.pco=0 Touch Release Event - lastclick.txt="{\"domain\": \"alarm\", \"key\": \"night\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\", \"code_format\": \""+code_format.txt+"\"}" + lastclick.txt="{\"domain\": \"alarm\", \"key\": \"night\", \"value\": \"click\", \"entity\": \""+entity.txt+"\", \"mui\": \""+bt_night_text.txt+"\", \"code_format\": \""+code_format.txt+"\"}" printh 92 prints "localevent",0 printh 00 @@ -370,7 +370,7 @@ Hotspot bt_night Hotspot bt_vacat Attributes - ID : 31 + ID : 28 Scope : local Dragging : 0 Send Component ID: disabled @@ -384,7 +384,7 @@ Hotspot bt_vacat bt_vacat_icon.pco=0 Touch Release Event - lastclick.txt="{\"domain\": \"alarm\", \"key\": \"vacation\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\", \"code_format\": \""+code_format.txt+"\"}" + lastclick.txt="{\"domain\": \"alarm\", \"key\": \"vacation\", \"value\": \"click\", \"entity\": \""+entity.txt+"\", \"mui\": \""+bt_vacat_text.txt+"\", \"code_format\": \""+code_format.txt+"\"}" printh 92 prints "localevent",0 printh 00 @@ -394,7 +394,7 @@ Hotspot bt_vacat Hotspot bt_bypass Attributes - ID : 32 + ID : 29 Scope : local Dragging : 0 Send Component ID: disabled @@ -408,7 +408,7 @@ Hotspot bt_bypass bt_bypass_icon.pco=0 Touch Release Event - lastclick.txt="{\"domain\": \"alarm\", \"key\": \"bypass\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\", \"code_format\": \""+code_format.txt+"\"}" + lastclick.txt="{\"domain\": \"alarm\", \"key\": \"bypass\", \"value\": \"click\", \"entity\": \""+entity.txt+"\", \"mui\": \""+bt_bypass_text.txt+"\", \"code_format\": \""+code_format.txt+"\"}" printh 92 prints "localevent",0 printh 00 @@ -418,7 +418,7 @@ Hotspot bt_bypass Hotspot bt_disarm Attributes - ID : 33 + ID : 30 Scope : local Dragging : 0 Send Component ID: disabled @@ -432,7 +432,7 @@ Hotspot bt_disarm bt_disarm_icon.pco=0 Touch Release Event - lastclick.txt="{\"domain\": \"alarm\", \"key\": \"disarm\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\", \"code_format\": \""+code_format.txt+"\"}" + lastclick.txt="{\"domain\": \"alarm\", \"key\": \"disarm\", \"value\": \"click\", \"entity\": \""+entity.txt+"\", \"mui\": \""+bt_disarm_text.txt+"\", \"code_format\": \""+code_format.txt+"\"}" printh 92 prints "localevent",0 printh 00 @@ -440,60 +440,3 @@ Hotspot bt_disarm printh 00 printh FF FF FF -Timer swipestore - Attributes - ID : 3 - Scope : local - Period (ms): 50 - Enabled : no - - Events - Timer Event - swipex=tch0 - swipey=tch1 - -TouchCap swipe - Attributes - ID : 2 - Scope: local - Value: 0 - - Events - Touch Press Event - swipestore.en=1 // Start swipestore timer - - Touch Release Event - swipestore.en=0 - // Touch has ended, x - if(tch0==0) - { - swipec=swipex-tch2 - // From Left to Right - if(swipec>swipedx) - { - //page - } - // Right to Left - swipec2=0-swipedx - if(swipec100) - { - //page - } - // Down to Up - swipec2=0-swipedy - if(swipec<-100) - { - //page - } - } - diff --git a/nspanel_us_code/keyb_num.txt b/nspanel_us_code/keyb_num.txt index c0f3068..73ba313 100644 --- a/nspanel_us_code/keyb_num.txt +++ b/nspanel_us_code/keyb_num.txt @@ -77,7 +77,7 @@ Variable (string) aux ID : 22 Scope : local Text : - Max. Text Size: 100 + Max. Text Size: 255 Variable (string) value Attributes @@ -106,7 +106,7 @@ Text pin Text : Max. Text Size : 25 -Text t1 +Text title Attributes ID : 18 Scope : local @@ -296,7 +296,7 @@ Button benter Events Touch Release Event - aux.txt="{\"domain\": \"keyb_num\", \"key\": "+key.txt+", \"value\": "+value.txt+", \"entity\": \""+entity.txt+"\", \"base_domain\": "+domain.txt+"\"}" + aux.txt="{\"domain\": \"keyb_num\", \"key\": \""+key.txt+"\", \"value\": \""+value.txt+"\", \"entity\": \""+entity.txt+"\", \"pin\": \""+pin.txt+"\", \"base_domain\": \""+domain.txt+"\"}" printh 92 prints "localevent",0 printh 00 diff --git a/nspanel_us_land.HMI b/nspanel_us_land.HMI index 9300861..971526e 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 0ff50b0..bac1382 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 60d59ab..87bb839 100644 --- a/nspanel_us_land_code/alarm.txt +++ b/nspanel_us_land_code/alarm.txt @@ -55,32 +55,32 @@ Page alarm Variable (string) lastclick Attributes - ID : 7 + ID : 5 Scope : local Text : Max. Text Size: 255 Variable (string) back_page Attributes - ID : 8 + ID : 6 Scope : local Text : home Max. Text Size: 15 -Variable (string) va0 - Attributes - ID : 9 - Scope : local - Text : - Max. Text Size: 10 - Variable (string) code_format Attributes - ID : 34 + ID : 31 Scope : local Text : Max. Text Size: 15 +Variable (string) entity + Attributes + ID : 32 + Scope : local + Text : + Max. Text Size: 100 + Text page_label Attributes ID : 1 @@ -93,7 +93,7 @@ Text page_label Text icon_state Attributes - ID : 6 + ID : 4 Scope : local Dragging : 0 Send Component ID : disabled @@ -103,7 +103,7 @@ Text icon_state Text bt_home_text Attributes - ID : 11 + ID : 8 Scope : local Dragging : 0 Send Component ID : disabled @@ -113,7 +113,7 @@ Text bt_home_text Text bt_away_text Attributes - ID : 13 + ID : 10 Scope : local Dragging : 0 Send Component ID : disabled @@ -123,7 +123,7 @@ Text bt_away_text Text bt_night_text Attributes - ID : 15 + ID : 12 Scope : local Dragging : 0 Send Component ID : disabled @@ -133,7 +133,7 @@ Text bt_night_text Text bt_vacat_text Attributes - ID : 17 + ID : 14 Scope : local Dragging : 0 Send Component ID : disabled @@ -143,7 +143,7 @@ Text bt_vacat_text Text bt_bypass_text Attributes - ID : 19 + ID : 16 Scope : local Dragging : 0 Send Component ID : disabled @@ -153,7 +153,7 @@ Text bt_bypass_text Text bt_disarm_text Attributes - ID : 21 + ID : 18 Scope : local Dragging : 0 Send Component ID : disabled @@ -163,7 +163,7 @@ Text bt_disarm_text Text bt_home_icon Attributes - ID : 22 + ID : 19 Scope : local Dragging : 0 Send Component ID : disabled @@ -173,7 +173,7 @@ Text bt_home_icon Text bt_away_icon Attributes - ID : 23 + ID : 20 Scope : local Dragging : 0 Send Component ID : disabled @@ -183,7 +183,7 @@ Text bt_away_icon Text bt_night_icon Attributes - ID : 24 + ID : 21 Scope : local Dragging : 0 Send Component ID : disabled @@ -193,7 +193,7 @@ Text bt_night_icon Text bt_vacat_icon Attributes - ID : 25 + ID : 22 Scope : local Dragging : 0 Send Component ID : disabled @@ -203,7 +203,7 @@ Text bt_vacat_icon Text bt_bypass_icon Attributes - ID : 26 + ID : 23 Scope : local Dragging : 0 Send Component ID : disabled @@ -213,7 +213,7 @@ Text bt_bypass_icon Text bt_disarm_icon Attributes - ID : 27 + ID : 24 Scope : local Dragging : 0 Send Component ID : disabled @@ -223,56 +223,56 @@ Text bt_disarm_icon Picture alarm_exit Attributes - ID : 4 + ID : 2 Scope : local Dragging : 0 Send Component ID: disabled Picture bt_home_pic Attributes - ID : 10 + ID : 7 Scope : local Dragging : 0 Send Component ID: disabled Picture bt_away_pic Attributes - ID : 12 + ID : 9 Scope : local Dragging : 0 Send Component ID: disabled Picture bt_night_pic Attributes - ID : 14 + ID : 11 Scope : local Dragging : 0 Send Component ID: disabled Picture bt_vacat_pic Attributes - ID : 16 + ID : 13 Scope : local Dragging : 0 Send Component ID: disabled Picture bt_bypass_pic Attributes - ID : 18 + ID : 15 Scope : local Dragging : 0 Send Component ID: disabled Picture bt_disarm_pic Attributes - ID : 20 + ID : 17 Scope : local Dragging : 0 Send Component ID: disabled Hotspot alarm_back Attributes - ID : 5 + ID : 3 Scope : local Dragging : 0 Send Component ID: disabled @@ -298,7 +298,7 @@ Hotspot alarm_back Hotspot bt_home Attributes - ID : 28 + ID : 25 Scope : local Dragging : 0 Send Component ID: disabled @@ -312,7 +312,7 @@ Hotspot bt_home bt_home_icon.pco=0 Touch Release Event - lastclick.txt="{\"domain\": \"alarm\", \"key\": \"home\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\", \"code_format\": \""+code_format.txt+"\"}" + lastclick.txt="{\"domain\": \"alarm\", \"key\": \"home\", \"value\": \"click\", \"entity\": \""+entity.txt+"\", \"mui\": \""+bt_home_text.txt+"\", \"code_format\": \""+code_format.txt+"\"}" printh 92 prints "localevent",0 printh 00 @@ -322,7 +322,7 @@ Hotspot bt_home Hotspot bt_away Attributes - ID : 29 + ID : 26 Scope : local Dragging : 0 Send Component ID: disabled @@ -336,7 +336,7 @@ Hotspot bt_away bt_away_icon.pco=0 Touch Release Event - lastclick.txt="{\"domain\": \"alarm\", \"key\": \"away\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\", \"code_format\": \""+code_format.txt+"\"}" + lastclick.txt="{\"domain\": \"alarm\", \"key\": \"away\", \"value\": \"click\", \"entity\": \""+entity.txt+"\", \"mui\": \""+bt_away_text.txt+"\", \"code_format\": \""+code_format.txt+"\"}" printh 92 prints "localevent",0 printh 00 @@ -346,7 +346,7 @@ Hotspot bt_away Hotspot bt_night Attributes - ID : 30 + ID : 27 Scope : local Dragging : 0 Send Component ID: disabled @@ -360,7 +360,7 @@ Hotspot bt_night bt_night_icon.pco=0 Touch Release Event - lastclick.txt="{\"domain\": \"alarm\", \"key\": \"night\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\", \"code_format\": \""+code_format.txt+"\"}" + lastclick.txt="{\"domain\": \"alarm\", \"key\": \"night\", \"value\": \"click\", \"entity\": \""+entity.txt+"\", \"mui\": \""+bt_night_text.txt+"\", \"code_format\": \""+code_format.txt+"\"}" printh 92 prints "localevent",0 printh 00 @@ -370,7 +370,7 @@ Hotspot bt_night Hotspot bt_vacat Attributes - ID : 31 + ID : 28 Scope : local Dragging : 0 Send Component ID: disabled @@ -384,7 +384,7 @@ Hotspot bt_vacat bt_vacat_icon.pco=0 Touch Release Event - lastclick.txt="{\"domain\": \"alarm\", \"key\": \"vacation\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\", \"code_format\": \""+code_format.txt+"\"}" + lastclick.txt="{\"domain\": \"alarm\", \"key\": \"vacation\", \"value\": \"click\", \"entity\": \""+entity.txt+"\", \"mui\": \""+bt_vacat_text.txt+"\", \"code_format\": \""+code_format.txt+"\"}" printh 92 prints "localevent",0 printh 00 @@ -394,7 +394,7 @@ Hotspot bt_vacat Hotspot bt_bypass Attributes - ID : 32 + ID : 29 Scope : local Dragging : 0 Send Component ID: disabled @@ -408,7 +408,7 @@ Hotspot bt_bypass bt_bypass_icon.pco=0 Touch Release Event - lastclick.txt="{\"domain\": \"alarm\", \"key\": \"bypass\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\", \"code_format\": \""+code_format.txt+"\"}" + lastclick.txt="{\"domain\": \"alarm\", \"key\": \"bypass\", \"value\": \"click\", \"entity\": \""+entity.txt+"\", \"mui\": \""+bt_bypass_text.txt+"\", \"code_format\": \""+code_format.txt+"\"}" printh 92 prints "localevent",0 printh 00 @@ -418,7 +418,7 @@ Hotspot bt_bypass Hotspot bt_disarm Attributes - ID : 33 + ID : 30 Scope : local Dragging : 0 Send Component ID: disabled @@ -432,7 +432,7 @@ Hotspot bt_disarm bt_disarm_icon.pco=0 Touch Release Event - lastclick.txt="{\"domain\": \"alarm\", \"key\": \"disarm\", \"value\": \"click\", \"entity\": \""+home.entity.txt+"\", \"code_format\": \""+code_format.txt+"\"}" + lastclick.txt="{\"domain\": \"alarm\", \"key\": \"disarm\", \"value\": \"click\", \"entity\": \""+entity.txt+"\", \"mui\": \""+bt_disarm_text.txt+"\", \"code_format\": \""+code_format.txt+"\"}" printh 92 prints "localevent",0 printh 00 @@ -440,60 +440,3 @@ Hotspot bt_disarm printh 00 printh FF FF FF -Timer swipestore - Attributes - ID : 3 - Scope : local - Period (ms): 50 - Enabled : no - - Events - Timer Event - swipex=tch0 - swipey=tch1 - -TouchCap swipe - Attributes - ID : 2 - Scope: local - Value: 0 - - Events - Touch Press Event - swipestore.en=1 // Start swipestore timer - - Touch Release Event - swipestore.en=0 - // Touch has ended, x - if(tch0==0) - { - swipec=swipex-tch2 - // From Left to Right - if(swipec>swipedx) - { - //page - } - // Right to Left - swipec2=0-swipedx - if(swipec100) - { - //page - } - // Down to Up - swipec2=0-swipedy - if(swipec<-100) - { - //page - } - } - diff --git a/nspanel_us_land_code/keyb_num.txt b/nspanel_us_land_code/keyb_num.txt index c0f3068..73ba313 100644 --- a/nspanel_us_land_code/keyb_num.txt +++ b/nspanel_us_land_code/keyb_num.txt @@ -77,7 +77,7 @@ Variable (string) aux ID : 22 Scope : local Text : - Max. Text Size: 100 + Max. Text Size: 255 Variable (string) value Attributes @@ -106,7 +106,7 @@ Text pin Text : Max. Text Size : 25 -Text t1 +Text title Attributes ID : 18 Scope : local @@ -296,7 +296,7 @@ Button benter Events Touch Release Event - aux.txt="{\"domain\": \"keyb_num\", \"key\": "+key.txt+", \"value\": "+value.txt+", \"entity\": \""+entity.txt+"\", \"base_domain\": "+domain.txt+"\"}" + aux.txt="{\"domain\": \"keyb_num\", \"key\": \""+key.txt+"\", \"value\": \""+value.txt+"\", \"entity\": \""+entity.txt+"\", \"pin\": \""+pin.txt+"\", \"base_domain\": \""+domain.txt+"\"}" printh 92 prints "localevent",0 printh 00