diff --git a/esphome/nspanel_esphome_core.yaml b/esphome/nspanel_esphome_core.yaml index bc4fa72..d5d99bc 100644 --- a/esphome/nspanel_esphome_core.yaml +++ b/esphome/nspanel_esphome_core.yaml @@ -18,7 +18,7 @@ substitutions: friendly_name: ${device_name} wifi_timeout: '15' ##### DON'T CHANGE THIS ###### - version: "4.3" + version: "4.3dev" ############################## ##### External components ##### @@ -31,11 +31,6 @@ external_components: - nextion # Change this when that PR#6192 gets released (2024.3?) refresh: 300s -##### Use ESP-IDF as default ##### -esp32: - framework: - type: esp-idf - ##### ESPHOME CONFIGURATION ##### esphome: name: ${name} @@ -89,9 +84,10 @@ esphome: then: - switch.turn_off: screen_power -##### TYPE OF ESP BOARD ##### esp32: board: esp32dev + framework: + type: esp-idf ##### WIFI SETUP ##### wifi: @@ -174,6 +170,22 @@ api: - script.execute: watchdog services: + ##### Updates an entity ##### + - service: entity + variables: + id: string + icon: string + icon_color: int[] + name: string + color: int[] + value: string + value_color: int[] + then: + - lambda: |- + if (!id(is_uploading_tft)) { + // Do something + } + ##### Service to send a command "printf" directly to the display ##### - service: send_command_printf variables: diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index cf9979f..a9ac13e 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -3400,6 +3400,34 @@ variables: nspanel_name: '{{ states(device_name_sensor) if device_name_sensor is defined and device_name_sensor is string }}' + nspanel: + service: + init: + global: 'esphome.{{ nspanel_name }}_global_settings' + page: + home: 'esphome.{{ nspanel_name }}_page_home' + settings: 'esphome.{{ nspanel_name }}_page_settings' + qrcode: 'esphome.{{ nspanel_name }}_qrcode' + relays: 'esphome.{{ nspanel_name }}_relay_settings' + command: 'esphome.{{ nspanel_name }}_send_command_printf' + page: + alarm: 'esphome.{{ nspanel_name }}_alarm_settings' + button: 'esphome.{{ nspanel_name }}_set_button' + entities: 'esphome.{{ nspanel_name }}_set_entity' + media_player: 'esphome.{{ nspanel_name }}_media_player' + climate: 'esphome.{{ nspanel_name }}_set_climate' + detailed_entity: 'esphome.{{ nspanel_name }}_open_entity_settings_page' + component: + show: 'esphome.{{ nspanel_name }}_send_command_show' + hide: 'esphome.{{ nspanel_name }}_send_command_hide' + text: 'esphome.{{ nspanel_name }}_send_command_text_printf' + color: 'esphome.{{ nspanel_name }}_set_component_color' + value: 'esphome.{{ nspanel_name }}_send_command_value' + wake_up: 'esphome.{{ nspanel_name }}_wake_up' + tft_upload: 'esphome.{{ nspanel_name }}_upload_tft_url' + notification: + clear: 'esphome.{{ nspanel_name }}_notification_clear' + ##### Nextion dict #### nextion: color: @@ -3422,27 +3450,6 @@ variables: disabled: [189, 189, 189] unknown: [3, 6, 3] unavailable: [3, 6, 3] - command: - alarm_settings: 'esphome.{{ nspanel_name }}_alarm_settings' - global_settings: 'esphome.{{ nspanel_name }}_global_settings' - hide: 'esphome.{{ nspanel_name }}_send_command_hide' - media_player: 'esphome.{{ nspanel_name }}_media_player' - notification_clear: 'esphome.{{ nspanel_name }}_notification_clear' - open_entity_settings_page: 'esphome.{{ nspanel_name }}_open_entity_settings_page' - page_home: 'esphome.{{ nspanel_name }}_page_home' - page_settings: 'esphome.{{ nspanel_name }}_page_settings' - printf: 'esphome.{{ nspanel_name }}_send_command_printf' - qrcode: 'esphome.{{ nspanel_name }}_qrcode' - relay_settings: 'esphome.{{ nspanel_name }}_relay_settings' - set_button: 'esphome.{{ nspanel_name }}_set_button' - set_climate: 'esphome.{{ nspanel_name }}_set_climate' - set_component_color: 'esphome.{{ nspanel_name }}_set_component_color' - set_entity: 'esphome.{{ nspanel_name }}_set_entity' - show: 'esphome.{{ nspanel_name }}_send_command_show' - text_printf: 'esphome.{{ nspanel_name }}_send_command_text_printf' - tft_upload_url: 'esphome.{{ nspanel_name }}_upload_tft_url' - value: 'esphome.{{ nspanel_name }}_send_command_value' - wake_up: 'esphome.{{ nspanel_name }}_wake_up' icon: domain: air_quality: "\uED42" # mdi:air-filter @@ -6969,7 +6976,7 @@ action: sequence: ##### NSPanel Date ##### - &refresh-date - service: '{{ nextion.command.text_printf }}' + service: '{{ nspanel.service.component.text }}' data: component: home.date message: > @@ -7053,7 +7060,7 @@ action: screensaver_display_time: !input screensaver_display_time screensaver_display_time_font_color: !input screensaver_display_time_font_color - - service: '{{ nextion.command.page_home }}' + - service: '{{ nspanel.service.init.page.home }}' data: date_color: > {{ @@ -7104,14 +7111,14 @@ action: - if: '{{ hardware.buttons.left.name | length > 0 }}' then: ### LABEL Font Color ### - - service: '{{ nextion.command.set_component_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 }}' continue_on_error: true - *delay-default ### LABEL Font ### - - service: '{{ nextion.command.text_printf }}' + - service: '{{ nspanel.service.component.text }}' data: component: home.left_bt_text message: '{{ hardware.buttons.left.name }}' @@ -7122,21 +7129,21 @@ action: - if: '{{ hardware.buttons.right.name | length > 0 }}' then: ### LABEL Font Color ### - - service: '{{ nextion.command.set_component_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 }}' continue_on_error: true - *delay-default ### LABEL Font ### - - service: '{{ nextion.command.text_printf }}' + - service: '{{ nspanel.service.component.text }}' data: component: home.right_bt_text message: '{{ hardware.buttons.right.name }}' continue_on_error: true - *delay-default - - service: '{{ nextion.command.qrcode }}' + - service: '{{ nspanel.service.init.page.qrcode }}' data: title: '{{ bt_qrcode.title }}' qrcode: '{{ bt_qrcode.qrcode }}' @@ -7144,7 +7151,7 @@ action: continue_on_error: true - *delay-default - - service: '{{ nextion.command.page_settings}}' + - service: '{{ nspanel.service.init.page.settings}}' data: reboot: '{{ mui[language].settings.reboot }}' brightness: '{{ mui[language].settings.brightness }}' @@ -7153,7 +7160,7 @@ action: continue_on_error: true - *delay-default - - service: '{{ nextion.command.relay_settings }}' + - service: '{{ nspanel.service.init.relays }}' data: relay1_local_control: '{{ hardware.buttons.left.entity == relay01_entity }}' relay1_icon: > @@ -7214,7 +7221,7 @@ action: - variables: climate_friendly_name: '{{ state_attr(climate, "friendly_name") if climate is string and climate is match "climate." else "" }}' - - service: '{{ nextion.command.global_settings }}' + - service: '{{ nspanel.service.init.global }}' data: blueprint_version: '{{ blueprint_version }}' embedded_climate: '{{ climate == thermostat_embedded }}' @@ -7347,7 +7354,7 @@ action: ##### Weather Icon Home Page ##### - *delay-default - &refresh-page_home-weather_pic - service: '{{ nextion.command.printf }}' + service: '{{ nspanel.service.command }}' data: cmd: home.weather.pic={{ nextion.pic.weather[ states(weather_entity) | default("unavailable") @@ -7380,20 +7387,20 @@ action: home_outdoor_temp_font: !input 'home_outdoor_temp_font' ### LABEL Outdoor Temp Font Color ### - *delay-default - - service: '{{ nextion.command.set_component_color }}' + - service: '{{ nspanel.service.component.color }}' data: component: home.outdoor_temp foreground: '{{ outdoor_temp_color_rgb }}' continue_on_error: true ### LABEL Outdoor Temp Font ### - *delay-default - - service: '{{ nextion.command.text_printf }}' + - service: '{{ nspanel.service.component.text }}' data: component: home.outdoor_temp message: '{{ outdoor_temp | round(1) ~ temperature_units }}' continue_on_error: true - *delay-default - - service: '{{ nextion.command.printf }}' + - service: '{{ nspanel.service.command }}' data: cmd: 'home.outdoor_temp.font={{ home_outdoor_temp_font if is_number(home_outdoor_temp_font) else "4" }}' continue_on_error: true @@ -7436,14 +7443,14 @@ action: then: ### ICON Indoor Temp Font Color ### - *delay-default - - service: '{{ nextion.command.set_component_color }}' + - service: '{{ nspanel.service.component.color }}' data: component: home.indoortempicon foreground: '{{ indoor_temp.icon.color_rgb }}' continue_on_error: true ### ICON Indoor Temp Font ### - *delay-default - - service: '{{ nextion.command.text_printf }}' + - service: '{{ nspanel.service.component.text }}' data: component: home.indoortempicon message: > @@ -7460,7 +7467,7 @@ action: continue_on_error: true ### LABEL Indoor Temp Font Color ### - *delay-default - - service: '{{ nextion.command.set_component_color }}' + - service: '{{ nspanel.service.component.color }}' data: component: home.current_temp foreground: '{{ indoor_temp.label.color_rgb }}' @@ -7469,7 +7476,7 @@ action: then: ### LABEL Indoor Temp Font ### - *delay-default - - service: '{{ nextion.command.text_printf }}' + - service: '{{ nspanel.service.component.text }}' data: component: home.current_temp message: '{{ indoor_temp.state | round(1) ~ indoor_temp.units }}' @@ -7486,14 +7493,14 @@ action: - if: '{{ left_button_state and left_button_state not in enum.states.unknown }}' then: - *delay-default - - service: '{{ nextion.command.printf }}' + - service: '{{ nspanel.service.command }}' data: cmd: home.left_bt_pic.val={{ 1 if left_button_state in enum.states.on else 0 }} continue_on_error: true - if: '{{ right_button_state and right_button_state not in enum.states.unknown }}' then: - *delay-default - - service: '{{ nextion.command.printf }}' + - service: '{{ nspanel.service.command }}' data: cmd: home.right_bt_pic.val={{ 1 if right_button_state in enum.states.on else 0 }} continue_on_error: true @@ -7544,7 +7551,7 @@ action: - *variable_entity - if: '{{ entity.icon_color is defined }}' then: - - service: '{{ nextion.command.set_component_color }}' + - service: '{{ nspanel.service.component.color }}' data: component: 'home.{{ repeat.item.component }}' foreground: '{{ entity.icon_color }}' @@ -7552,7 +7559,7 @@ action: - *delay-default - if: '{{ entity.icon is defined }}' then: - - service: '{{ nextion.command.text_printf }}' + - service: '{{ nspanel.service.component.text }}' data: component: 'home.{{ repeat.item.component }}' message: '{{ entity.icon }}' @@ -7560,14 +7567,14 @@ action: - if: '{{ page.current == page.home }}' then: - *delay-default - - service: '{{ nextion.command.show }}' + - service: '{{ nspanel.service.component.show }}' data: component: '{{ repeat.item.component }}' continue_on_error: true else: - if: '{{ page.current == page.home }}' then: - - service: '{{ nextion.command.hide }}' + - service: '{{ nspanel.service.component.hide }}' data: component: '{{ repeat.item.component }}' continue_on_error: true @@ -7592,21 +7599,21 @@ action: then: ### ICON Font Color ### - *delay-default - - service: '{{ nextion.command.set_component_color }}' + - service: '{{ nspanel.service.component.color }}' data: component: home.icon_top_03 foreground: '{{ entity.icon_color }}' continue_on_error: true ### ICON Font ### - *delay-default - - service: '{{ nextion.command.text_printf }}' + - service: '{{ nspanel.service.component.text }}' data: component: home.icon_top_03 message: '{{ entity.icon }}' continue_on_error: true else: - &hide-home_page-climate_chip - service: '{{ nextion.command.text_printf }}' + service: '{{ nspanel.service.component.text }}' data: component: home.icon_top_03 message: '{{ all_icons.blank }}' @@ -7698,7 +7705,7 @@ action: - if: '{{ entity.icon_color is defined }}' then: - *delay-default - - service: '{{ nextion.command.set_component_color }}' + - service: '{{ nspanel.service.component.color }}' data: component: 'home.{{ repeat.item.component }}' foreground: '{{ entity.icon_color }}' @@ -7707,14 +7714,14 @@ action: - if: '{{ entity.icon is defined }}' then: - *delay-default - - service: '{{ nextion.command.text_printf }}' + - service: '{{ nspanel.service.component.text }}' data: component: 'home.{{ repeat.item.component }}' message: '{{ entity.icon }}' continue_on_error: true else: - &hide-home_page-status_bar_chip - service: '{{ nextion.command.text_printf }}' + service: '{{ nspanel.service.component.text }}' data: component: 'home.{{ repeat.item.component }}' message: '{{ all_icons.blank }}' @@ -7771,21 +7778,21 @@ action: then: ### ICON Font Color ### - *delay-default - - service: '{{ nextion.command.set_component_color }}' + - service: '{{ nspanel.service.component.color }}' data: component: '{{ repeat.item.page }}.{{ repeat.item.component }}_icon' foreground: '{{ repeat.item.icon_color_rgb }}' continue_on_error: true ### ICON Font ### - *delay-default - - service: '{{ nextion.command.text_printf }}' + - service: '{{ nspanel.service.component.text }}' data: component: '{{ repeat.item.page }}.{{ repeat.item.component }}_icon' message: '{{ entity.icon }}' continue_on_error: true ### LABEL Font Color ### - *delay-default - - service: '{{ nextion.command.set_component_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 }}' @@ -7800,7 +7807,7 @@ action: else "" }} - *delay-default - - service: '{{ nextion.command.text_printf }}' + - service: '{{ nspanel.service.component.text }}' data: component: '{{ repeat.item.page }}.{{ repeat.item.component }}{{ "_state" if repeat.item.page == page.home }}' message: > @@ -8075,7 +8082,7 @@ action: ##### Button page Label ##### - if: '{{ button_pages_labels[button_page_index].label | length > 0 }}' then: - - service: '{{ nextion.command.text_printf }}' + - service: '{{ nspanel.service.component.text }}' data: component: page_label message: '{{ button_pages_labels[button_page_index].label }}' @@ -8083,7 +8090,7 @@ action: ###### Confirm buttons ###### - *delay-default - - service: '{{ nextion.command.value }}' + - service: '{{ nspanel.service.component.value }}' data: component: confirm val: '{{ confirm_value }}' @@ -8132,7 +8139,7 @@ action: {% else %} 0 {% endif %} - *delay-default - - service: '{{ nextion.command.set_button }}' + - service: '{{ nspanel.service.page.button }}' data: page: '{{ repeat.item.page }}' id: '{{ repeat.item.component }}' @@ -8149,7 +8156,7 @@ action: then: - delay: milliseconds: 800 - - service: '{{ nextion.command.set_button }}' + - service: '{{ nspanel.service.page.button }}' data: page: '{{ repeat.item.page }}' id: '{{ repeat.item.component }}' @@ -8186,19 +8193,19 @@ action: - variables: curr_brightness: '{{ (state_attr(light_entity, "brightness") | int(0) * 100 / 255) | round(0) }}' - *delay-default - - service: '{{ nextion.command.value }}' + - service: '{{ nspanel.service.component.value }}' data: component: light.lightslider val: '{{ curr_brightness }}' continue_on_error: true - *delay-default - - service: '{{ nextion.command.text_printf }}' + - service: '{{ nspanel.service.component.text }}' data: component: light.light_value message: '{{ curr_brightness }}%' continue_on_error: true - *delay-default - - service: '{{ nextion.command.text_printf }}' + - service: '{{ nspanel.service.component.text }}' data: component: light.light_value_2 message: '{{ curr_brightness }}%' @@ -8220,45 +8227,45 @@ action: }} - condition: '{{ is_number(curr_color_temp) }}' - *delay-default - - service: '{{ nextion.command.text_printf }}' + - service: '{{ nspanel.service.component.text }}' data: component: light.temp_value message: '{{ curr_color_temp }}' continue_on_error: true - *delay-default - - service: '{{ nextion.command.text_printf }}' + - service: '{{ nspanel.service.component.text }}' data: component: light.temp_value_2 message: '{{ curr_color_temp }}' continue_on_error: true - *delay-default - - service: '{{ nextion.command.value }}' + - service: '{{ nspanel.service.component.value }}' data: component: light.tempslider val: '{{ curr_color_temp }}' continue_on_error: true - *delay-default - - service: '{{ nextion.command.printf }}' + - service: '{{ nspanel.service.command }}' data: cmd: tempslider.minval={{ min_mireds }} continue_on_error: true - *delay-default - - service: '{{ nextion.command.printf }}' + - service: '{{ nspanel.service.command }}' data: cmd: tempslider.maxval={{ max_mireds }} continue_on_error: true - *delay-default - - service: '{{ nextion.command.show }}' + - service: '{{ nspanel.service.component.show }}' data: component: temp_button continue_on_error: true - *delay-default - - service: '{{ nextion.command.show }}' + - service: '{{ nspanel.service.component.show }}' data: component: temp_value_2 continue_on_error: true - *delay-default - - service: '{{ nextion.command.show }}' + - service: '{{ nspanel.service.component.show }}' data: component: temp_touch continue_on_error: true @@ -8267,12 +8274,12 @@ action: - if: '{{ color_mode_color }}' then: - *delay-default - - service: '{{ nextion.command.show }}' + - service: '{{ nspanel.service.component.show }}' data: component: color_button continue_on_error: true - *delay-default - - service: '{{ nextion.command.show }}' + - service: '{{ nspanel.service.component.show }}' data: component: color_touch continue_on_error: true @@ -8313,13 +8320,13 @@ action: else all_icons[device_class_icons.cover["shutter-closed"]] }} ##### Cover Open/close Icons ##### - - service: '{{ nextion.command.text_printf }}' + - service: '{{ nspanel.service.component.text }}' data: component: cover.cover_open message: '{{ cover_icons.open }}' continue_on_error: true - *delay-default - - service: '{{ nextion.command.text_printf }}' + - service: '{{ nspanel.service.component.text }}' data: component: cover.cover_close message: '{{ cover_icons.close }}' @@ -8327,13 +8334,13 @@ action: - *delay-default ##### COVER State - - service: '{{ nextion.command.value }}' + - service: '{{ nspanel.service.component.value }}' data: component: cover.coverslider val: '{{ (state_attr(cover_entity, "current_position") | int ) | round(0) }}' continue_on_error: true - *delay-default - - service: '{{ nextion.command.text_printf }}' + - service: '{{ nspanel.service.component.text }}' data: component: cover.cover_value message: '{{ (state_attr(cover_entity, "current_position") | int ) | round(0) }} %' @@ -8381,21 +8388,21 @@ action: battery-outline {% endif %} - *delay-default - - service: '{{ nextion.command.text_printf }}' + - service: '{{ nspanel.service.component.text }}' data: component: cover.battery_value message: '{{ battery_level }} %' continue_on_error: true ### ICON Battery Font Color ### - *delay-default - - service: '{{ nextion.command.set_component_color }}' + - service: '{{ nspanel.service.component.color }}' data: component: cover.battery_icon foreground: '{{ nextion.color.grey_super_light }}' continue_on_error: true ### ICON Battery Font ### - *delay-default - - service: '{{ nextion.command.text_printf }}' + - service: '{{ nspanel.service.component.text }}' data: component: cover.battery_icon message: '{{ all_icons[battery_icon] }}' @@ -8428,36 +8435,36 @@ action: else 0 }} - condition: '{{ fan.steps > 0 and fan.supported_features | bitwise_and(1) > 0 }}' - - service: '{{ nextion.command.value }}' + - service: '{{ nspanel.service.component.value }}' data: component: fanslider val: '{{ ((fan.percentage / 100) * fan.steps) | round(0) | int(0) }}' continue_on_error: true - *delay-default - - service: '{{ nextion.command.printf }}' + - service: '{{ nspanel.service.command }}' data: cmd: fanslider.maxval={{ fan.steps }} continue_on_error: true - *delay-default - - service: '{{ nextion.command.text_printf }}' + - service: '{{ nspanel.service.component.text }}' data: component: fan_value message: '{{ fan.percentage }}%' continue_on_error: true - *delay-default - - service: '{{ nextion.command.set_component_color }}' + - service: '{{ nspanel.service.component.color }}' data: component: fan.button_up foreground: '{{ nextion.color.grey_white if fan.percentage < 100 else nextion.color.grey_dark }}' continue_on_error: true - *delay-default - - service: '{{ nextion.command.set_component_color }}' + - service: '{{ nspanel.service.component.color }}' data: component: fan.button_down foreground: '{{ nextion.color.grey_white if fan.percentage > 0 else nextion.color.grey_dark }}' continue_on_error: true - *delay-default - - service: '{{ nextion.command.set_component_color }}' + - service: '{{ nspanel.service.component.color }}' data: component: fan.button_off foreground: '{{ nextion.color.grey_white if fan.percentage > 0 else nextion.color.grey_dark }}' @@ -8501,7 +8508,7 @@ action: if (state_attr(media_player_entity, "mass_player_type") | default("")) == "group" else state_attr(media_player_entity, "supported_features") | int(0) }} - - service: '{{ nextion.command.media_player }}' + - service: '{{ nspanel.service.page.media_player }}' data: entity: '{{ media_player_entity }}' state: '{{ media_player.state if media_player.state is string else "" }}' @@ -8580,7 +8587,7 @@ action: alarm: code_format: '{{ state_attr(entity_id, "code_format") }}' code_arm_required: '{{ state_attr(entity_id, "code_arm_required") | default(true) }}' - - service: '{{ nextion.command.alarm_settings }}' + - service: '{{ nspanel.service.page.alarm }}' data: page_title: '{{ entity.name }}' state: '{{ entity_state }}' @@ -8620,7 +8627,7 @@ action: }} hvac_modes: '{{ state_attr(climate_entity, "hvac_modes") if settings_entity_domain == "climate" }}' - condition: '{{ settings_entity_domain == "climate" }}' - - service: '{{ nextion.command.text_printf }}' + - service: '{{ nspanel.service.component.text }}' data: component: page_label message: '{{ state_attr(climate_entity, "friendly_name") }}' @@ -8706,7 +8713,7 @@ action: {% else %}{{ all_icons.blank }} {% endif %} - *delay-default - - service: '{{ nextion.command.set_climate }}' + - service: '{{ nspanel.service.page.climate }}' data: current_temp: '{{ current_temp }}' supported_features: '{{ supported_features }}' @@ -8731,7 +8738,7 @@ action: - condition: '{{ repeat.item.mode in hvac_modes }}' - *delay-default ### ICON Font Color ### - - service: '{{ nextion.command.set_component_color }}' + - service: '{{ nspanel.service.component.color }}' data: component: 'climate.{{ repeat.item.component }}' foreground: > @@ -8743,14 +8750,14 @@ action: continue_on_error: true ### ICON Font ### - *delay-default - - service: '{{ nextion.command.text_printf }}' + - service: '{{ nspanel.service.component.text }}' data: component: 'climate.{{ repeat.item.component }}' message: '{{ all_icons[repeat.item.icon] }}' continue_on_error: true ### Enable button click ### - *delay-default - - service: '{{ nextion.command.show }}' + - service: '{{ nspanel.service.component.show }}' data: component: '{{ repeat.item.component }}' continue_on_error: true @@ -8783,21 +8790,21 @@ action: - *variable_entity ### ICON Font Color ### - *delay-default - - service: '{{ nextion.command.set_component_color }}' + - service: '{{ nspanel.service.component.color }}' data: component: '{{ repeat.item.component }}' foreground: '{{ entity.icon_color }}' continue_on_error: true ### ICON Font ### - *delay-default - - service: '{{ nextion.command.text_printf }}' + - service: '{{ nspanel.service.component.text }}' data: component: '{{ repeat.item.component }}' message: '{{ entity.icon }}' continue_on_error: true ### Enable button click ### - *delay-default - - service: '{{ nextion.command.show }}' + - service: '{{ nspanel.service.component.show }}' data: component: '{{ repeat.item.component }}' continue_on_error: true @@ -8992,7 +8999,7 @@ action: ##### Entity page - Label ##### - if: '{{ entity_pages_labels[entity_page_index].label | length > 0 }}' then: - - service: '{{ nextion.command.text_printf }}' + - service: '{{ nspanel.service.component.text }}' data: component: '{{ "entity%02d_label" | format(entity_page_index + 1) }}' message: '{{ entity_pages_labels[entity_page_index].label }}' @@ -9010,7 +9017,7 @@ action: name: '{{ repeat.item.name if repeat.item.name is defined else None }}' unit_of_measurement: '{{ state_attr(entity_id, "unit_of_measurement") | default("") }}' - *variable_entity - - service: '{{ nextion.command.set_entity }}' + - service: '{{ nspanel.service.page.entities }}' data: ent_id: '{{ repeat.item.page }}.{{ repeat.item.component }}' ent_icon: '{{ entity.icon }}' @@ -9076,7 +9083,7 @@ action: page_index: '{{ (page_name[-2:] | int(0)) - 1 }}' ##### Display relative day ##### - - service: '{{ nextion.command.text_printf }}' + - service: '{{ nspanel.service.component.text }}' data: component: '{{ page_name }}.day' message: '{{ (dict.values(mui[language].relative_day) | list)[page_index] }}' @@ -9084,7 +9091,7 @@ action: - *delay-default ##### Display date (long) ##### - - service: '{{ nextion.command.text_printf }}' + - service: '{{ nspanel.service.component.text }}' data: component: '{{ page_name }}.date' message: > @@ -9481,7 +9488,7 @@ action: ##### Display weather PIC when available - if: '{{ condition not in ["unknown", None] }}' then: - - service: '{{ nextion.command.printf }}' + - service: '{{ nspanel.service.command }}' data: cmd: > {{ page_name }}.weather_icon.pic={{ @@ -9500,7 +9507,7 @@ action: {{ (temp_max | round(0) ~ temperature_units) if is_number(temp_max) and temp_min != temp_max }} - if: '{{ (is_number(temp_min) or is_number(temp_max)) and temperature_string is string and temperature_string | length > 0 }}' then: - - service: '{{ nextion.command.text_printf }}' + - service: '{{ nspanel.service.component.text }}' data: component: '{{ page_name }}.temperature' ### Temperature MIN/MAX ### message: '{{ temperature_string }}' @@ -9511,20 +9518,20 @@ action: - repeat: for_each: '{{ (parameters | selectattr("visibility", "eq", true) | list)[:5] }}' sequence: - - service: '{{ nextion.command.text_printf }}' + - service: '{{ nspanel.service.component.text }}' data: component: '{{ page_name }}.value0{{ repeat.index }}' message: '{{ repeat.item.value }}' continue_on_error: true - *delay-default - - service: '{{ nextion.command.text_printf }}' + - service: '{{ nspanel.service.component.text }}' data: component: '{{ page_name }}.value0{{ repeat.index }}_icon' message: '{{ repeat.item.icon }}' continue_on_error: true - *delay-default else: &forecast_unavailable - - service: '{{ nextion.command.text_printf }}' + - service: '{{ nspanel.service.component.text }}' data: component: '{{ page_name }}.value01' message: '{{ mui[language].unavailable }}' @@ -9561,7 +9568,7 @@ action: - variables: back_page: '{{ page.home }}' - &open_entity_settings_page - service: '{{ nextion.command.open_entity_settings_page }}' + service: '{{ nspanel.service.page.detailed_entity }}' data: page: '{{ entity_domain }}' page_label: '{{ entity.name }}' @@ -9807,7 +9814,7 @@ action: data: entity_id: '{{ notification_unread }}' continue_on_error: true - - service: '{{ nextion.command.printf }}' + - service: '{{ nspanel.service.command }}' data: cmd: 'page {{ page.home }}' continue_on_error: true @@ -9821,10 +9828,10 @@ action: data: entity_id: '{{ notification_unread }}' continue_on_error: true - - service: '{{ nextion.command.notification_clear }}' + - service: '{{ nspanel.service.notification.clear }}' data: {} continue_on_error: true - - service: '{{ nextion.command.printf }}' + - service: '{{ nspanel.service.command }}' data: cmd: 'page {{ page.home }}' continue_on_error: true @@ -10171,7 +10178,7 @@ action: - '{{ trigger.to_state.state not in enum.states.unknown }}' sequence: ##### SET hardware Button PIC on Home Page #### - - service: '{{ nextion.command.printf }}' + - service: '{{ nspanel.service.command }}' data: cmd: 'home.{{ "left" if trigger.id == "left_button_state" else "right"}}_bt_pic.val={{ 1 if trigger.to_state.state in enum.states.on else 0 }}' continue_on_error: true @@ -10215,7 +10222,7 @@ action: sequence: - delay: seconds: 2 - - service: '{{ nextion.command.tft_upload_url }}' + - service: '{{ nspanel.service.tft_upload }}' data: url: "default" continue_on_error: true @@ -10226,7 +10233,7 @@ action: - condition: trigger id: wake_up_sensors sequence: - - service: '{{ nextion.command.wake_up }}' + - service: '{{ nspanel.service.wake_up }}' data: reset_timer: true continue_on_error: true