From 536410615e79eb72acfe3bd9993e1f571abb726c Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Sun, 3 Mar 2024 22:24:29 +0100 Subject: [PATCH] v4.3dev2 - Selectable pages for bar buttons Supports #168 Solves #1517 Solves #1507 --- ReleaseNotes.md | 17 +++-- esphome/nspanel_esphome_core.yaml | 11 ++- hmi/dev/nspanel_eu_code/boot.txt | 2 +- hmi/dev/nspanel_us_code/boot.txt | 2 +- hmi/dev/nspanel_us_land_code/boot.txt | 2 +- hmi/nspanel_eu.HMI | Bin 15263259 -> 15263259 bytes hmi/nspanel_eu.tft | Bin 7487720 -> 7487720 bytes hmi/nspanel_us.HMI | Bin 15048136 -> 15048136 bytes hmi/nspanel_us.tft | Bin 7492464 -> 7492464 bytes hmi/nspanel_us_land.HMI | Bin 14732985 -> 14747127 bytes hmi/nspanel_us_land.tft | Bin 7487720 -> 7487720 bytes nspanel_blueprint.yaml | 99 ++++++++++++++++++++++---- 12 files changed, 109 insertions(+), 24 deletions(-) diff --git a/ReleaseNotes.md b/ReleaseNotes.md index c965124..38473ab 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -73,7 +73,7 @@ Our community and support channels are open for any questions or assistance you - [Transition to ESP-IDF as Default Framework](#transition-to-esp-idf-as-default-framework) - [New API documentation](#new-api-documentation) - [Selectable font size for screensaver time display](#selectable-font-size-for-screensaver-time-display) -- [Hardware buttons bars visible on all pages](#hardware-buttons-bars-visible-on-all-pages) +- [Enhanced Visibility of Hardware Button Bars Across Pages](#enhanced-visibility-of-hardware-button-bars-across-pages) - [User-Defined Decimal Separator](#user-defined-decimal-separator) - [Page Light with Power Button](#page-light-with-power-button) - [Page Fan with Oscillate Button](#page-fan-with-oscillate-button) @@ -126,10 +126,17 @@ Now you can chose the font size for your clock display in the screen saver. Ther > Please select a differnt font in that case. -### Hardware buttons bars visible on all pages -Bars indicating statuses of entities controlled by hardware buttons are now visible on all pages, including screensaver. -Color customization for these bars is also available. -![Image](docs/pics/ha_blueprint_hw_buttons_colors.png) +### Enhanced Visibility of Hardware Button Bars Across Pages +The hardware button bars, which display the status of entities linked to physical buttons, are now configurable to appear across all pages, +including the screensaver, providing a constant visual reference to your system's status. +This update introduces a new setting within the blueprint, allowing you to customize the visibility of these bars according to your preferences. +Whether you need continuous monitoring on certain pages or want to maintain a cleaner look on others, this flexibility enhances your control. + +Additionally, we've introduced the option to personalize the color of these bars, offering further customization to match your panel's aesthetic or to signify different statuses at a glance. + +![Hardware Button Bars Color Customization](docs/pics/ha_blueprint_hw_buttons_colors.png) + +This feature enhances the NSPanel's functionality by ensuring important status indicators are always within view, tailored precisely to how you use your smart home. ### User-Defined Decimal Separator You can now select the decimal separator for displaying numbers on your NSPanel. diff --git a/esphome/nspanel_esphome_core.yaml b/esphome/nspanel_esphome_core.yaml index 0d3a077..1e81a2e 100644 --- a/esphome/nspanel_esphome_core.yaml +++ b/esphome/nspanel_esphome_core.yaml @@ -18,7 +18,7 @@ substitutions: temp_units: "°C" invalid_cooldown: "100ms" ##### DON'T CHANGE THIS ###### - version: "4.3dev1" + version: "4.3dev2" ############################## ##### External components ##### @@ -339,6 +339,7 @@ api: relay2_fallback: bool # Fallback state for Relay 2 in case of communication loss. button_left: bool # Enable/disable left button status visualization. button_right: bool # Enable/disable right button status visualization. + button_bar_pages: int # As uint representing the list of pages where the buttons bars will be visible button_bar_color_on: int[] # RGB color array for the hardware button bar when the status is `On`. button_bar_color_off: int[] # RGB color array for the hardware button bar when the status is `Off`. embedded_climate: bool # Indicates if climate control is integrated. @@ -384,6 +385,7 @@ api: refresh_relays->execute(); // Buttons bars settings + id(buttons_bars_pages) = button_bar_pages; update_bitwise_setting(id(buttons_settings), button_left, ButtonSettings::ButtonLeft_Enabled); update_bitwise_setting(id(buttons_settings), button_right, ButtonSettings::ButtonRight_Enabled); @@ -910,6 +912,11 @@ globals: restore_value: true initial_value: '10597' + - id: buttons_bars_pages + type: uint32_t + restore_value: true + initial_value: '1' + ####### Relay settings ####### # Bit # Settings # # 0 # Relay 1 - Local # @@ -2383,7 +2390,7 @@ script: mode: restart then: - lambda: |- - if (!id(is_uploading_tft)) { + if (!id(is_uploading_tft) and ((id(buttons_bars_pages) & (1 << get_page_id(current_page->state.c_str()))) != 0)) { switch (int(display_mode->state)) { case 1: // EU model if (id(buttons_settings) & nspanel_ha_blueprint::ButtonSettings::ButtonLeft_Enabled) { // Left button diff --git a/hmi/dev/nspanel_eu_code/boot.txt b/hmi/dev/nspanel_eu_code/boot.txt index 6f83888..8a940d8 100644 --- a/hmi/dev/nspanel_eu_code/boot.txt +++ b/hmi/dev/nspanel_eu_code/boot.txt @@ -103,7 +103,7 @@ Text tft_version Dragging : 0 Send Component ID : on press and release Associated Keyboard: none - Text : 4.3dev1 + Text : 4.3dev2 Max. Text Size : 9 Text esph_version diff --git a/hmi/dev/nspanel_us_code/boot.txt b/hmi/dev/nspanel_us_code/boot.txt index 35acd75..ad86552 100644 --- a/hmi/dev/nspanel_us_code/boot.txt +++ b/hmi/dev/nspanel_us_code/boot.txt @@ -103,7 +103,7 @@ Text tft_version Dragging : 0 Send Component ID : on press and release Associated Keyboard: none - Text : 4.3dev1 + Text : 4.3dev2 Max. Text Size : 9 Events diff --git a/hmi/dev/nspanel_us_land_code/boot.txt b/hmi/dev/nspanel_us_land_code/boot.txt index 6f83888..8a940d8 100644 --- a/hmi/dev/nspanel_us_land_code/boot.txt +++ b/hmi/dev/nspanel_us_land_code/boot.txt @@ -103,7 +103,7 @@ Text tft_version Dragging : 0 Send Component ID : on press and release Associated Keyboard: none - Text : 4.3dev1 + Text : 4.3dev2 Max. Text Size : 9 Text esph_version diff --git a/hmi/nspanel_eu.HMI b/hmi/nspanel_eu.HMI index a7302255185ca5c5f6f8e64ee92f66e22b43a177..0b078e67cfc33ca891e38278af2dbd8ca05729b9 100644 GIT binary patch delta 1190 zcmdVU*;CD77{Kx0uR3L_i*wO%&Ww>eH%(KFQ7Dn6kh1S8dnhHHlj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D}gz-sNcc(CPFq*w+AT diff --git a/hmi/nspanel_us.tft b/hmi/nspanel_us.tft index f018277381488aa0005d525cafed88ec103a238a..7abc10a98831b8acc1ba6d0e3015cf11c4e8fca5 100644 GIT binary patch delta 284 zcmWN=*G*Po007VcSDGNbBfVGYC`j+UcNF2LcP8-RB)mEW6PP#yL%0JY@SWtmy}Ty8 zg}=p#mmu;%q9n;ur1~gLx=%7>%91Tdt~~h)6e?1zM5)ipl&eswO0^ob>eOq{s7bRH zt=hEvqC=-H-Fo!u)9^pGiho6r8`g?p5#dSW%qT}!+jD@G+S$G~^gqPt}cpct^x8YrQA3lVS|6Ai!p4epP delta 284 zcmWN=S2CSp007VtKd#;-YV=Nms6i6F_g)ijlpw_hcsMh5l4lQQtbx^7g73_nm;Xz!gHN|h;B;k`;#s@14fr(T0bO`5f6 z)u!DCA9d)|<&$nbdiCiy;IlzPhJEqXHzP)k88>0llxZ_&&6&4g(UN5=R;^jLVbhjv zJ9h2aci_->KOT;bqlAvTcytsVhw<=dcoLq5XW@DHE4&CV!>jOj_$T}u{(Fo^*RjRu I=Kgv06`&1eNdN!< diff --git a/hmi/nspanel_us_land.HMI b/hmi/nspanel_us_land.HMI index ba59fd0fb024b374fe66c6b1e1b30a88448fae70..53a8ab74d36fc8661840d16d2161a6ea3f10e6f7 100644 GIT binary patch delta 1076 zcmd7Q*>8+t6vy#*%#3NI@sbE}=R(9)llDeysht+3)K04{O3}^Ow;KI1sHIg5s=W5y zsA-K-t);EKi`GtCmlBe>leqGY@IUlPK6##;oSZzrhFN3TKIVV=JwgR;@$H>_sA(GaS4CWeREQ+j%ggh<+* zfga%*cAHU>XZ9OttIshaBO`Lt{!ituYV0&(hw!NL8_DTO=>^56x7f6y8|-kviSEH- z(-j@+;vdWj6#Ov5!ou^OpS8m%!J zt8p5y37V)l#cPr#Yl;#yRnwHH>6)P=&D1Q-)*Q{%Jk8evEmX2nv`DE+Q@R#wiIyru z%d}jXTA`I%r7UGDN4d(=YPq#WYqd`6wLu%TNt?ArTeVI3+Fs$w4hyntA*b(KrMueK z)XDMT;x4Li5BE`x2dF_U9^w%m;|c0e zj|M!&Gd#x&yu>TKMkAWgj265>E86fD@9-WU@DZQz8DH=f?dS-4&CaM=M|)Yv?_j>K UGiHD-%GbNb-6vQ(*z=?BAFUIXssI20 delta 1089 zcmd7Q>u<|Z90u_7({62~@gpQ`FJy^?N@OfvxUFNZ8>a4eV=iN8SL(KDw^bj?W^);S zWrksMsoQi`b022zR>R!J`3Fc}@lHI+D*gmc^2vEl&Nn&Fi}SMthK5S7K`E?Z ztQ>n{T1L8vt_qV=L}GXde$(p=@ggbFk@e?}yWQv!mLWnYBG}iIty7Z9OVyr6(UdFV zto6OTVbvE_73xGf(o+n@hQg|0V5D5CssH3*uT*`K%_N&iHj`{7*-WyTR1FD{|6w2~ z)ha87Vi<;F1d?Gv3PxfSQZX81Fc#x59uts;bWFq~OhyK#z>2AuhUu7rnV5yyn1i{P zhxu55g;<14EXERKVJVhjIaVMWE3pbWSdBGU3mfdng#+ub9!_k)Mr^`nY(XCKu@x@3 zQGh}e)p_j3nD**qn?)dPi;ao<7h=`b3|poxaf5P{1s^)cgjn;HOgn diff --git a/hmi/nspanel_us_land.tft b/hmi/nspanel_us_land.tft index b35f4116f5270c41a8efe154b2ec5d534afedbd7..8f289b25254c300de4422e08520f9b9ac817243d 100644 GIT binary patch delta 284 zcmWN=dE{ldnLbkBSs4QL4-*pOvdnsY6OF5PeKJ50pEN#C}zm85u?V8n=on0v>8AAG;7YhUluG{vTVhwHS0EP+OloO zuHXLHv+uy+)6sF1(ES*Xj>6+G9-f4!;aPYdUWAw7Rd^lVgty^c_&5Cb9FOiFV$t^1 GTkIV_CuI8o delta 284 zcmWN=bxzlD007VdU!;^Sk?sx!1VOsHyZH%{3MYW=ZJvT#uyF=&!VUPB&)eSX(T3nKK*_gFlflI5u?V8n=on0v>CJJ%v-Q%$+8uz)~wsGY0I`9 zyY}omaOlYK^T}xx*YPhForI@hEc_Loh3Db#@FKhnufpr_CcF**gnz@kmsoWF&>uZ5 HzooqcKXzpJ diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index ae4258e..efa572e 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -10,7 +10,7 @@ blueprint: description: > # NSPanel Configuration via Blueprint: Complete UI-Based Setup - **Version**: v4.3dev1 + **Version**: v4.3dev2 This project enables comprehensive configuration of your NSPanel through a Blueprint featuring a user interface. @@ -758,13 +758,59 @@ blueprint: default: ' ' selector: *placeholder-selector ##### PLACEHOLDER ###################################################################### + hw_buttons_bar_pages: + name: Hardware Buttons - Visibility Pages + description: > + Choose the pages where the bars, indicating the status of entities linked to hardware buttons, will be displayed. + + ***Attention!** Overlapping of button bars with other components may occur on some pages. Please proceed with caution.* + default: + - '1' + selector: + select: + multiple: true + options: + - label: "Home (default)" + value: '1' + - label: "Buttons pages" + value: '61440' + - label: "Entities pages" + value: '3932160' + - label: "Notification page" + value: '65536' + - label: "QR code page" + value: '131072' + - label: "Screen saver (sleep) page" + value: '512' + - label: "Settings page" + value: '128' + - label: "Utilities page" + value: '134217728' + - label: "Weather pages" + value: '62' + - label: "Alarm control panel page" + value: '8388608' + - label: "Climate page" + value: '64' + - label: "Cover page" + value: '2048' + - label: "Fan page" + value: '4194304' + - label: "Light page" + value: '1024' + - label: "Media player page" + value: '33554432' + - label: "Confirm pop-up page" + value: '67108864' + - label: "Keyboard pop-up page" + value: '16777216' hw_buttons_bar_color_on: - name: Hardware buttons - Bar color when `On` (Optional) + name: Hardware Buttons - Bar color when `On` (Optional) description: "Choose a color for the button's bars when the controlled entity is `On`." default: [31, 169, 255] selector: *color_selector hw_buttons_bar_color_off: - name: Hardware buttons - Bar color when `Off` (Optional) + name: Hardware baby-carriageuttons - Bar color when `Off` (Optional) description: "Choose a color for the button's bars when the controlled entity is `Off`." default: [44, 44, 44] selector: *color_selector @@ -3067,7 +3113,7 @@ trigger_variables: variables: ##### GENERAL ##### - blueprint_version: '4.3dev1' + blueprint_version: '4.3dev2' date_format_temp: !input 'date_format' # Avoid breaking change for existing users with legacy type format date_format: '{{ date_format_temp if date_format_temp not in ["%d.%m", "%d/%m", "%-d/%-m", "%-m/%-d"] else "%A, " ~ date_format_temp }}' @@ -7026,6 +7072,7 @@ action: icon_color: '{{ None }}' name: '{{ None }}' - &variable_entity + alias: Variable Entity variables: entity_id_valid: '{{ entity_id is defined and entity_id is string and entity_id.split(".") | count == 2 }}' entity_state: '{{ states(entity_id) | default("unknown") if entity_id_valid }}' @@ -7301,6 +7348,8 @@ action: - variables: climate_friendly_name: '{{ state_attr(climate, "friendly_name") if climate is string and climate is match "climate." else "" }}' + hw_buttons_bar_pages: !input hw_buttons_bar_pages + - service: '{{ nspanel.service.init.hardware }}' data: relay1_local_control: '{{ hardware.buttons.left.entity == relay01_entity }}' @@ -7313,6 +7362,7 @@ action: relay2_fallback: !input relay_2_local_fallback button_left: '{{ hardware.buttons.left.entity is defined and hardware.buttons.left.entity is string and hardware.buttons.left.entity.split(".") | count == 2 }}' button_right: '{{ hardware.buttons.right.entity is defined and hardware.buttons.right.entity is string and hardware.buttons.right.entity.split(".") | count == 2 }}' + button_bar_pages: '{{ hw_buttons_bar_pages | map("int") | sum }}' button_bar_color_on: !input hw_buttons_bar_color_on button_bar_color_off: !input hw_buttons_bar_color_off embedded_climate: '{{ climate == thermostat_embedded }}' @@ -9157,14 +9207,21 @@ action: }} sequence: &refresh_page_utilities_group - condition: '{{ repeat.item.icon is defined and repeat.item.icon is string and repeat.item.icon.split("mdi:") | count == 2 }}' - - variables: + - alias: Var aux 1 + variables: icon_code: '{{ repeat.item.icon.split("mdi:")[1] if repeat.item.icon is string and repeat.item.icon.split("mdi:") | count == 2 }}' + - alias: Var aux 2 + variables: entity_id: '{{ repeat.item.value1 }}' + - alias: Var aux 3 + variables: unit_of_measurement: '{{ state_attr(entity_id, "unit_of_measurement") | default("") }}' - *variable_entity - - variables: + - alias: Var Value with units 1 + variables: value_temp: *value_with_unit_and_translations - - service: '{{ nspanel.service.value }}' + - alias: Service value 1 + service: '{{ nspanel.service.value }}' data: id: 'utilities.{{ repeat.item.name }}' icon: '{{ all_icons[icon_code] if icon_code in all_icons else "" }}' @@ -9175,13 +9232,16 @@ action: continue_on_error: true - if: '{{ repeat.item.value2 is defined and repeat.item.value2 is string and repeat.item.value2.split(".") | count == 2 }}' then: - - variables: + - alias: Var entity prep 2 + variables: entity_id: '{{ repeat.item.value2 }}' unit_of_measurement: '{{ state_attr(entity_id, "unit_of_measurement") | default("") }}' - *variable_entity - - variables: + - alias: Var Value with units 1 + variables: value_temp: *value_with_unit_and_translations - - service: '{{ nspanel.service.value }}' + - alias: Service value 2 + service: '{{ nspanel.service.value }}' data: id: 'utilities.{{ repeat.item.name }}b' icon: '' @@ -9190,7 +9250,8 @@ action: value: *value_with_unit_and_translations value_color: '{{ repeat.item.color }}' continue_on_error: true - - variables: + - alias: Var group_components + variables: group_components: > {% set base_items = [ repeat.item.name, @@ -9204,7 +9265,8 @@ action: {% set extra_items = [] %} {% endif %} {{ base_items + extra_items }} - - service: '{{ nspanel.service.component.visibility }}' + - alias: Service visibility + service: '{{ nspanel.service.component.visibility }}' data: ids: '{{ group_components }}' visible: true @@ -9419,7 +9481,7 @@ action: else "Unknown" }} - - Blueprint (expected): {{ blueprint_version }} + - Blueprint (installed): {{ blueprint_version }} continue_on_error: true else: - if: @@ -9446,7 +9508,16 @@ action: - ESPHome: {{ nspanel_event.esphome }} - - Blueprint: {{ nspanel_event.blueprint }} (expected {{ blueprint_version }}) + - Blueprint (reported by ESPHome): {{ + nspanel_event.blueprint + if + nspanel_event.blueprint is defined and + nspanel_event.blueprint is string and + nspanel_event.blueprint | length > 0 + else "Unknown" + }} + + - Blueprint (installed): {{ blueprint_version }} continue_on_error: true ##### Other events #####