diff --git a/nspanel_esphome.yaml b/nspanel_esphome.yaml index f9e8df5..6c6626b 100644 --- a/nspanel_esphome.yaml +++ b/nspanel_esphome.yaml @@ -504,7 +504,8 @@ api: ## Alarm button - lambda: |- if (${verbose_log}) ESP_LOGD("service.global_settings", "Alarm button - Start"); - id(home_alarm_state) = alarm_state; + id(disp1).send_command_printf("is_alarm=%i", (alarm_state=="" or alarm_state.empty()) ? 0 : 1); + id(update_alarm_icon)->execute("home.bt_alarm", alarm_state.c_str()); ## Wakeup page - lambda: |- @@ -549,8 +550,8 @@ api: // set alarm icon on home page if (${verbose_log}) ESP_LOGD("service.alarm_settings", "Updating home page icon"); - id(home_alarm_state) = state; - id(update_alarm_icon)->execute("home.button07_icon", state.c_str()); + id(disp1).send_command_printf("is_alarm=%i", (state=="" or state.empty()) ? 0 : 1); + id(update_alarm_icon)->execute("home.bt_alarm", state.c_str()); ## Update alarm page - if: @@ -709,12 +710,6 @@ globals: restore_value: true initial_value: '0' - ##### Alarm state ##### - - id: home_alarm_state - type: std::string - restore_value: false - initial_value: '' - ##### Entities pages button ##### - id: home_entities_pages type: bool @@ -1578,19 +1573,6 @@ script: id(disp1).hide_component("button06_icon"); } - // Show alarm button - if (${verbose_log}) ESP_LOGD("script.update_page_home", "Show alarm button"); - if (id(home_alarm_state) != "" and not id(home_alarm_state).empty()) - { - id(update_alarm_icon)->execute("button07_icon", id(home_alarm_state)); - id(disp1).show_component("button07"); - id(disp1).show_component("button07_icon"); - } - else - { - id(disp1).hide_component("button07"); - id(disp1).hide_component("button07_icon"); - } - script.execute: id: addon_climate_update_page_home - lambda: if (${verbose_log}) ESP_LOGD("script.update_page_home", "Finished"); diff --git a/nspanel_eu.HMI b/nspanel_eu.HMI index 5cc418f..bfb00cc 100644 Binary files a/nspanel_eu.HMI and b/nspanel_eu.HMI differ diff --git a/nspanel_eu.tft b/nspanel_eu.tft index 0065052..1574f4b 100644 Binary files a/nspanel_eu.tft and b/nspanel_eu.tft differ diff --git a/nspanel_eu_code/Program.s.txt b/nspanel_eu_code/Program.s.txt index e9fd6eb..20c1c3e 100644 --- a/nspanel_eu_code/Program.s.txt +++ b/nspanel_eu_code/Program.s.txt @@ -5,6 +5,7 @@ Program.s int h=0,s=0,v=0 int p=0,q=0,t=0,f=0 int api=0 // 0 = disconnected from HA, 1 = connected to HA + int is_alarm=0 bauds=115200//Configure baudrat recmod=0//Serial data parsing mode:0-Passive mode;1-Active mode printh 00 00 00 ff ff ff 88 ff ff ff//Output power on information to serial port diff --git a/nspanel_eu_code/home.txt b/nspanel_eu_code/home.txt index 9105714..3758335 100644 --- a/nspanel_eu_code/home.txt +++ b/nspanel_eu_code/home.txt @@ -23,6 +23,7 @@ Page home printh FF FF FF vis button06_icon,0 vis button06,0 + vis bt_alarm,is_alarm Variable (int32) brightness Attributes @@ -50,14 +51,14 @@ Variable (int32) sleepmodus Variable (string) lastclick Attributes - ID : 54 + ID : 53 Scope : local Text : Max. Text Size: 100 Variable (string) entity Attributes - ID : 55 + ID : 54 Scope : global Text : Max. Text Size: 100 @@ -362,7 +363,7 @@ Text button06_icon Text : Max. Text Size : 10 -Text button07_icon +Text bt_alarm Attributes ID : 44 Scope : global @@ -372,9 +373,17 @@ Text button07_icon Text : Max. Text Size : 10 + Events + Touch Release Event + if(api==1) + { + entity.txt="" + page alarm + } + Text meridiem Attributes - ID : 53 + ID : 52 Scope : global Dragging : 0 Send Component ID : disabled @@ -554,24 +563,9 @@ Hotspot button06 page entitypage01 } -Hotspot button07 - Attributes - ID : 51 - Scope : local - Dragging : 0 - Send Component ID: disabled - - Events - Touch Release Event - if(api==1) - { - entity.txt="" - page alarm - } - Hotspot settings_click Attributes - ID : 52 + ID : 51 Scope : local Dragging : 0 Send Component ID: disabled @@ -627,7 +621,7 @@ Timer sleeptimer Timer settings_timer Attributes - ID : 56 + ID : 55 Scope : local Period (ms): 1000 Enabled : no diff --git a/nspanel_us.HMI b/nspanel_us.HMI index 9be2027..70726d8 100644 Binary files a/nspanel_us.HMI and b/nspanel_us.HMI differ diff --git a/nspanel_us.tft b/nspanel_us.tft index e406d13..71593d3 100644 Binary files a/nspanel_us.tft and b/nspanel_us.tft differ diff --git a/nspanel_us_code/Program.s.txt b/nspanel_us_code/Program.s.txt index a79f803..242d8a9 100644 --- a/nspanel_us_code/Program.s.txt +++ b/nspanel_us_code/Program.s.txt @@ -5,6 +5,7 @@ Program.s int h=0,s=0,v=0 int p=0,q=0,t=0,f=0 int api=0 // 0 = disconnected from HA, 1 = connected to HA + int is_alarm=0 bauds=115200//Configure baudrat recmod=0//Serial data parsing mode:0-Passive mode;1-Active mode printh 00 00 00 ff ff ff 88 ff ff ff//Output power on information to serial port diff --git a/nspanel_us_code/home.txt b/nspanel_us_code/home.txt index ebb5d56..fdf11c3 100644 --- a/nspanel_us_code/home.txt +++ b/nspanel_us_code/home.txt @@ -21,6 +21,9 @@ Page home prints "{\"page\": \"home\", \"component\": \"currentpage\", \"value\": \"pagechange\"}",0 printh 00 printh FF FF FF + vis button06_icon,0 + vis button06,0 + vis bt_alarm,is_alarm Variable (int32) brightness Attributes @@ -48,14 +51,14 @@ Variable (int32) sleepmodus Variable (string) lastclick Attributes - ID : 54 + ID : 53 Scope : local Text : Max. Text Size: 100 Variable (string) entity Attributes - ID : 55 + ID : 54 Scope : global Text : Max. Text Size: 100 @@ -360,7 +363,7 @@ Text button06_icon Text : Max. Text Size : 10 -Text button07_icon +Text bt_alarm Attributes ID : 44 Scope : global @@ -370,9 +373,17 @@ Text button07_icon Text : Max. Text Size : 10 + Events + Touch Release Event + if(api==1) + { + entity.txt="" + page alarm + } + Text meridiem Attributes - ID : 53 + ID : 52 Scope : global Dragging : 0 Send Component ID : disabled @@ -552,24 +563,9 @@ Hotspot button06 page entitypage01 } -Hotspot button07 - Attributes - ID : 51 - Scope : local - Dragging : 0 - Send Component ID: disabled - - Events - Touch Release Event - if(api==1) - { - entity.txt="" - page alarm - } - Hotspot settings_click Attributes - ID : 52 + ID : 51 Scope : local Dragging : 0 Send Component ID: on release @@ -625,7 +621,7 @@ Timer sleeptimer Timer settings_timer Attributes - ID : 56 + ID : 55 Scope : local Period (ms): 1000 Enabled : no diff --git a/nspanel_us_land.HMI b/nspanel_us_land.HMI index e8675eb..251d72c 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 79c5a99..3110e9b 100644 Binary files a/nspanel_us_land.tft and b/nspanel_us_land.tft differ diff --git a/nspanel_us_land_code/Program.s.txt b/nspanel_us_land_code/Program.s.txt index 3f1dfba..a9f34b7 100644 --- a/nspanel_us_land_code/Program.s.txt +++ b/nspanel_us_land_code/Program.s.txt @@ -5,6 +5,7 @@ Program.s int h=0,s=0,v=0 int p=0,q=0,t=0,f=0 int api=0 // 0 = disconnected from HA, 1 = connected to HA + int is_alarm=0 bauds=115200//Configure baudrat recmod=0//Serial data parsing mode:0-Passive mode;1-Active mode printh 00 00 00 ff ff ff 88 ff ff ff//Output power on information to serial port diff --git a/nspanel_us_land_code/home.txt b/nspanel_us_land_code/home.txt index 14ecdaf..0f73ff4 100644 --- a/nspanel_us_land_code/home.txt +++ b/nspanel_us_land_code/home.txt @@ -23,6 +23,7 @@ Page home printh FF FF FF vis button06_icon,0 vis button06,0 + vis bt_alarm,is_alarm vis left_bt_text,0 vis right_bt_text,0 @@ -52,14 +53,14 @@ Variable (int32) sleepmodus Variable (string) lastclick Attributes - ID : 54 + ID : 53 Scope : local Text : Max. Text Size: 100 Variable (string) entity Attributes - ID : 55 + ID : 54 Scope : global Text : Max. Text Size: 100 @@ -364,7 +365,7 @@ Text button06_icon Text : Max. Text Size : 10 -Text button07_icon +Text bt_alarm Attributes ID : 44 Scope : global @@ -374,9 +375,17 @@ Text button07_icon Text : Max. Text Size : 10 + Events + Touch Release Event + if(api==1) + { + entity.txt="" + page alarm + } + Text meridiem Attributes - ID : 53 + ID : 52 Scope : global Dragging : 0 Send Component ID : disabled @@ -556,24 +565,9 @@ Hotspot button06 page entitypage01 } -Hotspot button07 - Attributes - ID : 51 - Scope : local - Dragging : 0 - Send Component ID: disabled - - Events - Touch Release Event - if(api==1) - { - entity.txt="" - page alarm - } - Hotspot settings_click Attributes - ID : 52 + ID : 51 Scope : local Dragging : 0 Send Component ID: disabled @@ -629,7 +623,7 @@ Timer sleeptimer Timer settings_timer Attributes - ID : 56 + ID : 55 Scope : local Period (ms): 1000 Enabled : no