diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index 63cf278..6ac386f 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -5507,14 +5507,14 @@ variables: color_rgb: "on": !input 'home_button05_icon_color' "off": "" # NOT IN USE - - icon: !input 'home_button06_icon' #EDCF - color_rgb: - "on": !input 'home_button06_icon_color' - "off": "" # NOT IN USE - - icon: "mdi:shield-home" # ALARM - color_rgb: - "on": [248, 0, 0] # red: "63488" - "off": [255, 255, 255] # white: "65535" + #- icon: !input 'home_button06_icon' #EDCF + # color_rgb: + # "on": !input 'home_button06_icon_color' + # "off": "" # NOT IN USE + #- icon: "mdi:shield-home" # ALARM + # color_rgb: + # "on": [248, 0, 0] # red: "63488" + # "off": [255, 255, 255] # white: "65535" general: outdoor_temp: label: @@ -5578,9 +5578,6 @@ variables: relay_1_local_fallback: !input 'relay_1_local_fallback' relay_2_local_fallback: !input 'relay_2_local_fallback' - ##### ENTITIES ##### - entitypages_enabled: !input 'entitypages_enabled' - enum: color_mode: # Possible light color modes. - https://github.com/home-assistant/core/blob/dev/homeassistant/components/light/__init__.py unknown: "[]" @@ -6334,6 +6331,12 @@ action: relay2: icon: !input 'relay02_icon' #E3A8 icon_color_rgb: !input 'relay02_icon_color' + - &variables_bt_entities + variables: + bt_entities: + enabled: !input 'entitypages_enabled' + icon: !input 'home_button06_icon' #EDCF + color_rgb: !input 'home_button06_icon_color' - service: '{{ nextion.command.global_settings }}' data: @@ -6394,21 +6397,21 @@ action: if alarm is string and alarm | length > 0 else "" }} - entities_pages: '{{ entitypages_enabled }}' + entities_pages: '{{ bt_entities.enabled }}' entities_pages_icon: > {{ - all_icons[page_home.buttons[5].icon.split(":")[1]] | default(page_home.buttons[5].icon - if page_home.buttons[5].icon is string + all_icons[bt_entities.icon.split(":")[1]] | default(bt_entities.icon + if bt_entities.icon is string else all_icons["format-list-bulleted-square"]) }} entities_pages_icon_color: > {{ - page_home.buttons[5].color_rgb.on - if is_number(page_home.buttons[5].color_rgb.on) + bt_entities.color_rgb + if is_number(bt_entities.color_rgb) else - ((page_home.buttons[5].color_rgb.on[0] //(2**3)) *(2**11))+ - ((page_home.buttons[5].color_rgb.on[1] //(2**2)) *(2**5))+ - (page_home.buttons[5].color_rgb.on[2] //(2**3)) + ((bt_entities.color_rgb[0] //(2**3)) *(2**11))+ + ((bt_entities.color_rgb[1] //(2**2)) *(2**5))+ + (bt_entities.color_rgb[2] //(2**3)) }} continue_on_error: true - *delay-default diff --git a/nspanel_esphome.yaml b/nspanel_esphome.yaml index 6c6626b..2a8534a 100644 --- a/nspanel_esphome.yaml +++ b/nspanel_esphome.yaml @@ -497,9 +497,9 @@ api: ## Entities pages button - lambda: |- if (${verbose_log}) ESP_LOGD("service.global_settings", "Entities pages button - Start"); - id(home_entities_pages) = (entities_pages); - id(home_entities_pages_icon) = entities_pages_icon.c_str(); - id(home_entities_pages_icon_color) = entities_pages_icon_color; + id(disp1).send_command_printf("is_entities=%i", (entities_pages) ? 1 : 0); + id(disp1).set_component_text_printf("home.bt_entities", "%s", entities_pages_icon.c_str()); + id(disp1).set_component_font_color("home.bt_entities", entities_pages_icon_color); ## Alarm button - lambda: |- @@ -710,20 +710,6 @@ globals: restore_value: true initial_value: '0' - ##### Entities pages button ##### - - id: home_entities_pages - type: bool - restore_value: false - initial_value: 'false' - - id: home_entities_pages_icon - type: std::string - restore_value: false - initial_value: '' - - id: home_entities_pages_icon_color - type: int - restore_value: false - initial_value: '52857' - ##### START - BINARY SENSOR CONFIGURATION ##### binary_sensor: @@ -1442,8 +1428,6 @@ script: id(disp1).set_component_font_color("home.time", id(home_time_color)); id(disp1).set_component_font_color("home.icon_top_01", id(home_relay1_icon_color)); id(disp1).set_component_font_color("home.icon_top_02", id(home_relay2_icon_color)); - id(disp1).set_component_font_color("home.button06_icon", id(home_entities_pages_icon_color)); - - id: refresh_datetime mode: restart @@ -1545,36 +1529,15 @@ script: - lambda: if (${verbose_log}) ESP_LOGD("script.update_page_home", "Starting"); - if: condition: - - binary_sensor.is_on: nextion_init + #- binary_sensor.is_on: nextion_init - text_sensor.state: # Is home page visible? id: current_page state: 'home' then: - - script.execute: - id: refresh_datetime - - script.execute: - id: refresh_relays - - script.execute: - id: refresh_wifi_icon - - - lambda: |- - // Show Entities pages button - if (${verbose_log}) ESP_LOGD("script.update_page_home", "Show Entities pages button"); - if (id(home_entities_pages)) - { - if (id(home_entities_pages_icon) == "" or id(home_entities_pages_icon).empty()) id(home_entities_pages_icon) = "\uEDCF"; - id(disp1).set_component_text_printf("button06_icon", id(home_entities_pages_icon).c_str()); - id(disp1).show_component("button06"); - id(disp1).show_component("button06_icon"); - } - else - { - id(disp1).hide_component("button06"); - id(disp1).hide_component("button06_icon"); - } - - - script.execute: - id: addon_climate_update_page_home + - script.execute: refresh_datetime + - script.execute: refresh_relays + - script.execute: refresh_wifi_icon + - script.execute: addon_climate_update_page_home - lambda: if (${verbose_log}) ESP_LOGD("script.update_page_home", "Finished"); - id: service_call_alarm_control_panel diff --git a/nspanel_eu.HMI b/nspanel_eu.HMI index bfb00cc..f8d8fc1 100644 Binary files a/nspanel_eu.HMI and b/nspanel_eu.HMI differ diff --git a/nspanel_eu.tft b/nspanel_eu.tft index 1574f4b..8a377a9 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 20c1c3e..913f002 100644 --- a/nspanel_eu_code/Program.s.txt +++ b/nspanel_eu_code/Program.s.txt @@ -5,7 +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 + int is_alarm=0,is_entities=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 3758335..ea71269 100644 --- a/nspanel_eu_code/home.txt +++ b/nspanel_eu_code/home.txt @@ -21,8 +21,7 @@ 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_entities,is_entities vis bt_alarm,is_alarm Variable (int32) brightness @@ -51,14 +50,14 @@ Variable (int32) sleepmodus Variable (string) lastclick Attributes - ID : 53 + ID : 52 Scope : local Text : Max. Text Size: 100 Variable (string) entity Attributes - ID : 54 + ID : 53 Scope : global Text : Max. Text Size: 100 @@ -353,7 +352,7 @@ Text button05_icon Text : Max. Text Size : 10 -Text button06_icon +Text bt_entities Attributes ID : 43 Scope : global @@ -363,6 +362,13 @@ Text button06_icon Text : Max. Text Size : 10 + Events + Touch Release Event + if(api==1) + { + page entitypage01 + } + Text bt_alarm Attributes ID : 44 @@ -383,7 +389,7 @@ Text bt_alarm Text meridiem Attributes - ID : 52 + ID : 51 Scope : global Dragging : 0 Send Component ID : disabled @@ -549,23 +555,9 @@ Hotspot button05 printh 00 printh FF FF FF -Hotspot button06 - Attributes - ID : 50 - Scope : local - Dragging : 0 - Send Component ID: disabled - - Events - Touch Release Event - if(api==1) - { - page entitypage01 - } - Hotspot settings_click Attributes - ID : 51 + ID : 50 Scope : local Dragging : 0 Send Component ID: disabled @@ -621,7 +613,7 @@ Timer sleeptimer Timer settings_timer Attributes - ID : 55 + ID : 54 Scope : local Period (ms): 1000 Enabled : no diff --git a/nspanel_us.HMI b/nspanel_us.HMI index 70726d8..54e4405 100644 Binary files a/nspanel_us.HMI and b/nspanel_us.HMI differ diff --git a/nspanel_us.tft b/nspanel_us.tft index 71593d3..501dd60 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 242d8a9..ce09ade 100644 --- a/nspanel_us_code/Program.s.txt +++ b/nspanel_us_code/Program.s.txt @@ -5,7 +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 + int is_alarm=0,is_entities=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 fdf11c3..8ad070d 100644 --- a/nspanel_us_code/home.txt +++ b/nspanel_us_code/home.txt @@ -21,8 +21,7 @@ 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_entities,is_entities vis bt_alarm,is_alarm Variable (int32) brightness @@ -51,14 +50,14 @@ Variable (int32) sleepmodus Variable (string) lastclick Attributes - ID : 53 + ID : 52 Scope : local Text : Max. Text Size: 100 Variable (string) entity Attributes - ID : 54 + ID : 53 Scope : global Text : Max. Text Size: 100 @@ -353,7 +352,7 @@ Text button05_icon Text : Max. Text Size : 10 -Text button06_icon +Text bt_entities Attributes ID : 43 Scope : global @@ -363,6 +362,13 @@ Text button06_icon Text : Max. Text Size : 10 + Events + Touch Release Event + if(api==1) + { + page entitypage01 + } + Text bt_alarm Attributes ID : 44 @@ -383,7 +389,7 @@ Text bt_alarm Text meridiem Attributes - ID : 52 + ID : 51 Scope : global Dragging : 0 Send Component ID : disabled @@ -549,27 +555,13 @@ Hotspot button05 printh 00 printh FF FF FF -Hotspot button06 +Hotspot settings_click Attributes ID : 50 Scope : local Dragging : 0 Send Component ID: disabled - Events - Touch Release Event - if(api==1) - { - page entitypage01 - } - -Hotspot settings_click - Attributes - ID : 51 - Scope : local - Dragging : 0 - Send Component ID: on release - Events Touch Press Event settings_timer.en=1 @@ -621,7 +613,7 @@ Timer sleeptimer Timer settings_timer Attributes - ID : 55 + ID : 54 Scope : local Period (ms): 1000 Enabled : no diff --git a/nspanel_us_land.HMI b/nspanel_us_land.HMI index 251d72c..407d494 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 3110e9b..44405ff 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 a9f34b7..e41bc3e 100644 --- a/nspanel_us_land_code/Program.s.txt +++ b/nspanel_us_land_code/Program.s.txt @@ -5,7 +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 + int is_alarm=0,is_entities=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 0f73ff4..5891213 100644 --- a/nspanel_us_land_code/home.txt +++ b/nspanel_us_land_code/home.txt @@ -21,8 +21,7 @@ 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_entities,is_entities vis bt_alarm,is_alarm vis left_bt_text,0 vis right_bt_text,0 @@ -53,14 +52,14 @@ Variable (int32) sleepmodus Variable (string) lastclick Attributes - ID : 53 + ID : 52 Scope : local Text : Max. Text Size: 100 Variable (string) entity Attributes - ID : 54 + ID : 53 Scope : global Text : Max. Text Size: 100 @@ -355,7 +354,7 @@ Text button05_icon Text : Max. Text Size : 10 -Text button06_icon +Text bt_entities Attributes ID : 43 Scope : global @@ -365,6 +364,13 @@ Text button06_icon Text : Max. Text Size : 10 + Events + Touch Release Event + if(api==1) + { + page entitypage01 + } + Text bt_alarm Attributes ID : 44 @@ -385,7 +391,7 @@ Text bt_alarm Text meridiem Attributes - ID : 52 + ID : 51 Scope : global Dragging : 0 Send Component ID : disabled @@ -551,23 +557,9 @@ Hotspot button05 printh 00 printh FF FF FF -Hotspot button06 - Attributes - ID : 50 - Scope : local - Dragging : 0 - Send Component ID: disabled - - Events - Touch Release Event - if(api==1) - { - page entitypage01 - } - Hotspot settings_click Attributes - ID : 51 + ID : 50 Scope : local Dragging : 0 Send Component ID: disabled @@ -623,7 +615,7 @@ Timer sleeptimer Timer settings_timer Attributes - ID : 55 + ID : 54 Scope : local Period (ms): 1000 Enabled : no