diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index 15dfdc0..eb94f88 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -5346,7 +5346,7 @@ variables: buttons: hvac_mode: - mode: auto - icon: calendarsync + icon: calendar-sync color: green component: button01 - mode: heat_cool @@ -5361,17 +5361,17 @@ variables: icon: snowflake color: blue component: button04 - - mode: "off" - icon: power - color: "off" + - mode: dry + icon: water-percent + color: orange component: button05 - mode: fan_only icon: fan color: cyan component: button06 - - mode: dry - icon: waterpercent - color: orange + - mode: "off" + icon: power + color: "off" component: button07 qrcode_enabled: !input 'qrcode_enabled' @@ -6198,7 +6198,8 @@ action: ##### NSPanel boot init finished and jump to Home Page##### - *delay-default - - service: '{{ nextion.commands.printf }}' + - &jump_page_home + service: '{{ nextion.commands.printf }}' data: cmd: "page {{ pages.home }}" continue_on_error: true @@ -7405,7 +7406,7 @@ action: } {% else %}{{ settings_entity_dict }} {% endif %} - climate_entity: '{{ settings_entity_dict.entity }}' + climate_entity: '{{ settings_entity_dict.entity if settings_entity_dict.entity is defined }}' settings_entity_domain: > {{ climate_entity.split(".")[0] @@ -7417,110 +7418,110 @@ action: }} hvac_modes: '{{ state_attr(climate_entity, "hvac_modes") if settings_entity_domain == "climate" }}' - ##### Page title ##### - - service: '{{ nextion.commands.text_printf }}' - data: - component: climate.climate_label - message: '{{ settings_entity_dict.name }}' - continue_on_error: true + - if: '{{ settings_entity_domain == "climate" }}' + then: + ##### Page title ##### + - service: '{{ nextion.commands.text_printf }}' + data: + component: climate.climate_label + message: '{{ settings_entity_dict.name }}' + continue_on_error: true - ##### Values ##### - - &variables-climate_page - variables: - climate_page_entities: - - entity: !input 'climate_value01' - icon: !input 'climate_value01_icon' - icon_color_rgb: !input 'climate_value01_icon_color' - label_color_rgb: !input 'climate_value01_label_color' - page: climate - component: value01 - - entity: !input 'climate_value02' - icon: !input 'climate_value02_icon' - icon_color_rgb: !input 'climate_value02_icon_color' - label_color_rgb: !input 'climate_value02_label_color' - page: climate - component: value02 - - entity: !input 'climate_value03' - icon: !input 'climate_value03_icon' - icon_color_rgb: !input 'climate_value03_icon_color' - label_color_rgb: !input 'climate_value03_label_color' - page: climate - component: value03 - - entity: !input 'climate_value04' - icon: !input 'climate_value04_icon' - icon_color_rgb: !input 'climate_value04_icon_color' - label_color_rgb: !input 'climate_value04_label_color' - page: climate - component: value04 - - repeat: - for_each: '{{ climate_page_entities }}' - sequence: *display_value + ##### Values ##### + - &variables-climate_page + variables: + climate_page_entities: + - entity: !input 'climate_value01' + icon: !input 'climate_value01_icon' + icon_color_rgb: !input 'climate_value01_icon_color' + label_color_rgb: !input 'climate_value01_label_color' + page: climate + component: value01 + - entity: !input 'climate_value02' + icon: !input 'climate_value02_icon' + icon_color_rgb: !input 'climate_value02_icon_color' + label_color_rgb: !input 'climate_value02_label_color' + page: climate + component: value02 + - entity: !input 'climate_value03' + icon: !input 'climate_value03_icon' + icon_color_rgb: !input 'climate_value03_icon_color' + label_color_rgb: !input 'climate_value03_label_color' + page: climate + component: value03 + - entity: !input 'climate_value04' + icon: !input 'climate_value04_icon' + icon_color_rgb: !input 'climate_value04_icon_color' + label_color_rgb: !input 'climate_value04_label_color' + page: climate + component: value04 + - repeat: + for_each: '{{ climate_page_entities }}' + sequence: *display_value - - condition: '{{ settings_entity_domain == "climate" }}' + ##### Slider ##### + - *delay-default + - service: '{{ nextion.commands.set_climate }}' + data: + state: '{{ states(climate_entity) }}' + hvac_modes: '{{ state_attr(climate_entity, "hvac_modes") }}' + current_temp: '{{ state_attr(climate_entity, "current_temperature") | float(default=-999) | round(1) }}' + target_temp: '{{ state_attr(climate_entity, "temperature") | float(default=-999) * 10 }}' + min_temp: '{{ (state_attr(climate_entity, "min_temp") | round(0, default=5) * 10) | int }}' + max_temp: '{{ (state_attr(climate_entity, "max_temp") | round(0, default=25) * 10) | int }}' + continue_on_error: true - ##### Slider ##### - - *delay-default - - service: '{{ nextion.commands.set_climate }}' - data: - state: '{{ states(climate_entity) }}' - hvac_modes: '{{ state_attr(climate_entity, "hvac_modes") }}' - current_temp: '{{ state_attr(climate_entity, "current_temperature") | float(default=-999) | round(1) }}' - target_temp: '{{ state_attr(climate_entity, "temperature") | float(default=-999) * 10 }}' - min_temp: '{{ (state_attr(climate_entity, "min_temp") | round(0, default=5) * 10) | int }}' - max_temp: '{{ (state_attr(climate_entity, "max_temp") | round(0, default=25) * 10) | int }}' - continue_on_error: true - - ##### Buttons ##### - - repeat: - for_each: '{{ page_climate.buttons.hvac_mode }}' - sequence: &update_climate_button - - if: > - {{ - repeat.item.mode in hvac_modes - }} - then: - - *delay-default - ### ICON Font Color ### - - service: '{{ nextion.commands.font_color }}' - data: - component: 'climate.{{ repeat.item.component }}_icon' - message: > - {{ - nextion.colors[repeat.item.color] - if states(climate_entity) == repeat.item.mode - else nextion.colors.disabled - }} - continue_on_error: true - ### ICON Font ### - - *delay-default - - service: '{{ nextion.commands.text_printf }}' - data: - component: 'climate.{{ repeat.item.component }}_icon' - message: '{{ all_icons[repeat.item.icon] }}' - continue_on_error: true - ### Show button ### - - *delay-default - - service: '{{ nextion.commands.show }}' - data: - component: '{{ repeat.item.component }}_icon' - continue_on_error: true - - *delay-default - - service: '{{ nextion.commands.show }}' - data: - component: '{{ repeat.item.component }}' - continue_on_error: true - else: - ### Hide button ### - - *delay-default - - service: '{{ nextion.commands.hide }}' - data: - component: '{{ repeat.item.component }}' - continue_on_error: true - - *delay-default - - service: '{{ nextion.commands.hide }}' - data: - component: '{{ repeat.item.component }}_icon' - continue_on_error: true + ##### Buttons ##### + - repeat: + for_each: '{{ page_climate.buttons.hvac_mode }}' + sequence: &update_climate_button + - if: '{{ repeat.item.mode in hvac_modes }}' + then: + - *delay-default + ### ICON Font Color ### + - service: '{{ nextion.commands.font_color }}' + data: + component: 'climate.{{ repeat.item.component }}_icon' + message: > + {{ + nextion.colors[repeat.item.color] + if states(climate_entity) == repeat.item.mode + else nextion.colors.disabled + }} + continue_on_error: true + ### ICON Font ### + - *delay-default + - service: '{{ nextion.commands.text_printf }}' + data: + component: 'climate.{{ repeat.item.component }}_icon' + message: '{{ all_icons[repeat.item.icon] }}' + continue_on_error: true + ### Show button ### + - *delay-default + - service: '{{ nextion.commands.show }}' + data: + component: '{{ repeat.item.component }}_icon' + continue_on_error: true + - *delay-default + - service: '{{ nextion.commands.show }}' + data: + component: '{{ repeat.item.component }}' + continue_on_error: true + else: + ### Hide button ### + - *delay-default + - service: '{{ nextion.commands.hide }}' + data: + component: '{{ repeat.item.component }}' + continue_on_error: true + - *delay-default + - service: '{{ nextion.commands.hide }}' + data: + component: '{{ repeat.item.component }}_icon' + continue_on_error: true + else: + ##### Return to Home page in case is not a climate entity ##### + - *jump_page_home ## ENTITY PAGES 01 - 04 ## - alias: Entity pages @@ -8800,12 +8801,7 @@ action: - "{{ trigger.event.data.old_state.state == 'on' }}" - "{{ trigger.event.data.new_state.state == 'off' }}" sequence: - - *delay-default - - service: "{{ nextion.commands.printf }}" - data: - cmd: "page {{ pages.home }}" - continue_on_error: true - + - *jump_page_home ############################################################# ##### CLOSE - Action ##### diff --git a/nspanel_eu.HMI b/nspanel_eu.HMI index 601fcd2..68b7bc6 100644 Binary files a/nspanel_eu.HMI and b/nspanel_eu.HMI differ diff --git a/nspanel_eu.tft b/nspanel_eu.tft index 7d38c43..24d2d21 100644 Binary files a/nspanel_eu.tft and b/nspanel_eu.tft differ diff --git a/nspanel_eu_code/climate.txt b/nspanel_eu_code/climate.txt index 2c720bc..2bd2c83 100644 --- a/nspanel_eu_code/climate.txt +++ b/nspanel_eu_code/climate.txt @@ -494,7 +494,7 @@ Hotspot button07 Events Touch Release Event - lastclick.txt="{\"page\": \"climate\", \"component\": \"button01\", \"value\": \"release\"}" + lastclick.txt="{\"page\": \"climate\", \"component\": \"button07\", \"value\": \"release\"}" printh 92 prints "nspanelevent",0 printh 00