diff --git a/ReleaseNotes.md b/ReleaseNotes.md index bbf38ca..4f34794 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -36,7 +36,8 @@ Since in this update lots of input to the blueprint changed, we highly recommend 4. New language selector (#882) 5. Removed `settings_entity` (#887) 6. Support for US model on landscape mode (#890) -7. API status indication on the panel +7. API status indication on the panel ([#5ff5d35](https://github.com/Blackymas/NSPanel_HA_Blueprint/commit/5ff5d35833be1a1cf9ca0f570662456058980024)) +8. Light & cover settings pages will show only the supported features (#896)   ## Details of all changes @@ -70,12 +71,12 @@ Althougt this is not visible for users at the first view, it will enable the use The entity `sensor.xxxxx_settings_entity` was previously used by ESPHome to to transfer information about the selected entity on the settings page to the Blueprint, enabling the transfer of settings from different instances of the blueprint with the use of service `esphome.xxxxx_set_settings_entity`. This mechanism was a bit fragile and not user friendly. With this version the information about the entity shown will be part of the `sensor.xxxxx_nspanel_event` and the settings pages will be called with the service `esphome.xxxxx_open_entity_settings_page`. Apart of a cleaner device page, this change should be transparent for most users. If you have made automations based on the removed elements, please update it using the new service. - +  ### 6. Support for US model on landscape mode If you are using a panel model US in landscape mode, you can now use `nspanel_us_land.tft` where the bars related to the hardware buttons will be located at the right, closer to the respective buttons and fixing the offset on the touch screen when using `nspanel_eu.tft` into a US panel. => The hardware buttons labels are hidden in this format, as Nextion cannot support rotated text. - +  ### 7. API status indication on the panel Now the Wi-Fi icon in the panel (at the right side of the time) will show one of 3 possible states: @@ -84,7 +85,11 @@ Now the Wi-Fi icon in the panel (at the right side of the time) will show one of ![api-off_red](https://github.com/Blackymas/NSPanel_HA_Blueprint/assets/94725493/2486df3b-17ea-4c2c-a3c2-057c565a3173) The panel is connected to the Wi-Fi, but the API is not connected to Home Assistant (mdi:api-off) ![wifi-off_red](https://github.com/Blackymas/NSPanel_HA_Blueprint/assets/94725493/c8b15d1f-0950-42d7-84d1-fca8610543c0) The panel is **NOT** connected to the Wi-Fi (mdi:wifi-off) - +  +### 8. Light & cover settings pages will show only the supported features +Now when long press a button conneted to a light or a cover, the detailed light settings page will open only when the entity supports advanced control, and the detailed page will only show the controls supported by that entity. + +  ## Next topics we are currently working on See here: https://github.com/Blackymas/NSPanel_HA_Blueprint/labels/roadmap diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index 099a6cc..6148182 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -5341,6 +5341,19 @@ variables: ##### 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: "[]" + onoff: "[]" + brightness: "[]" + color_temp: "[]" + hs: "[]" + xy: "[]" + rgb: "[]" + rgbw: "[]" + rgbww: "[]" + white: "[]" + ############################################################# ##### CLOSE - Variables ##### ############################################################# @@ -7085,6 +7098,24 @@ action: - alias: Light settings page conditions: '{{ nspanel_event.page == page.light }}' sequence: &refresh_page_light + - variables: + supported_color_modes: '{{ state_attr(nspanel_event.entity, "supported_color_modes") | default("unknown") }}' + color_mode_color: > + {{ + "hs" in supported_color_modes + or "xy" in supported_color_modes + or "rgb" in supported_color_modes + or "rgbw" in supported_color_modes + or "rgbww" in supported_color_modes + }} + color_mode_color_temp: '{{ "color_temp" in supported_color_modes }}' + #color_mode_brightness: > + # {{ + # "brightness" in supported_color_modes + # or "white" in supported_color_modes + # or color_mode_color + # or color_mode_color_temp + # }} ##### LIGHT State ##### - variables: curr_brightness: '{{ (state_attr(nspanel_event.entity, "brightness") | int(0) * 100 / 255) | round(0) }}' @@ -7108,27 +7139,77 @@ action: continue_on_error: true ##### LIGHT Check Color_Temp Value is available when yes send some current Values ##### - - variables: - curr_color_temp: '{{ state_attr(nspanel_event.entity, "color_temp") }}' - - condition: '{{ is_number(curr_color_temp) }}' - - *delay-default - - service: '{{ nextion.command.text_printf }}' - data: - component: light.temp_value - message: '{{ curr_color_temp | round(0) }}' - continue_on_error: true - - *delay-default - - service: '{{ nextion.command.text_printf }}' - data: - component: light.temp_value_2 - message: '{{ curr_color_temp | round(0) }}' - continue_on_error: true - - *delay-default - - service: '{{ nextion.command.value }}' - data: - component: light.tempslider - message: '{{ curr_color_temp | round(0) }}' - continue_on_error: true + - if: '{{ color_mode_color_temp }}' + then: + - variables: + curr_color_temp: '{{ state_attr(nspanel_event.entity, "color_temp") | int(-1) }}' + min_mireds: '{{ state_attr(nspanel_event.entity, "min_mireds") | int(153) }}' + max_mireds: '{{ state_attr(nspanel_event.entity, "max_mireds") | int(500) }}' + - variables: + curr_color_temp: > + {{ + curr_color_temp + if curr_color_temp >= min_mireds and curr_color_temp <= max_mireds + else ((min_mireds+max_mireds)/2) | int(327) + }} + - condition: '{{ is_number(curr_color_temp) }}' + - *delay-default + - service: '{{ nextion.command.text_printf }}' + data: + component: light.temp_value + message: '{{ curr_color_temp }}' + continue_on_error: true + - *delay-default + - service: '{{ nextion.command.text_printf }}' + data: + component: light.temp_value_2 + message: '{{ curr_color_temp }}' + continue_on_error: true + - *delay-default + - service: '{{ nextion.command.value }}' + data: + component: light.tempslider + message: '{{ curr_color_temp }}' + continue_on_error: true + - *delay-default + - service: '{{ nextion.command.printf }}' + data: + cmd: tempslider.minval={{ min_mireds }} + continue_on_error: true + - *delay-default + - service: '{{ nextion.command.printf }}' + data: + cmd: tempslider.maxval={{ max_mireds }} + continue_on_error: true + - *delay-default + - service: '{{ nextion.command.show }}' + data: + component: temp_button + continue_on_error: true + - *delay-default + - service: '{{ nextion.command.show }}' + data: + component: temp_value_2 + continue_on_error: true + - *delay-default + - service: '{{ nextion.command.show }}' + data: + component: temp_touch + continue_on_error: true + + ##### Hide color button when not supported ##### + - if: '{{ color_mode_color }}' + then: + - *delay-default + - service: '{{ nextion.command.show }}' + data: + component: color_button + continue_on_error: true + - *delay-default + - service: '{{ nextion.command.show }}' + data: + component: color_touch + continue_on_error: true ## PAGE COVER ## - alias: Cover settings page @@ -8180,25 +8261,29 @@ action: }} - if: '{{ (not wait.completed and entity_domain in ["cover", "light"]) or entity_domain == "climate" }}' then: # Long press - - service: '{{ nextion.command.open_entity_settings_page }}' - data: - page: '{{ entity_domain }}' - page_label: '{{ last_click_button.name if last_click_button.name is string and last_click_button.name | length > 0 else state_attr(last_click_button.entity, "friendly_name") }}' - page_icon: > - {{ - all_icons[last_click_button.icon.split(":")[1]] | default(last_click_button.icon if last_click_button.icon is defined and last_click_button.icon is string else nextion.icon.domain[entity_domain]) - if last_click_button.icon not in ["unavailable", "unknown", "", None] and last_click_button.icon | length > 0 - else nextion.icon.domain[entity_domain] - }} - page_icon_color: > - {{ - last_click_button.icon_color_rgb - if is_number(last_click_button.icon_color_rgb) - else ((last_click_button.icon_color_rgb[0] //(2**3)) *(2**11))+((last_click_button.icon_color_rgb[1] //(2**2)) *(2**5))+(last_click_button.icon_color_rgb[2] //(2**3)) - }} - entity: '{{ last_click_button.entity }}' - back_page: '{{ nspanel_event.page }}' - continue_on_error: true + - if: + - '{{ entity_domain != "light" or state_attr(last_click_button.entity, "supported_color_modes") | default("unknown") | string not in ["unknown", "onoff", enum.color_mode.unknown, enum.color_mode.onoff, "", none] }}' + - '{{ entity_domain != "cover" or state_attr(last_click_button.entity, "supported_features") | int(0) | bitwise_and(4) > 0 }}' + then: + - service: '{{ nextion.command.open_entity_settings_page }}' + data: + page: '{{ entity_domain }}' + page_label: '{{ last_click_button.name if last_click_button.name is string and last_click_button.name | length > 0 else state_attr(last_click_button.entity, "friendly_name") }}' + page_icon: > + {{ + all_icons[last_click_button.icon.split(":")[1]] | default(last_click_button.icon if last_click_button.icon is defined and last_click_button.icon is string else nextion.icon.domain[entity_domain]) + if last_click_button.icon not in ["unavailable", "unknown", "", None] and last_click_button.icon | length > 0 + else nextion.icon.domain[entity_domain] + }} + page_icon_color: > + {{ + last_click_button.icon_color_rgb + if is_number(last_click_button.icon_color_rgb) + else ((last_click_button.icon_color_rgb[0] //(2**3)) *(2**11))+((last_click_button.icon_color_rgb[1] //(2**2)) *(2**5))+(last_click_button.icon_color_rgb[2] //(2**3)) + }} + entity: '{{ last_click_button.entity }}' + back_page: '{{ nspanel_event.page }}' + continue_on_error: true else: # Short press - if: '{{ entity_domain not in ["unknown", "person", "binary_sensor", "sensor"] }}' then: @@ -8647,11 +8732,14 @@ action: timeout: !input hold_delay continue_on_timeout: true - if: '{{ not wait.completed }}' - then: # Hold + then: # Hold - Long press - choose: - conditions: - '{{ button_context.hold_select == "Default" and button_context.entity | length > 0 }}' - '{{ button_domain in ["climate", "cover", "light"] }}' + - '{{ button_domain != "light" or state_attr(button_context.entity, "supported_color_modes") | default("unknown") | string not in ["unknown", "onoff", enum.color_mode.unknown, enum.color_mode.onoff, "", none] }}' + - '{{ button_domain != "cover" or state_attr(button_context.entity, "supported_features") | int(0) | bitwise_and(4) > 0 }}' + sequence: - service: '{{ nextion.command.open_entity_settings_page }}' data: diff --git a/nspanel_eu.HMI b/nspanel_eu.HMI index 5735bca..d537852 100644 Binary files a/nspanel_eu.HMI and b/nspanel_eu.HMI differ diff --git a/nspanel_eu.tft b/nspanel_eu.tft index 0fc8d2b..4f7f5ac 100644 Binary files a/nspanel_eu.tft and b/nspanel_eu.tft differ diff --git a/nspanel_eu_code/light.txt b/nspanel_eu_code/light.txt index 062c640..300a31c 100644 --- a/nspanel_eu_code/light.txt +++ b/nspanel_eu_code/light.txt @@ -23,7 +23,6 @@ Page light vis light_b_press,1 vis lightslider,1 vis light_value,1 - vis temp_value_2,1 // #### OFF Button ##### vis temp_b_press,0 vis color_b_pres,0 @@ -33,6 +32,12 @@ Page light // #### OFF Slider ##### vis tempslider,0 vis colorwheel,0 + // #### Hide color & temp buttons ##### + vis temp_touch,0 + vis temp_value_2,0 + vis temp_button,0 + vis color_touch,0 + vis color_button,0 page_label.txt=home.entity.txt Touch Press Event diff --git a/nspanel_us.HMI b/nspanel_us.HMI index 1ca47cd..aede702 100644 Binary files a/nspanel_us.HMI and b/nspanel_us.HMI differ diff --git a/nspanel_us.tft b/nspanel_us.tft index 28e704f..bbe1626 100644 Binary files a/nspanel_us.tft and b/nspanel_us.tft differ diff --git a/nspanel_us_code/light.txt b/nspanel_us_code/light.txt index 062c640..300a31c 100644 --- a/nspanel_us_code/light.txt +++ b/nspanel_us_code/light.txt @@ -23,7 +23,6 @@ Page light vis light_b_press,1 vis lightslider,1 vis light_value,1 - vis temp_value_2,1 // #### OFF Button ##### vis temp_b_press,0 vis color_b_pres,0 @@ -33,6 +32,12 @@ Page light // #### OFF Slider ##### vis tempslider,0 vis colorwheel,0 + // #### Hide color & temp buttons ##### + vis temp_touch,0 + vis temp_value_2,0 + vis temp_button,0 + vis color_touch,0 + vis color_button,0 page_label.txt=home.entity.txt Touch Press Event diff --git a/nspanel_us_land.HMI b/nspanel_us_land.HMI index be0f613..76e369c 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 671bb84..54cc662 100644 Binary files a/nspanel_us_land.tft and b/nspanel_us_land.tft differ diff --git a/nspanel_us_land_code/light.txt b/nspanel_us_land_code/light.txt index 062c640..300a31c 100644 --- a/nspanel_us_land_code/light.txt +++ b/nspanel_us_land_code/light.txt @@ -23,7 +23,6 @@ Page light vis light_b_press,1 vis lightslider,1 vis light_value,1 - vis temp_value_2,1 // #### OFF Button ##### vis temp_b_press,0 vis color_b_pres,0 @@ -33,6 +32,12 @@ Page light // #### OFF Slider ##### vis tempslider,0 vis colorwheel,0 + // #### Hide color & temp buttons ##### + vis temp_touch,0 + vis temp_value_2,0 + vis temp_button,0 + vis color_touch,0 + vis color_button,0 page_label.txt=home.entity.txt Touch Press Event