diff --git a/docs/api.md b/docs/api.md index 0a34cca..81f43e8 100644 --- a/docs/api.md +++ b/docs/api.md @@ -37,9 +37,11 @@ This document provides details on custom services designed for integration with ## Service Documentation ### General Guidance -In general, there's no validation on the content of the parameters in a service call. Please make sure to fulfill the validation from the service caller side, otherwise it can drive to a crash in the ESPHome side, it will most likely restart the panel. +In general, there's no validation on the content of the parameters in a service call. +Please make sure to fulfill the validation from the service caller side, otherwise it can drive to a crash in the ESPHome side, it will most likely restart the panel. -One example is with colors. In almost all cases, it is expected an array with 3 unsigned integers between 0 to 255. If you send anything different, the conversion to the RGB565 used by Nextion will crash. +One example is with colors. In almost all cases, it is expected an array with 3 unsigned integers between 0 to 255. +If you send anything different, the conversion to the RGB565 used by Nextion will crash. ### Table of Contents diff --git a/esphome/nspanel_esphome_core.yaml b/esphome/nspanel_esphome_core.yaml index 7e4a1a5..f0b1d94 100644 --- a/esphome/nspanel_esphome_core.yaml +++ b/esphome/nspanel_esphome_core.yaml @@ -491,6 +491,7 @@ api: embedded_climate: bool embedded_climate_friendly_name: string embedded_indoor_temperature: bool + ent_value_xcen: int mui_please_confirm: string mui_unavailable: string screensaver_time: bool @@ -502,6 +503,7 @@ api: embedded_climate: !lambda "return embedded_climate;" embedded_climate_friendly_name: !lambda "return embedded_climate_friendly_name;" embedded_indoor_temperature: !lambda "return embedded_indoor_temperature;" + ent_value_xcen: !lambda "return ent_value_xcen;" mui_please_confirm: !lambda "return mui_please_confirm;" mui_unavailable: !lambda "return mui_unavailable;" screensaver_time: !lambda "return screensaver_time;" @@ -1223,13 +1225,16 @@ api: value_color: int[] then: - lambda: |- - if (!id(is_uploading_tft)) { - std::string enticon = id.c_str() + std::string("_pic"); - std::string entlabel = id.c_str() + std::string("_label"); - disp1->set_component_text_printf(enticon.c_str(), "%s", icon.c_str()); - if (strcmp(icon.c_str(), "0") != 0) disp1->set_component_text_printf(enticon.c_str(), "%s", icon.c_str()); - disp1->set_component_text_printf(entlabel.c_str(), "%s", name.c_str()); - disp1->set_component_text_printf(id.c_str(), "%s", value.c_str()); + if (!id(is_uploading_tft) and !(id.empty())) { + if (!(icon.empty())) { + disp1->set_component_text_printf("%s_icon", id.c_str(), icon.c_str()); + if (icon_color.size() == 3) set_component_color->execute((id + "_icon").c_str(), icon_color); + } + if (!(name.empty())) disp1->set_component_text_printf("%s_label", id.c_str(), name.c_str()); + if (!(value.empty())) { + disp1->set_component_text_printf("%s", id.c_str(), value.c_str()); + if (value_color.size() == 3) set_component_color->execute(id.c_str(), value_color); + } } # Wake Up Service @@ -1506,6 +1511,11 @@ globals: restore_value: false initial_value: '0' # 0 = unknown, 1 = Arduino, 2 = ESP-IDF + - id: page_entity_value_horizontal_alignment + type: uint8_t + restore_value: false + initial_value: '1' # Horizontal alignment:0-Left;1-Center;2-Right + ##### START - BINARY SENSOR CONFIGURATION ##### binary_sensor: @@ -2475,6 +2485,7 @@ script: embedded_climate: bool embedded_climate_friendly_name: string embedded_indoor_temperature: bool + ent_value_xcen: int mui_please_confirm: string mui_unavailable: string screensaver_time: bool @@ -2507,6 +2518,9 @@ script: id(screensaver_display_time_color) = screensaver_time_color; page_screensaver->execute(); + // Entities pages alignment + id(page_entity_value_horizontal_alignment) = ent_value_xcen; + if (current_page->state != "boot") { // Update current page ESP_LOGV(TAG, "Update current page"); @@ -2809,7 +2823,17 @@ script: mode: restart parameters: page_number: uint - then: # There's nothing here so far + then: + - lambda: |- + if (current_page->state.find("entitypage") == 0) { + // Set value alignment + if (id(page_entity_value_horizontal_alignment) != 1) { + for (int i = 1; i <= 8; ++i) { + disp1->send_command_printf("value%02d.xcen=%" PRIu8, i, id(page_entity_value_horizontal_alignment)); + } + } + } + - id: page_entitypage01 mode: restart then: diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index 4478254..399018c 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -3403,7 +3403,7 @@ variables: global: 'esphome.{{ nspanel_name }}_init_global' page: home: 'esphome.{{ nspanel_name }}_init_page_home' - settings: 'esphome.{{ nspanel_name }}init_page_settings' + settings: 'esphome.{{ nspanel_name }}_init_page_settings' relays: 'esphome.{{ nspanel_name }}_init_relays' notification: clear: 'esphome.{{ nspanel_name }}_notification_clear' @@ -6963,8 +6963,8 @@ action: - &refresh-date service: '{{ nspanel.service.component.text }}' data: - component: home.date - message: > + id: home.date + txt: > {{ as_timestamp(now()) | timestamp_custom @@ -7047,22 +7047,12 @@ action: - service: '{{ nspanel.service.init.page.home }}' data: - date_color: > - {{ - display.date.color_rgb - if is_number(display.date.color_rgb) - else ((display.date.color_rgb[0] //(2**3)) *(2**11))+((display.date.color_rgb[1] //(2**2)) *(2**5))+(display.date.color_rgb[2] //(2**3)) - }} + date_color: '{{ display.date.color_rgb }}' time_format: '{{ display.time.format }}' - time_color: > - {{ - display.time.color_rgb - if is_number(display.time.color_rgb) - else ((display.time.color_rgb[0] //(2**3)) *(2**11))+((display.time.color_rgb[1] //(2**2)) *(2**5))+(display.time.color_rgb[2] //(2**3)) - }} + time_color: '{{ display.time.color_rgb }}' meridiem: '{{ dict.values(mui[language].meridiem) | list }}' - chip_font_size: '{{ chip_font_size }}' - custom_buttons_font_size: '{{ custom_buttons_font_size }}' + chip_font: '{{ chip_font_size }}' + custom_buttons_font: '{{ custom_buttons_font_size }}' notification_icon: > {{ all_icons[bt_notific.icon.split(":")[1]] | default(bt_notific.icon @@ -7095,14 +7085,14 @@ action: ### LABEL Font Color ### - service: '{{ nspanel.service.component.color }}' data: - component: home.left_bt_text - foreground: '{{ [ hardware.buttons.left.color_rgb ] if is_number(hardware.buttons.left.color_rgb) else hardware.buttons.left.color_rgb }}' + id: home.left_bt_text + color: '{{ [ hardware.buttons.left.color_rgb ] if is_number(hardware.buttons.left.color_rgb) else hardware.buttons.left.color_rgb }}' continue_on_error: true ### LABEL Font ### - service: '{{ nspanel.service.component.text }}' data: - component: home.left_bt_text - message: '{{ hardware.buttons.left.name }}' + id: home.left_bt_text + txt: '{{ hardware.buttons.left.name }}' continue_on_error: true ##### NSPanel Right Button Name ##### @@ -7111,17 +7101,17 @@ action: ### LABEL Font Color ### - service: '{{ nspanel.service.component.color }}' data: - component: home.right_bt_text - foreground: '{{ [ hardware.buttons.right.color_rgb ] if is_number(hardware.buttons.right.color_rgb) else hardware.buttons.right.color_rgb }}' + id: home.right_bt_text + color: '{{ [ hardware.buttons.right.color_rgb ] if is_number(hardware.buttons.right.color_rgb) else hardware.buttons.right.color_rgb }}' continue_on_error: true ### LABEL Font ### - service: '{{ nspanel.service.component.text }}' data: - component: home.right_bt_text - message: '{{ hardware.buttons.right.name }}' + id: home.right_bt_text + txt: '{{ hardware.buttons.right.name }}' continue_on_error: true - - service: '{{ nspanel.service.init.page.qrcode }}' + - service: '{{ nspanel.service.qrcode }}' data: title: '{{ bt_qrcode.title }}' qrcode: '{{ bt_qrcode.qrcode }}' @@ -7196,12 +7186,23 @@ action: - variables: climate_friendly_name: '{{ state_attr(climate, "friendly_name") if climate is string and climate is match "climate." else "" }}' + entitypages_value_alignment_temp: !input 'entitypages_value_alignment' + entitypages_value_alignment: > + {{ + entitypages_value_alignment_temp | int + if + is_number(entitypages_value_alignment_temp) and + entitypages_value_alignment_temp | int >= 0 and + entitypages_value_alignment_temp | int <= 2 + else 0 + }} - service: '{{ nspanel.service.init.global }}' data: blueprint_version: '{{ blueprint_version }}' embedded_climate: '{{ climate == thermostat_embedded }}' embedded_climate_friendly_name: '{{ climate_friendly_name if climate_friendly_name else "" }}' embedded_indoor_temperature: '{{ embedded_indoor_temperature }}' + ent_value_xcen: '{{ int(entitypages_value_alignment) if is_number(entitypages_value_alignment) else 1 }}' mui_please_confirm: '{{ mui[language].please_confirm }}' mui_unavailable: '{{ mui[language].unavailable }}' screensaver_time: '{{ screensaver_display_time if screensaver_display_time is boolean else false }}' @@ -7355,14 +7356,14 @@ action: ### LABEL Outdoor Temp Font Color ### - service: '{{ nspanel.service.component.color }}' data: - component: home.outdoor_temp - foreground: '{{ outdoor_temp_color_rgb }}' + id: home.outdoor_temp + color: '{{ outdoor_temp_color_rgb }}' continue_on_error: true ### LABEL Outdoor Temp Font ### - service: '{{ nspanel.service.component.text }}' data: - component: home.outdoor_temp - message: '{{ outdoor_temp | round(1) ~ temperature_units }}' + id: home.outdoor_temp + txt: '{{ outdoor_temp | round(1) ~ temperature_units }}' continue_on_error: true - service: '{{ nspanel.service.command }}' data: @@ -7408,14 +7409,14 @@ action: ### ICON Indoor Temp Font Color ### - service: '{{ nspanel.service.component.color }}' data: - component: home.indoortempicon - foreground: '{{ indoor_temp.icon.color_rgb }}' + id: home.indoortempicon + color: '{{ indoor_temp.icon.color_rgb }}' continue_on_error: true ### ICON Indoor Temp Font ### - service: '{{ nspanel.service.component.text }}' data: - component: home.indoortempicon - message: > + id: home.indoortempicon + txt: > {{ all_icons[indoor_temp.icon.icon.split(":")[1]] | default(all_icons.thermometer) if indoor_temp.icon.icon.split(":") | count > 0 @@ -7430,16 +7431,16 @@ action: ### LABEL Indoor Temp Font Color ### - service: '{{ nspanel.service.component.color }}' data: - component: home.current_temp - foreground: '{{ indoor_temp.label.color_rgb }}' + id: home.current_temp + color: '{{ indoor_temp.label.color_rgb }}' continue_on_error: true - if: '{{ not embedded_indoor_temperature }}' then: ### LABEL Indoor Temp Font ### - service: '{{ nspanel.service.component.text }}' data: - component: home.current_temp - message: '{{ indoor_temp.state | round(1) ~ indoor_temp.units }}' + id: home.current_temp + txt: '{{ indoor_temp.state | round(1) ~ indoor_temp.units }}' continue_on_error: true ##### SET Hardware Buttons PIC on Home Page #### @@ -7511,28 +7512,28 @@ action: then: - service: '{{ nspanel.service.component.color }}' data: - component: 'home.{{ repeat.item.component }}' - foreground: '{{ entity.icon_color }}' + id: 'home.{{ repeat.item.component }}' + color: '{{ entity.icon_color }}' continue_on_error: true - if: '{{ entity.icon is defined }}' then: - service: '{{ nspanel.service.component.text }}' data: - component: 'home.{{ repeat.item.component }}' - message: '{{ entity.icon }}' + id: 'home.{{ repeat.item.component }}' + txt: '{{ entity.icon }}' continue_on_error: true - if: '{{ page.current == page.home }}' then: - service: '{{ nspanel.service.component.show }}' data: - component: '{{ repeat.item.component }}' + id: '{{ repeat.item.component }}' continue_on_error: true else: - if: '{{ page.current == page.home }}' then: - service: '{{ nspanel.service.component.hide }}' data: - component: '{{ repeat.item.component }}' + id: '{{ repeat.item.component }}' continue_on_error: true ###### Climate chip ###### @@ -7556,21 +7557,21 @@ action: ### ICON Font Color ### - service: '{{ nspanel.service.component.color }}' data: - component: home.icon_top_03 - foreground: '{{ entity.icon_color }}' + id: home.icon_top_03 + color: '{{ entity.icon_color }}' continue_on_error: true ### ICON Font ### - service: '{{ nspanel.service.component.text }}' data: - component: home.icon_top_03 - message: '{{ entity.icon }}' + id: home.icon_top_03 + txt: '{{ entity.icon }}' continue_on_error: true else: - &hide-home_page-climate_chip service: '{{ nspanel.service.component.text }}' data: - component: home.icon_top_03 - message: '{{ all_icons.blank }}' + id: home.icon_top_03 + txt: '{{ all_icons.blank }}' continue_on_error: true else: - *hide-home_page-climate_chip @@ -7660,23 +7661,23 @@ action: then: - service: '{{ nspanel.service.component.color }}' data: - component: 'home.{{ repeat.item.component }}' - foreground: '{{ entity.icon_color }}' + id: 'home.{{ repeat.item.component }}' + color: '{{ entity.icon_color }}' continue_on_error: true ### ICON Font ### - if: '{{ entity.icon is defined }}' then: - service: '{{ nspanel.service.component.text }}' data: - component: 'home.{{ repeat.item.component }}' - message: '{{ entity.icon }}' + id: 'home.{{ repeat.item.component }}' + txt: '{{ entity.icon }}' continue_on_error: true else: - &hide-home_page-status_bar_chip service: '{{ nspanel.service.component.text }}' data: - component: 'home.{{ repeat.item.component }}' - message: '{{ all_icons.blank }}' + id: 'home.{{ repeat.item.component }}' + txt: '{{ all_icons.blank }}' continue_on_error: true else: - *hide-home_page-status_bar_chip @@ -7730,20 +7731,20 @@ action: ### ICON Font Color ### - service: '{{ nspanel.service.component.color }}' data: - component: '{{ repeat.item.page }}.{{ repeat.item.component }}_icon' - foreground: '{{ repeat.item.icon_color_rgb }}' + id: '{{ repeat.item.page }}.{{ repeat.item.component }}_icon' + color: '{{ repeat.item.icon_color_rgb }}' continue_on_error: true ### ICON Font ### - service: '{{ nspanel.service.component.text }}' data: - component: '{{ repeat.item.page }}.{{ repeat.item.component }}_icon' - message: '{{ entity.icon }}' + id: '{{ repeat.item.page }}.{{ repeat.item.component }}_icon' + txt: '{{ entity.icon }}' continue_on_error: true ### LABEL Font Color ### - service: '{{ nspanel.service.component.color }}' data: - component: '{{ repeat.item.page }}.{{ repeat.item.component }}{{ "_state" if repeat.item.page == page.home }}' - foreground: '{{ repeat.item.label_color_rgb }}' + id: '{{ repeat.item.page }}.{{ repeat.item.component }}{{ "_state" if repeat.item.page == page.home }}' + color: '{{ repeat.item.label_color_rgb }}' continue_on_error: true ### LABEL Font ### - variables: @@ -7756,8 +7757,8 @@ action: }} - service: '{{ nspanel.service.component.text }}' data: - component: '{{ repeat.item.page }}.{{ repeat.item.component }}{{ "_state" if repeat.item.page == page.home }}' - message: > + id: '{{ repeat.item.page }}.{{ repeat.item.component }}{{ "_state" if repeat.item.page == page.home }}' + txt: > {{ (states(entity_id, rounded=true) ~ unit_of_measurement) if entity_has_value @@ -8031,14 +8032,14 @@ action: then: - service: '{{ nspanel.service.component.text }}' data: - component: page_label - message: '{{ button_pages_labels[button_page_index].label }}' + id: page_label + txt: '{{ button_pages_labels[button_page_index].label }}' continue_on_error: true ###### Confirm buttons ###### - service: '{{ nspanel.service.component.value }}' data: - component: confirm + id: confirm val: '{{ confirm_value }}' continue_on_error: true @@ -8139,18 +8140,18 @@ action: curr_brightness: '{{ (state_attr(light_entity, "brightness") | int(0) * 100 / 255) | round(0) }}' - service: '{{ nspanel.service.component.value }}' data: - component: light.lightslider + id: light.lightslider val: '{{ curr_brightness }}' continue_on_error: true - service: '{{ nspanel.service.component.text }}' data: - component: light.light_value - message: '{{ curr_brightness }}%' + id: light.light_value + txt: '{{ curr_brightness }}%' continue_on_error: true - service: '{{ nspanel.service.component.text }}' data: - component: light.light_value_2 - message: '{{ curr_brightness }}%' + id: light.light_value_2 + txt: '{{ curr_brightness }}%' continue_on_error: true ##### LIGHT Check Color_Temp Value is available when yes send some current Values ##### @@ -8170,17 +8171,17 @@ action: - condition: '{{ is_number(curr_color_temp) }}' - service: '{{ nspanel.service.component.text }}' data: - component: light.temp_value - message: '{{ curr_color_temp }}' + id: light.temp_value + txt: '{{ curr_color_temp }}' continue_on_error: true - service: '{{ nspanel.service.component.text }}' data: - component: light.temp_value_2 - message: '{{ curr_color_temp }}' + id: light.temp_value_2 + txt: '{{ curr_color_temp }}' continue_on_error: true - service: '{{ nspanel.service.component.value }}' data: - component: light.tempslider + id: light.tempslider val: '{{ curr_color_temp }}' continue_on_error: true - service: '{{ nspanel.service.command }}' @@ -8193,15 +8194,15 @@ action: continue_on_error: true - service: '{{ nspanel.service.component.show }}' data: - component: temp_button + id: temp_button continue_on_error: true - service: '{{ nspanel.service.component.show }}' data: - component: temp_value_2 + id: temp_value_2 continue_on_error: true - service: '{{ nspanel.service.component.show }}' data: - component: temp_touch + id: temp_touch continue_on_error: true ##### Hide color button when not supported ##### @@ -8209,11 +8210,11 @@ action: then: - service: '{{ nspanel.service.component.show }}' data: - component: color_button + id: color_button continue_on_error: true - service: '{{ nspanel.service.component.show }}' data: - component: color_touch + id: color_touch continue_on_error: true ## PAGE COVER ## @@ -8254,25 +8255,25 @@ action: ##### Cover Open/close Icons ##### - service: '{{ nspanel.service.component.text }}' data: - component: cover.cover_open - message: '{{ cover_icons.open }}' + id: cover.cover_open + txt: '{{ cover_icons.open }}' continue_on_error: true - service: '{{ nspanel.service.component.text }}' data: - component: cover.cover_close - message: '{{ cover_icons.close }}' + id: cover.cover_close + txt: '{{ cover_icons.close }}' continue_on_error: true ##### COVER State - service: '{{ nspanel.service.component.value }}' data: - component: cover.coverslider + id: cover.coverslider val: '{{ (state_attr(cover_entity, "current_position") | int ) | round(0) }}' continue_on_error: true - service: '{{ nspanel.service.component.text }}' data: - component: cover.cover_value - message: '{{ (state_attr(cover_entity, "current_position") | int ) | round(0) }} %' + id: cover.cover_value + txt: '{{ (state_attr(cover_entity, "current_position") | int ) | round(0) }} %' continue_on_error: true ##### COVER Battery ICON Yes / NO ##### @@ -8318,20 +8319,20 @@ action: {% endif %} - service: '{{ nspanel.service.component.text }}' data: - component: cover.battery_value - message: '{{ battery_level }} %' + id: cover.battery_value + txt: '{{ battery_level }} %' continue_on_error: true ### ICON Battery Font Color ### - service: '{{ nspanel.service.component.color }}' data: - component: cover.battery_icon - foreground: '{{ nextion.color.grey_super_light }}' + id: cover.battery_icon + color: '{{ nextion.color.grey_super_light }}' continue_on_error: true ### ICON Battery Font ### - service: '{{ nspanel.service.component.text }}' data: - component: cover.battery_icon - message: '{{ all_icons[battery_icon] }}' + id: cover.battery_icon + txt: '{{ all_icons[battery_icon] }}' continue_on_error: true ## PAGE FAN ## @@ -8363,7 +8364,7 @@ action: - condition: '{{ fan.steps > 0 and fan.supported_features | bitwise_and(1) > 0 }}' - service: '{{ nspanel.service.component.value }}' data: - component: fanslider + id: fanslider val: '{{ ((fan.percentage / 100) * fan.steps) | round(0) | int(0) }}' continue_on_error: true - service: '{{ nspanel.service.command }}' @@ -8372,23 +8373,23 @@ action: continue_on_error: true - service: '{{ nspanel.service.component.text }}' data: - component: fan_value - message: '{{ fan.percentage }}%' + id: fan_value + txt: '{{ fan.percentage }}%' continue_on_error: true - service: '{{ nspanel.service.component.color }}' data: - component: fan.button_up - foreground: '{{ nextion.color.grey_white if fan.percentage < 100 else nextion.color.grey_dark }}' + id: fan.button_up + color: '{{ nextion.color.grey_white if fan.percentage < 100 else nextion.color.grey_dark }}' continue_on_error: true - service: '{{ nspanel.service.component.color }}' data: - component: fan.button_down - foreground: '{{ nextion.color.grey_white if fan.percentage > 0 else nextion.color.grey_dark }}' + id: fan.button_down + color: '{{ nextion.color.grey_white if fan.percentage > 0 else nextion.color.grey_dark }}' continue_on_error: true - service: '{{ nspanel.service.component.color }}' data: - component: fan.button_off - foreground: '{{ nextion.color.grey_white if fan.percentage > 0 else nextion.color.grey_dark }}' + id: fan.button_off + color: '{{ nextion.color.grey_white if fan.percentage > 0 else nextion.color.grey_dark }}' continue_on_error: true ## PAGE MEDIA PLAYER ## @@ -8550,8 +8551,8 @@ action: - condition: '{{ settings_entity_domain == "climate" }}' - service: '{{ nspanel.service.component.text }}' data: - component: page_label - message: '{{ state_attr(climate_entity, "friendly_name") }}' + id: page_label + txt: '{{ state_attr(climate_entity, "friendly_name") }}' continue_on_error: true ##### Values ##### @@ -8659,8 +8660,8 @@ action: ### ICON Font Color ### - service: '{{ nspanel.service.component.color }}' data: - component: 'climate.{{ repeat.item.component }}' - foreground: > + id: 'climate.{{ repeat.item.component }}' + color: > {{ nextion.color[repeat.item.color] if states(climate_entity) == repeat.item.mode @@ -8670,13 +8671,13 @@ action: ### ICON Font ### - service: '{{ nspanel.service.component.text }}' data: - component: 'climate.{{ repeat.item.component }}' - message: '{{ all_icons[repeat.item.icon] }}' + id: 'climate.{{ repeat.item.component }}' + txt: '{{ all_icons[repeat.item.icon] }}' continue_on_error: true ### Enable button click ### - service: '{{ nspanel.service.component.show }}' data: - component: '{{ repeat.item.component }}' + id: '{{ repeat.item.component }}' continue_on_error: true ##### Climate custom buttons ##### @@ -8708,19 +8709,19 @@ action: ### ICON Font Color ### - service: '{{ nspanel.service.component.color }}' data: - component: '{{ repeat.item.component }}' - foreground: '{{ entity.icon_color }}' + id: '{{ repeat.item.component }}' + color: '{{ entity.icon_color }}' continue_on_error: true ### ICON Font ### - service: '{{ nspanel.service.component.text }}' data: - component: '{{ repeat.item.component }}' - message: '{{ entity.icon }}' + id: '{{ repeat.item.component }}' + txt: '{{ entity.icon }}' continue_on_error: true ### Enable button click ### - service: '{{ nspanel.service.component.show }}' data: - component: '{{ repeat.item.component }}' + id: '{{ repeat.item.component }}' continue_on_error: true ## ENTITY PAGES 01 - 04 ## @@ -8730,16 +8731,6 @@ action: - &variables-entity_pages variables: ##### Entity pages ##### - entitypages_value_alignment_temp: !input 'entitypages_value_alignment' - entitypages_value_alignment: > - {{ - entitypages_value_alignment_temp | int - if - is_number(entitypages_value_alignment_temp) and - entitypages_value_alignment_temp | int >= 0 and - entitypages_value_alignment_temp | int <= 2 - else 0 - }} entity_pages_labels: - label: !input 'entity_page01_label' - label: !input 'entity_page02_label' @@ -8915,8 +8906,8 @@ action: then: - service: '{{ nspanel.service.component.text }}' data: - component: '{{ "entity%02d_label" | format(entity_page_index + 1) }}' - message: '{{ entity_pages_labels[entity_page_index].label }}' + id: '{{ "entity%02d_label" | format(entity_page_index + 1) }}' + txt: '{{ entity_pages_labels[entity_page_index].label }}' continue_on_error: true ##### Entities ##### - repeat: @@ -8932,16 +8923,17 @@ action: - *variable_entity - service: '{{ nspanel.service.value }}' data: - ent_id: '{{ repeat.item.page }}.{{ repeat.item.component }}' - ent_icon: '{{ entity.icon }}' - ent_label: '{{ entity.name }}' - ent_value: > + id: '{{ repeat.item.page }}.{{ repeat.item.component }}' + icon: '{{ entity.icon }}' + icon_color: [] + name: '{{ entity.name }}' + value: > {{ (states(entity_id, rounded=true) ~ (unit_of_measurement if unit_of_measurement and unit_of_measurement is string and unit_of_measurement | length > 0 else "")) if has_value(entity_id) else mui[language].unavailable }} - ent_value_xcen: '{{ entitypages_value_alignment }}' + value_color: [] continue_on_error: true ## PAGE WEATHER (WEATHER01 to WEATHER05) ## @@ -8998,15 +8990,15 @@ action: ##### Display relative day ##### - service: '{{ nspanel.service.component.text }}' data: - component: '{{ page_name }}.day' - message: '{{ (dict.values(mui[language].relative_day) | list)[page_index] }}' + id: '{{ page_name }}.day' + txt: '{{ (dict.values(mui[language].relative_day) | list)[page_index] }}' continue_on_error: true ##### Display date (long) ##### - service: '{{ nspanel.service.component.text }}' data: - component: '{{ page_name }}.date' - message: > + id: '{{ page_name }}.date' + txt: > {{ as_timestamp(now() + timedelta(days= (page_index))) | timestamp_custom @@ -9419,8 +9411,8 @@ action: then: - service: '{{ nspanel.service.component.text }}' data: - component: '{{ page_name }}.temperature' ### Temperature MIN/MAX ### - message: '{{ temperature_string }}' + id: '{{ page_name }}.temperature' ### Temperature MIN/MAX ### + txt: '{{ temperature_string }}' continue_on_error: true ##### fields 1 to 5 (Parameters) ##### @@ -9429,19 +9421,19 @@ action: sequence: - service: '{{ nspanel.service.component.text }}' data: - component: '{{ page_name }}.value0{{ repeat.index }}' - message: '{{ repeat.item.value }}' + id: '{{ page_name }}.value0{{ repeat.index }}' + txt: '{{ repeat.item.value }}' continue_on_error: true - service: '{{ nspanel.service.component.text }}' data: - component: '{{ page_name }}.value0{{ repeat.index }}_icon' - message: '{{ repeat.item.icon }}' + id: '{{ page_name }}.value0{{ repeat.index }}_icon' + txt: '{{ repeat.item.icon }}' continue_on_error: true else: &forecast_unavailable - service: '{{ nspanel.service.component.text }}' data: - component: '{{ page_name }}.value01' - message: '{{ mui[language].unavailable }}' + id: '{{ page_name }}.value01' + txt: '{{ mui[language].unavailable }}' continue_on_error: true else: *forecast_unavailable