#############################################################
##### START - INPUT #####
#############################################################

blueprint:
  name: NSPanel Configuration
  description: '# Configuration and synchronization NSPanel via Blueprint

This project allows you to configure your complete NSPanel via a Blueprint with UI.

### *That means you dont have to customize any code or change any lines in the code.*

So you have a nice graphical interface where you can build your NSPanel.
And the best thing is, the installation takes only a few minutes.


The goal was to create a version that allows everyone to use the NSpanel fully local without having to deal with programming or reading hours of documentation - *AND YES WE DID IT!!!!* ;)


📕 Full documentation and installation video is available here [NSPanel Configuration, Setup and HowTo](https://github.com/Blackymas/NSPanel_HA_Blueprint/wiki).

🖼️ Home Assistant [Icon Page](https://htmlpreview.github.io/?https://github.com/jobr99/Generate-HASP-Fonts/blob/master/cheatsheet.html)


📌 Step by Step - [Setup Video](https://www.youtube.com/watch?v=3afPFg6kUdc)


🚀 How to create "Issues" when I have a problem [WIKI HowTo](https://github.com/Blackymas/NSPanel_HA_Blueprint/wiki)


⭐ All Feature Requests can be found here [All Feature Request](https://github.com/Blackymas/NSPanel_HA_Blueprint/labels/new%20feature%20request)


🎉 Roadmap Roadmap can be found here [Roadmap](https://github.com/Blackymas/NSPanel_HA_Blueprint/labels/roadmap)


ℹ️ Version: v.3.2.3DEV

'

  source_url: https://github.com/Blackymas/NSPanel_HA_Blueprint/blob/main/nspnael_blueprint.yaml
  domain: automation
  homeassistant:
    min_version: 2022.11.1
  input:

    ##### MAIN NAME #####
          nspanel_name:
            name: ESPhome Node Name
            description: '* *"SYSTEM" - here you have to enter exactly the same **"device_name"** you entered in the Esphome file*'
            default: [nspanel_name]
            selector:
              text: {}

    ##### SYSTEM SETTINGS #####
          language:
            name: Language for NSPanel
            description: '* *"SYSTEM" - select the language for your NSPanel*'
            default: 'ENG'
            selector:
              select:
                mode: dropdown
                options:
                  - label: 'Bulgarian'
                    value: BGR
                  - label: 'Czech'
                    value: CZE
                  - label: 'Danish'
                    value: DNK
                  - label: 'Dutch'
                    value: NLD
                  - label: 'English'
                    value: ENG
                  - label: 'Estonian'
                    value: EST
                  - label: 'Finnish'
                    value: FIN
                  - label: 'French'
                    value: FRA
                  - label: 'German'
                    value: DEU
                  - label: 'Greek'
                    value: GRC
                  - label: 'Hebrew'
                    value: HEB
                  - label: 'Hungarian'
                    value: HUN
                  - label: 'Indonesian'
                    value: IDN
                  - label: 'Italian'
                    value: ITA
                  - label: 'Latvian'
                    value: LVA
                  - label: 'Lithuanian'
                    value: LTU
                  - label: 'Norwegian'
                    value: NOR
                  - label: 'Polish'
                    value: POL
                  - label: 'Portuguese'
                    value: PRT
                  - label: 'Romanian'
                    value: ROU
                  - label: 'Russian'
                    value: RUS
                  - label: 'Swedish'
                    value: SWE
                  - label: 'Slovak'
                    value: SVK
                  - label: 'Slovene'
                    value: SVN
                  - label: 'Spanish'
                    value: ESP
                  - label: 'Turkish'
                    value: TUR
                  - label: 'Ukrainian'
                    value: UKR
          date_format:
            name: Date Format
            description: '* *"SYSTEM" - select the format for date to display*'
            default: '%d.%m'
            selector:
              select:
                multiple: false
                #mode: dropdown
                options:
                  - label: 'DD.MM (ex. 22.03)'
                    value: '%d.%m'
                  - label: 'DD/MM (ex. 22/03)'
                    value: '%d/%m'
                  - label: 'D/M (ex. 22/3)'
                    value: '%-d/%-m'
                  - label: 'M/D (ex. 3/22)'
                    value: '%-m/%-d'

          time_format:
            name: Time Format
            description: '* *"SYSTEM" - select the format for time to display*'
            default: '%H:%M'
            selector:
              select:
                multiple: false
                #mode: dropdown
                options:
                  - label: 'HH:MM (ex. 13:30)'
                    value: '%H:%M'
                  - label: 'H:MM AM/PM (ex. 1:30PM)'
                    value: '%-I:%M'

          delay:
            name: Delay to avoid synchronization problem
            description: '* *"SYSTEM" - Synchronization Problems may occur due to the **NETWORK / WLAN**. To avoid this problem enter your value for the delay (milliseconds)*'
            default: '1'
            selector:
              number:
                min: 0
                max: 100

    ##### WEATHER - Page Home / Weather 01-04 #####
        ##### PLACEHOLDER ######################################################################
          placeholder01:
            name: 'Is only a placeholder without function for a better overview'
            description: '# ✅ WEATHER AND TEMPERATURE ✅ '
            default: 'Weather and Temp'
            selector:
              select:
                options:
                  - Weather and Temp
        ##### PLACEHOLDER ######################################################################
          weather:
            name: Weather Integration
            description: '* *"SYSTEM" - select our Weather Integration*'
            default: 'Default'
            selector:
              select:
                options:
                  - Default
                  - AccuWeather
          weather_entity:
            name: Weather entity from HA
            description: '* *"SYSTEM" - Select your weather entity.*'
            default: []
            selector:
              entity:
                domain:
                  - weather

    ##### Page Home #####
      ##### Temperature - Page Home #####
          outdoortemp:
            name: Outdoor Temperature Sensor (Optional)
            description: '* *Page "HOME" - If no outdoor sensor is available, leave the field empty and the value from your selected weather integration will be used automatically*'
            default: []
            selector:
              entity:
                domain:
                  - sensor
          home_outdoor_temp_label_color:
            name: Outdoor Temperature Sensor - LABEL COLOR (Optional)
            description: '* *Page "HOME" - Label color which should be displayed*'
            default: [255,255,255] #65535 White
            selector: &color-selector
              color_rgb:
          indoortemp:
            name: Indoor Temperature Sensor - ENTITY (Optional)
            description: '* *Page "HOME" - An indoor temperature sensor is not necessary. Leave the field empty if you want to use the temperature sensor of the NSPanel. Additionally a temperature correction for the NSPanel sensor is possible under HA Devices. So everyone can adjust the sensor exactly*'
            default: []
            selector:
              entity:
                domain:
                  - sensor
          home_indoor_temp_icon:
            name: Indoor Temperature Sensor - ICON (Optional)
            description: '* *Page "HOME" - Icon which should be displayed (Default #E50E)*'
            default:  #E50E
            selector:
              text: {}
          home_indoor_temp_icon_color:
            name: Indoor Temperature Sensor - ICON COLOR (Optional)
            description: '* *Page "HOME" - Icon color which should be displayed*'
            default: [255,255,255] #65535 White
            selector: *color-selector
          home_indoor_temp_label_color:
            name: Indoor Temperature Sensor - LABEL COLOR (Optional)
            description: '* *Page "HOME" - Label color which should be displayed*'
            default: [255,255,255] #65535 White
            selector: *color-selector
      ##### Sensors - Page Home #####
        ##### PLACEHOLDER ######################################################################
          placeholder02:
            name: 'Is only a placeholder without function for a better overview'
            description: '# ✅ SENSOR HOME PAGE ✅ '
            default: 'sensor'
            selector:
              select:
                options:
                  - sensor
        ##### PLACEHOLDER ######################################################################
          home_value01:
            name: Sensor 01 - ENTITY (Optional)
            description: '* *Page "HOME" - Entity which should be displayed*'
            default: []
            selector:
              entity:
                domain:
                  - sensor
          home_value01_icon:
            name: Sensor 01 - ICON (Optional)
            description: '* *Page "HOME" - Icon which should be displayed (if not set, no icon is shown)*'
            default: []
            selector: &icon-selector
              text: {}
          home_value01_icon_color:
            name: Sensor 01 - ICON COLOR (Optional)
            description: '* *Page "HOME" - Icon color which should be displayed*'
            default: [200,204,200] #52857 Grey super light
            selector: *color-selector
          home_value01_label_color:
            name: Sensor 01 - LABEL COLOR (Optional)
            description: '* *Page "HOME" - Label color which should be displayed*'
            default: [200,204,200] #52857 Grey super light
            selector: *color-selector
          home_value02:
            name: Sensor 02 - ENTITY (Optional)
            description: '* *Page "HOME" - Entity which should be displayed*'
            default: []
            selector:
              entity:
                domain:
                  - sensor
          home_value02_icon:
            name: Sensor 02 - ICON (Optional)
            description: '* *Page "HOME" - Icon which should be displayed (if not set, no icon is shown)*'
            default: []
            selector:
              text: {}
          home_value02_icon_color:
            name: Sensor 02 - ICON COLOR (Optional)
            description: '* *Page "HOME" - Icon color which should be displayed*'
            default: [200,204,200] #52857 Grey super light
            selector: *color-selector
          home_value02_label_color:
            name: Sensor 02 - LABEL COLOR (Optional)
            description: '* *Page "HOME" - Label color which should be displayed*'
            default: [200,204,200] #52857 Grey super light
            selector: *color-selector
          home_value03:
            name: Sensor 03 - ENTITY (Optional)
            description: '* *Page "HOME" - Entity which should be displayed*'
            default: []
            selector:
              entity:
                domain:
                  - sensor
          home_value03_icon:
            name: Sensor 03 - ICON (Optional)
            description: '* *Page "HOME" - Icon which should be displayed (if not set, no icon is shown)*'
            default: []
            selector: *icon-selector
          home_value03_icon_color:
            name: Sensor 03 - ICON COLOR (Optional)
            description: '* *Page "HOME" - Icon color which should be displayed*'
            default: [200,204,200] #52857 Grey super light
            selector: *color-selector
          home_value03_label_color:
            name: Sensor 03 - LABEL COLOR (Optional)
            description: '* *Page "HOME" - Label color which should be displayed*'
            default: [200,204,200] #52857 Grey super light
            selector: *color-selector
      ##### Chips - Page Home #####
        ##### PLACEHOLDER ######################################################################
          placeholder03:
            name: 'Is only a placeholder without function for a better overview'
            description: '# ✅ CHIPS ✅ '
            default: 'chips'
            selector:
              select:
                options:
                  - chips
        ##### PLACEHOLDER ######################################################################
          chip01:
            name: Chip 01 - ENTITY (Optional)
            description: '* *Page "HOME" - Entity which should be displayed (ONLY light | switch | binary_sensor | sensor | with state ON/OFF)*'
            default: []
            selector: &chip-entity-selector
              entity:
                domain:
                  - binary_sensor
                  - input_boolean
                  - light
                  - sensor
                  - switch
          chip01_icon:
            name: Chip 01 - ICON (Optional)
            description: '* *Page "HOME" - Icon which should be displayed when state ON (if not set, no icon is shown)*'
            default: []
            selector:
              text: {}
          chip01_icon_color:
            name: Chip 01 - ICON COLOR (Optional)
            description: '* *Page "HOME" - Icon color which should be displayed*'
            default: [128,128,128] #33808 Grey light
            selector: *color-selector
          chip02:
            name: Chip 02 - ENTITY (Optional)
            description: '* *Page "HOME" - Entity which should be displayed (ONLY light | switch | binary_sensor | sensor | with state ON/OFF)*'
            default: []
            selector: *chip-entity-selector
          chip02_icon:
            name: Chip 02 - ICON (Optional)
            description: '* *Page "HOME" - Icon which should be displayed when state ON (if not set, no icon is shown)*'
            default: []
            selector: *icon-selector
          chip02_icon_color:
            name: Chip 02 - ICON COLOR (Optional)
            description: '* *Page "HOME" - Icon color which should be displayed*'
            default: [128,128,128] #33808 Grey light
            selector: *color-selector
          chip03:
            name: Chip 03 - ENTITY (Optional)
            description: '* *Page "HOME" - Entity which should be displayed (ONLY light | switch | binary_sensor | sensor | with state ON/OFF)*'
            default: []
            selector: *chip-entity-selector
          chip03_icon:
            name: Chip 03 - ICON (Optional)
            description: '* *Page "HOME" - Icon which should be displayed when state ON (if not set, no icon is shown)*'
            default: []
            selector: *icon-selector
          chip03_icon_color:
            name: Chip 03 - ICON COLOR (Optional)
            description: '* *Page "HOME" - Icon color which should be displayed*'
            default: [128,128,128] #33808 Grey light
            selector: *color-selector
          chip04:
            name: Chip 04 - ENTITY (Optional)
            description: '* *Page "HOME" - Entity which should be displayed (ONLY light | switch | binary_sensor | sensor | with state ON/OFF)*'
            default: []
            selector: *chip-entity-selector
          chip04_icon:
            name: Chip 04 - ICON (Optional)
            description: '* *Page "HOME" - Icon which should be displayed when state ON (if not set, no icon is shown)*'
            default: []
            selector: *icon-selector
          chip04_icon_color:
            name: Chip 04 - ICON COLOR (Optional)
            description: '* *Page "HOME" - Icon color which should be displayed*'
            default: [128,128,128] #33808 Grey light
            selector: *color-selector
          chip05:
            name: Chip 05 - ENTITY (Optional)
            description: '* *Page "HOME" - Entity which should be displayed (ONLY light | switch | binary_sensor | sensor | with state ON/OFF)*'
            default: []
            selector: *chip-entity-selector
          chip05_icon:
            name: Chip 05 - ICON (Optional)
            description: '* *Page "HOME" - Icon which should be displayed when state ON (if not set, no icon is shown)*'
            default: []
            selector: *icon-selector
          chip05_icon_color:
            name: Chip 05 - ICON COLOR (Optional)
            description: '* *Page "HOME" - Icon color which should be displayed*'
            default: [128,128,128] #33808 Grey light
            selector: *color-selector
          chip06:
            name: Chip 06 - ENTITY (Optional)
            description: '* *Page "HOME" - Entity which should be displayed (ONLY light | switch | binary_sensor | sensor | with state ON/OFF)*'
            default: []
            selector: *chip-entity-selector
          chip06_icon:
            name: Chip 06 - ICON (Optional)
            description: '* *Page "HOME" - Icon which should be displayed when state ON (if not set, no icon is shown)*'
            default: []
            selector: *icon-selector
          chip06_icon_color:
            name: Chip 06 - ICON COLOR (Optional)
            description: '* *Page "HOME" - Icon color which should be displayed*'
            default: [128,128,128] #33808 Grey light
            selector: *color-selector
          chip07:
            name: Chip 07 - ENTITY (Optional)
            description: '* *Page "HOME" - Entity which should be displayed (ONLY light | switch | binary_sensor | sensor | with state ON/OFF)*'
            default: []
            selector: *chip-entity-selector
          chip07_icon:
            name: Chip 07 - ICON (Optional)
            description: '* *Page "HOME" - Icon which should be displayed when state ON (if not set, no icon is shown)*'
            default: []
            selector: *icon-selector
          chip07_icon_color:
            name: Chip 07 - ICON COLOR (Optional)
            description: '* *Page "HOME" - Icon color which should be displayed*'
            default: [128,128,128] #33808 Grey light
            selector: *color-selector

    ##### Climate - Page Climate #####
        ##### PLACEHOLDER ######################################################################
          placeholder04:
            name: 'Is only a placeholder without function for a better overview'
            description: '# ✅ CLIMATE ✅ '
            default: 'climate'
            selector:
              select:
                options:
                  - climate
        ##### PLACEHOLDER ######################################################################
          climate:
            name: Climate to control - ENTITY (Optional)
            description: '* *Page "CLIMATE" - If an entity is selected, the **"Thermostat page"** is activated and enabled. If you have **"Underfloor Heating System"** and want to switch it via the relay, you must create a separate climate in HA. See HowTo*'
            default: []
            selector:
              entity:
                domain: climate
          climate_optimistic:
            name: Climate control optimistic mode - TRUE/FALSE (Optional)
            default: true
            description: '* *Page "CLIMATE" - Depends on your climate device and HA-Integration. If optimisitc mode is **OFF** then changes are made will wait for response from device to update temperature in the display. This can cause delays or jumping values. If **ON** the script update the display immediately but apply changes after closing climate-page* '
            selector:
              boolean:
          hotwatercharge:
            name: Hot Water Charge Button - ENTITY (Optional)
            description: '* *Page "CLIMATE" - Choose your switch to turn on/off*'
            default: []
            selector:
              entity:
                domain:
                  - switch
                  - input_boolean

    ##### QR Code - Page Home/QR Code #####
        ##### PLACEHOLDER ######################################################################
          placeholder05:
            name: 'Is only a placeholder without function for a better overview'
            description: '# ✅ QR CODE ✅ '
            default: 'qrcode'
            selector:
              select:
                options:
                  - qrcode
        ##### PLACEHOLDER ######################################################################
          qrcode_enabled:
            name: Activate QR Code - TRUE/FALSE (Optional)
            default: false
            description: '* *Page "HOME" - activate QR Code page and QR Code Button on the home page* '
            selector:
              boolean:
          qrcode_label:
            name: QR Code page name - LABEL (Optional)
            description: '* *Page "QRCODE" - Label which should be displayed*'
            default: []
            selector:
              text: {}
          qrcode_value:
            name: QR Code content - VALUE (Optional)
            description: '* *Page "QRCODE" - Value you want to display as QR code*'
            default: []
            selector:
              text: {}
          home_button05_icon:
            name: QR Code - ICON (Optional)
            description: '* *Page "HOME" - Icon which should be displayed (Default #E432)*'
            default:  #E432
            selector: *icon-selector
          home_button05_icon_color:
            name: QR Code - ICON COLOR (Optional)
            description: '* *Page "HOME" - Icon color which should be displayed (default color is set)*'
            default: [200,204,200] #52857 Grey super light
            selector: *color-selector

    ##### Page Home - Hardware Buttons  #####
        ##### PLACEHOLDER ######################################################################
          placeholder06:
            name: 'Is only a placeholder without function for a better overview'
            description: '# ✅ HARDWARE BUTTONS ✅ '
            default: 'hardwarebuttons'
            selector:
              select:
                options:
                  - hardwarebuttons
        ##### PLACEHOLDER ######################################################################
          hold_delay:
            name: Delay for HW-Button hold in seconds - VALUE
            description: '* *"SYSTEM" - Time in seconds to detect a hold*'
            default: 1.0
            selector:
                number:
                  min: 1.0
                  max: 10.0
                  step: 1.0
                  unit_of_measurement: seconds
          relay_1_local_fallback:
            name: Activate relay 1 local fallback - TRUE/FALSE (Optional)
            default: false
            description: '* *"SYSTEM" - activate this to use left button to toggle relay 1 if display is offline* '
            selector:
              boolean:
          left_button_entity:
            name: Left hardware button - ENTITY (Optional)
            description: '* *"SYSTEM" - Entity which should be switched*'
            default: []
            selector: &hardware-button-selector
              entity:
                domain:
                  - light
                  - switch
                  - input_boolean
                  - cover
                  - automation
                  - button
                  - input_button
                  - scene
                  - script
                  - fan
          left_button_name:
            name: Left hardware button name - LABEL (Optional)
            description: '* *Page "HOME" - Label which should be displayed (10 characters are supported)*'
            default: []
            selector:
              text: {}
          left_button_hold_select:
            name: Left hardware button hold assignment - VALUE (Optional)
            description: '* *"SYSTEM" - select what shold happen on hold*'
            default: 'Default'
            selector: &hardware-button-hold-selector
              select:
                options:
                  - Default
                  - Custom Action
          left_button_hold_custom_action:
            name: Left hardware button custom hold action - VALUE (Optional)
            description: '*"SYSTEM" - The action(s) to launch on hold**'
            default: []
            selector:
              action:
          left_button_color:
            name: Left hardware button - LABEL COLOR (Optional)
            description: '* *Page "HOME" - LABEL color which should be displayed*'
            default: [200,204,200] #52857 Grey super light
            selector: *color-selector
          relay_2_local_fallback:
            name: Activate relay 2 local fallback - TRUE/FALSE (Optional)
            default: false
            description: '* *"SYSTEM" - activate this to use right button to toggle relay 2 if display is offline* '
            selector:
              boolean:
          right_button_entity:
            name: Right hardware button - ENTITY (Optional)
            description: '* *"SYSTEM" - Entity which should be switched*'
            default: []
            selector: *hardware-button-selector
          right_button_name:
            name: Right hardware button name - LABEL (Optional)
            description: '* *Page "HOME" - Label which should be displayed (10 characters are supported)*'
            default: []
            selector:
              text: {}
          right_button_hold_select:
            name: Right button hold assignment - VALUE (Optional)
            description: '* *"SYSTEM" - select what shold happen on hold*'
            default: 'Default'
            selector: *hardware-button-hold-selector
          right_button_hold_custom_action:
            name: Right button custom hold action - VALUE (Optional)
            description: '*"SYSTEM" - The action(s) to launch on hold**'
            default: []
            selector:
              action:
          right_button_color:
            name: Right hardware button - LABEL COLOR (Optional)
            description: '* *Page "HOME" - LABEL color which should be displayed*'
            default: [200,204,200] #52857 Grey super light
            selector: *color-selector

    ##### Button pages #####
      ##### Button page - Labels #####
        ##### PLACEHOLDER ######################################################################
          placeholder17:
            name: 'Is only a placeholder without function for a better overview'
            description: '# ✅ BUTTON PAGES LABELS ✅ '
            default: 'Button pages labels'
            selector:
              select:
                options:
                  - Button pages labels
        ##### PLACEHOLDER ######################################################################
          button_page01_label:
            name: Button page 01 name - LABEL (Optional)
            description: '* *Page "ButtonPage01" - Label which should be displayed*'
            default: []
            selector:
              text: {}
          button_page02_label:
            name: Button page 02 name - LABEL (Optional)
            description: '* *Page "ButtonPage02" - Label which should be displayed*'
            default: []
            selector:
              text: {}
          button_page03_label:
            name: Button page 03 name - LABEL (Optional)
            description: '* *Page "ButtonPage03" - Label which should be displayed*'
            default: []
            selector:
              text: {}
          button_page04_label:
            name: Button page 04 name - LABEL (Optional)
            description: '* *Page "ButtonPage04" - Label which should be displayed*'
            default: []
            selector:
              text: {}
      ##### Button page 01 #####
        ##### PLACEHOLDER ######################################################################
          placeholder07:
            name: 'Is only a placeholder without function for a better overview'
            description: '# ✅ BUTTON PAGES 01 ✅ '
            default: 'buttonpage01'
            selector:
              select:
                options:
                  - buttonpage01
        ##### PLACEHOLDER ######################################################################
          entity01:
            name: Button 01 - ENTITY (Optional)
            description: '* *Page "BUTTONPAGE01" - Entity which should be switched (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor | fan | climate)*'
            default: []
            selector: &button-entity-selector
              entity:
                domain:
                  - light
                  - switch
                  - cover
                  - input_boolean
                  - automation
                  - button
                  - input_button
                  - scene
                  - person
                  - script
                  - binary_sensor
                  - fan
                  - climate
          entity01_name:
            name: Button 01 name - LABEL (Optional)
            description: '* *Page "BUTTONPAGE01" - Label which should be displayed (10 characters are supported)*'
            default: []
            selector:
              text: {}
          entity01_icon:
            name: Button 01 - ICON (Optional)
            description: '* *Page "BUTTONPAGE01" - Icon which should be displayed (Default - an icon matching the entity will be set automatically)*'
            default: []
            selector: *icon-selector
          entity01_icon_color:
            name: Button 01 - ICON COLOR (Optional)
            description: '* *Page "BUTTONPAGE01" - Icon color which should be displayed when button is on*'
            default: [0,128,248] #1055 Blue
            selector: *color-selector
          entity01_confirm:
            name: Confirm execution of the button press - TRUE/FALSE (Optional)
            default: false
            description: '* *Page "BUTTONPAGE01" - Ask for confirmation to execute **Button01** action*'
            selector:
              boolean:
          entity02:
            name: Button 02 - ENTITY (Optional)
            description: '* *Page "BUTTONPAGE01" - Entity which should be switched (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor | fan | climate)*'
            default: []
            selector: *button-entity-selector
          entity02_name:
            name: Button 02 name - LABEL (Optional)
            description: '* *Page "BUTTONPAGE01" - Label which should be displayed (10 characters are supported)*'
            default: []
            selector:
              text: {}
          entity02_icon:
            name: Button 02 - ICON (Optional)
            description: '* *Page "BUTTONPAGE01" - Icon which should be displayed (Default - an icon matching the entity will be set automatically)*'
            default: []
            selector: *icon-selector
          entity02_icon_color:
            name: Button 02 - ICON COLOR (Optional)
            description: '* *Page "BUTTONPAGE01" - Icon color which should be displayed when button is on*'
            default: [0,128,248] #1055 Blue
            selector: *color-selector
          entity02_confirm:
            name: Confirm execution of the button press - TRUE/FALSE (Optional)
            default: false
            description: '* *Page "BUTTONPAGE01" - Ask for confirmation to execute **Button02** action*'
            selector:
              boolean:
          entity03:
            name: Button 03 - ENTITY (Optional)
            description: '* *Page "BUTTONPAGE01" - Entity which should be switched (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor | fan | climate)*'
            default: []
            selector: *button-entity-selector
          entity03_name:
            name: Button 03 name - LABEL (Optional)
            description: '* *Page "BUTTONPAGE01" - Label which should be displayed (10 characters are supported)*'
            default: []
            selector:
              text: {}
          entity03_icon:
            name: Button 03 - ICON (Optional)
            description: '* *Page "BUTTONPAGE01" - Icon which should be displayed (Default - an icon matching the entity will be set automatically)*'
            default: []
            selector: *icon-selector
          entity03_icon_color:
            name: Button 03 - ICON COLOR (Optional)
            description: '* *Page "BUTTONPAGE01" - Icon color which should be displayed when button is on*'
            default: [0,128,248] #1055 Blue
            selector: *color-selector
          entity03_confirm:
            name: Confirm execution of the button press - TRUE/FALSE (Optional)
            default: false
            description: '* *Page "BUTTONPAGE01" - Ask for confirmation to execute **Button03** action*'
            selector:
              boolean:
          entity04:
            name: Button 04 - ENTITY (Optional)
            description: '* *Page "BUTTONPAGE01" - Entity which should be switched (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor | fan | climate)*'
            default: []
            selector: *button-entity-selector
          entity04_name:
            name: Button 04 name - LABEL (Optional)
            description: '* *Page "BUTTONPAGE01" - Label which should be displayed (10 characters are supported)*'
            default: []
            selector:
              text: {}
          entity04_icon:
            name: Button 04 - ICON (Optional)
            description: '* *Page "BUTTONPAGE01" - Icon which should be displayed (Default - an icon matching the entity will be set automatically)*'
            default: []
            selector: *icon-selector
          entity04_icon_color:
            name: Button 04 - ICON COLOR (Optional)
            description: '* *Page "BUTTONPAGE01" - Icon color which should be displayed when button is on*'
            default: [0,128,248] #1055 Blue
            selector: *color-selector
          entity04_confirm:
            name: Confirm execution of the button press - TRUE/FALSE (Optional)
            default: false
            description: '* *Page "BUTTONPAGE01" - Ask for confirmation to execute **Button04** action*'
            selector:
              boolean:
          entity05:
            name: Button 05 - ENTITY (Optional)
            description: '* *Page "BUTTONPAGE01" - Entity which should be switched (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor | fan | climate)*'
            default: []
            selector: *button-entity-selector
          entity05_name:
            name: Button 05 name - LABEL (Optional)
            description: '* *Page "BUTTONPAGE01" - Label which should be displayed (10 characters are supported)*'
            default: []
            selector:
              text: {}
          entity05_icon:
            name: Button 05 - ICON (Optional)
            description: '* *Page "BUTTONPAGE01" - Icon which should be displayed (Default - an icon matching the entity will be set automatically)*'
            default: []
            selector: *icon-selector
          entity05_icon_color:
            name: Button 05 - ICON COLOR (Optional)
            description: '* *Page "BUTTONPAGE01" - Icon color which should be displayed when button is on*'
            default: [0,128,248] #1055 Blue
            selector: *color-selector
          entity05_confirm:
            name: Confirm execution of the button press - TRUE/FALSE (Optional)
            default: false
            description: '* *Page "BUTTONPAGE01" - Ask for confirmation to execute **Button05** action*'
            selector:
              boolean:
          entity06:
            name: Button 06 - ENTITY (Optional)
            description: '* *Page "BUTTONPAGE01" - Entity which should be switched (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor | fan | climate)*'
            default: []
            selector: *button-entity-selector
          entity06_name:
            name: Button 06 name - LABEL (Optional)
            description: '* *Page "BUTTONPAGE01" - Label which should be displayed (10 characters are supported)*'
            default: []
            selector:
              text: {}
          entity06_icon:
            name: Button 06 - ICON (Optional)
            description: '* *Page "BUTTONPAGE01" - Icon which should be displayed (Default - an icon matching the entity will be set automatically)*'
            default: []
            selector: *icon-selector
          entity06_icon_color:
            name: Button 06 - ICON COLOR (Optional)
            description: '* *Page "BUTTONPAGE01" - Icon color which should be displayed when button is on*'
            default: [0,128,248] #1055 Blue
            selector: *color-selector
          entity06_confirm:
            name: Confirm execution of the button press - TRUE/FALSE (Optional)
            default: false
            description: '* *Page "BUTTONPAGE01" - Ask for confirmation to execute **Button06** action*'
            selector:
              boolean:
          entity07:
            name: Button 07 - ENTITY (Optional)
            description: '* *Page "BUTTONPAGE01" - Entity which should be switched (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor | fan | climate)*'
            default: []
            selector: *button-entity-selector
          entity07_name:
            name: Button 07 name - LABEL (Optional)
            description: '* *Page "BUTTONPAGE01" - Label which should be displayed (10 characters are supported)*'
            default: []
            selector:
              text: {}
          entity07_icon:
            name: Button 07 - ICON (Optional)
            description: '* *Page "BUTTONPAGE01" - Icon which should be displayed (Default - an icon matching the entity will be set automatically)*'
            default: []
            selector: *icon-selector
          entity07_icon_color:
            name: Button 07 - ICON COLOR (Optional)
            description: '* *Page "BUTTONPAGE01" - Icon color which should be displayed when button is on*'
            default: [0,128,248] #1055 Blue
            selector: *color-selector
          entity07_confirm:
            name: Confirm execution of the button press - TRUE/FALSE (Optional)
            default: false
            description: '* *Page "BUTTONPAGE01" - Ask for confirmation to execute **Button07** action*'
            selector:
              boolean:
          entity08:
            name: Button 08 - ENTITY (Optional)
            description: '* *Page "BUTTONPAGE01" - Entity which should be switched (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor | fan | climate)*'
            default: []
            selector: *button-entity-selector
          entity08_name:
            name: Button 08 name - LABEL (Optional)
            description: '* *Page "BUTTONPAGE01" - Label which should be displayed (10 characters are supported)*'
            default: []
            selector:
              text: {}
          entity08_icon:
            name: Button 08 - ICON (Optional)
            description: '* *Page "BUTTONPAGE01" - Icon which should be displayed (Default - an icon matching the entity will be set automatically)*'
            default: []
            selector: *icon-selector
          entity08_icon_color:
            name: Button 08 - ICON COLOR (Optional)
            description: '* *Page "BUTTONPAGE01" - Icon color which should be displayed when button is on*'
            default: [0,128,248] #1055 Blue
            selector: *color-selector
          entity08_confirm:
            name: Confirm execution of the button press - TRUE/FALSE (Optional)
            default: false
            description: '* *Page "BUTTONPAGE01" - Ask for confirmation to execute **Button08** action*'
            selector:
              boolean:
      ##### Button page 02 #####
        ##### PLACEHOLDER ######################################################################
          placeholder08:
            name: 'Is only a placeholder without function for a better overview'
            description: '# ✅ BUTTON PAGE 02 ✅ '
            default: 'buttonpage02'
            selector:
              select:
                options:
                  - buttonpage02
        ##### PLACEHOLDER ######################################################################
          entity09:
            name: Button 09 - ENTITY (Optional)
            description: '* *Page "BUTTONPAGE02" - Entity which should be switched (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor | fan | climate)*'
            default: []
            selector: *button-entity-selector
          entity09_name:
            name: Button 09 name - LABEL (Optional)
            description: '* *Page "BUTTONPAGE02" - Label which should be displayed (10 characters are supported)*'
            default: []
            selector:
              text: {}
          entity09_icon:
            name: Button 09 - ICON (Optional)
            description: '* *Page "BUTTONPAGE02" - Icon which should be displayed (Default - an icon matching the entity will be set automatically)*'
            default: []
            selector: *icon-selector
          entity09_icon_color:
            name: Button 09 - ICON COLOR (Optional)
            description: '* *Page "BUTTONPAGE02" - Icon color which should be displayed when button is on*'
            default: [0,128,248] #1055 Blue
            selector: *color-selector
          entity09_confirm:
            name: Confirm execution of the button press - TRUE/FALSE (Optional)
            default: false
            description: '* *Page "BUTTONPAGE02" - Ask for confirmation to execute **Button09** action*'
            selector:
              boolean:
          entity10:
            name: Button 10 - ENTITY (Optional)
            description: '* *Page "BUTTONPAGE02" - Entity which should be switched (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor | fan | climate)*'
            default: []
            selector: *button-entity-selector
          entity10_name:
            name: Button 10 name - LABEL (Optional)
            description: '* *Page "BUTTONPAGE02" - Label which should be displayed (10 characters are supported)*'
            default: []
            selector:
              text: {}
          entity10_icon:
            name: Button 10 - ICON (Optional)
            description: '* *Page "BUTTONPAGE02" - Icon which should be displayed (Default - an icon matching the entity will be set automatically)*'
            default: []
            selector: *icon-selector
          entity10_icon_color:
            name: Button 10 - ICON COLOR (Optional)
            description: '* *Page "BUTTONPAGE02" - Icon color which should be displayed when button is on*'
            default: [0,128,248] #1055 Blue
            selector: *color-selector
          entity10_confirm:
            name: Confirm execution of the button press - TRUE/FALSE (Optional)
            default: false
            description: '* *Page "BUTTONPAGE02" - Ask for confirmation to execute **Button10** action*'
            selector:
              boolean:
          entity11:
            name: Button 11 - ENTITY (Optional)
            description: '* *Page "BUTTONPAGE02" - Entity which should be switched (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor | fan | climate)*'
            default: []
            selector: *button-entity-selector
          entity11_name:
            name: Button 11 name - LABEL (Optional)
            description: '* *Page "BUTTONPAGE02" - Label which should be displayed (10 characters are supported)*'
            default: []
            selector:
              text: {}
          entity11_icon:
            name: Button 11 - ICON (Optional)
            description: '* *Page "BUTTONPAGE02" - Icon which should be displayed (Default - an icon matching the entity will be set automatically)*'
            default: []
            selector: *icon-selector
          entity11_icon_color:
            name: Button 11 - ICON COLOR (Optional)
            description: '* *Page "BUTTONPAGE02" - Icon color which should be displayed when button is on*'
            default: [0,128,248] #1055 Blue
            selector: *color-selector
          entity11_confirm:
            name: Confirm execution of the button press - TRUE/FALSE (Optional)
            default: false
            description: '* *Page "BUTTONPAGE02" - Ask for confirmation to execute **Button11** action*'
            selector:
              boolean:
          entity12:
            name: Button 12 - ENTITY (Optional)
            description: '* *Page "BUTTONPAGE02" - Entity which should be switched (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor | fan | climate)*'
            default: []
            selector: *button-entity-selector
          entity12_name:
            name: Button 12 name - LABEL (Optional)
            description: '* *Page "BUTTONPAGE02" - Label which should be displayed (10 characters are supported)*'
            default: []
            selector:
              text: {}
          entity12_icon:
            name: Button 12 - ICON (Optional)
            description: '* *Page "BUTTONPAGE02" - Icon which should be displayed (Default - an icon matching the entity will be set automatically)*'
            default: []
            selector: *icon-selector
          entity12_icon_color:
            name: Button 12 - ICON COLOR (Optional)
            description: '* *Page "BUTTONPAGE02" - Icon color which should be displayed when button is on*'
            default: [0,128,248] #1055 Blue
            selector: *color-selector
          entity12_confirm:
            name: Confirm execution of the button press - TRUE/FALSE (Optional)
            default: false
            description: '* *Page "BUTTONPAGE02" - Ask for confirmation to execute **Button12** action*'
            selector:
              boolean:
          entity13:
            name: Button 13 - ENTITY (Optional)
            description: '* *Page "BUTTONPAGE02" - Entity which should be switched (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor | fan | climate)*'
            default: []
            selector: *button-entity-selector
          entity13_name:
            name: Button 13 name - LABEL (Optional)
            description: '* *Page "BUTTONPAGE02" - Label which should be displayed (10 characters are supported)*'
            default: []
            selector:
              text: {}
          entity13_icon:
            name: Button 13 - ICON (Optional)
            description: '* *Page "BUTTONPAGE02" - Icon which should be displayed (Default - an icon matching the entity will be set automatically)*'
            default: []
            selector: *icon-selector
          entity13_icon_color:
            name: Button 13 - ICON COLOR (Optional)
            description: '* *Page "BUTTONPAGE02" - Icon color which should be displayed when button is on*'
            default: [0,128,248] #1055 Blue
            selector: *color-selector
          entity13_confirm:
            name: Confirm execution of the button press - TRUE/FALSE (Optional)
            default: false
            description: '* *Page "BUTTONPAGE02" - Ask for confirmation to execute **Button13** action*'
            selector:
              boolean:
          entity14:
            name: Button 14 - ENTITY (Optional)
            description: '* *Page "BUTTONPAGE02" - Entity which should be switched (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor | fan | climate)*'
            default: []
            selector: *button-entity-selector
          entity14_name:
            name: Button 14 name - LABEL (Optional)
            description: '* *Page "BUTTONPAGE02" - Label which should be displayed (10 characters are supported)*'
            default: []
            selector:
              text: {}
          entity14_icon:
            name: Button 14 - ICON (Optional)
            description: '* *Page "BUTTONPAGE02" - Icon which should be displayed (Default - an icon matching the entity will be set automatically)*'
            default: []
            selector: *icon-selector
          entity14_icon_color:
            name: Button 14 - ICON COLOR (Optional)
            description: '* *Page "BUTTONPAGE02" - Icon color which should be displayed when button is on*'
            default: [0,128,248] #1055 Blue
            selector: *color-selector
          entity14_confirm:
            name: Confirm execution of the button press - TRUE/FALSE (Optional)
            default: false
            description: '* *Page "BUTTONPAGE02" - Ask for confirmation to execute **Button14** action*'
            selector:
              boolean:
          entity15:
            name: Button 15 - ENTITY (Optional)
            description: '* *Page "BUTTONPAGE02" - Entity which should be switched (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor | fan | climate)*'
            default: []
            selector: *button-entity-selector
          entity15_name:
            name: Button 15 name - LABEL (Optional)
            description: '* *Page "BUTTONPAGE02" - Label which should be displayed (10 characters are supported)*'
            default: []
            selector:
              text: {}
          entity15_icon:
            name: Button 15 - ICON (Optional)
            description: '* *Page "BUTTONPAGE02" - Icon which should be displayed (Default - an icon matching the entity will be set automatically)*'
            default: []
            selector: *icon-selector
          entity15_icon_color:
            name: Button 15 - ICON COLOR (Optional)
            description: '* *Page "BUTTONPAGE02" - Icon color which should be displayed when button is on*'
            default: [0,128,248] #1055 Blue
            selector: *color-selector
          entity15_confirm:
            name: Confirm execution of the button press - TRUE/FALSE (Optional)
            default: false
            description: '* *Page "BUTTONPAGE02" - Ask for confirmation to execute **Button15** action*'
            selector:
              boolean:
          entity16:
            name: Button 16 - ENTITY (Optional)
            description: '* *Page "BUTTONPAGE02" - Entity which should be switched (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor | fan | climate)*'
            default: []
            selector: *button-entity-selector
          entity16_name:
            name: Button 16 name - LABEL (Optional)
            description: '* *Page "BUTTONPAGE02" - Label which should be displayed (10 characters are supported)*'
            default: []
            selector:
              text: {}
          entity16_icon:
            name: Button 16 - ICON (Optional)
            description: '* *Page "BUTTONPAGE02" - Icon which should be displayed (Default - an icon matching the entity will be set automatically)*'
            default: []
            selector: *icon-selector
          entity16_icon_color:
            name: Button 16 - ICON COLOR (Optional)
            description: '* *Page "BUTTONPAGE02" - Icon color which should be displayed when button is on*'
            default: [0,128,248] #1055 Blue
            selector: *color-selector
          entity16_confirm:
            name: Confirm execution of the button press - TRUE/FALSE (Optional)
            default: false
            description: '* *Page "BUTTONPAGE02" - Ask for confirmation to execute **Button16** action*'
            selector:
              boolean:
      ##### Button page 03 #####
        ##### PLACEHOLDER ######################################################################
          placeholder09:
            name: 'Is only a placeholder without function for a better overview'
            description: '# ✅ BUTTON PAGE 03 ✅ '
            default: 'buttonpage03'
            selector:
              select:
                options:
                  - buttonpage03
        ##### PLACEHOLDER ######################################################################
          entity17:
            name: Button 17 - ENTITY (Optional)
            description: '* *Page "BUTTONPAGE03" - Entity which should be switched (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor | fan | climate)*'
            default: []
            selector: *button-entity-selector
          entity17_name:
            name: Button 17 name - LABEL (Optional)
            description: '* *Page "BUTTONPAGE03" - Label which should be displayed (10 characters are supported)*'
            default: []
            selector:
              text: {}
          entity17_icon:
            name: Button 17 - ICON (Optional)
            description: '* *Page "BUTTONPAGE03" - Icon which should be displayed (Default - an icon matching the entity will be set automatically)*'
            default: []
            selector: *icon-selector
          entity17_icon_color:
            name: Button 17 - ICON COLOR (Optional)
            description: '* *Page "BUTTONPAGE03" - Icon color which should be displayed when button is on*'
            default: [0,128,248] #1055 Blue
            selector: *color-selector
          entity17_confirm:
            name: Confirm execution of the button press - TRUE/FALSE (Optional)
            default: false
            description: '* *Page "BUTTONPAGE03" - Ask for confirmation to execute **Button17** action*'
            selector:
              boolean:
          entity18:
            name: Button 18 - ENTITY (Optional)
            description: '* *Page "BUTTONPAGE03" - Entity which should be switched (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor | fan | climate)*'
            default: []
            selector: *button-entity-selector
          entity18_name:
            name: Button 18 name - LABEL (Optional)
            description: '* *Page "BUTTONPAGE03" - Label which should be displayed (10 characters are supported)*'
            default: []
            selector:
              text: {}
          entity18_icon:
            name: Button 18 - ICON (Optional)
            description: '* *Page "BUTTONPAGE03" - Icon which should be displayed (Default - an icon matching the entity will be set automatically)*'
            default: []
            selector: *icon-selector
          entity18_icon_color:
            name: Button 18 - ICON COLOR (Optional)
            description: '* *Page "BUTTONPAGE03" - Icon color which should be displayed when button is on*'
            default: [0,128,248] #1055 Blue
            selector: *color-selector
          entity18_confirm:
            name: Confirm execution of the button press - TRUE/FALSE (Optional)
            default: false
            description: '* *Page "BUTTONPAGE03" - Ask for confirmation to execute **Button18** action*'
            selector:
              boolean:
          entity19:
            name: Button 19 - ENTITY (Optional)
            description: '* *Page "BUTTONPAGE03" - Entity which should be switched (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor | fan | climate)*'
            default: []
            selector: *button-entity-selector
          entity19_name:
            name: Button 19 name - LABEL (Optional)
            description: '* *Page "BUTTONPAGE03" - Label which should be displayed (10 characters are supported)*'
            default: []
            selector:
              text: {}
          entity19_icon:
            name: Button 19 - ICON (Optional)
            description: '* *Page "BUTTONPAGE03" - Icon which should be displayed (Default - an icon matching the entity will be set automatically)*'
            default: []
            selector: *icon-selector
          entity19_icon_color:
            name: Button 19 - ICON COLOR (Optional)
            description: '* *Page "BUTTONPAGE03" - Icon color which should be displayed when button is on*'
            default: [0,128,248] #1055 Blue
            selector: *color-selector
          entity19_confirm:
            name: Confirm execution of the button press - TRUE/FALSE (Optional)
            default: false
            description: '* *Page "BUTTONPAGE03" - Ask for confirmation to execute **Button19** action*'
            selector:
              boolean:
          entity20:
            name: Button 20 - ENTITY (Optional)
            description: '* *Page "BUTTONPAGE03" - Entity which should be switched (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor | fan | climate)*'
            default: []
            selector: *button-entity-selector
          entity20_name:
            name: Button 20 name - LABEL (Optional)
            description: '* *Page "BUTTONPAGE03" - Label which should be displayed (10 characters are supported)*'
            default: []
            selector:
              text: {}
          entity20_icon:
            name: Button 20 - ICON (Optional)
            description: '* *Page "BUTTONPAGE03" - Icon which should be displayed (Default - an icon matching the entity will be set automatically)*'
            default: []
            selector: *icon-selector
          entity20_icon_color:
            name: Button 20 - ICON COLOR (Optional)
            description: '* *Page "BUTTONPAGE03" - Icon color which should be displayed when button is on*'
            default: [0,128,248] #1055 Blue
            selector: *color-selector
          entity20_confirm:
            name: Confirm execution of the button press - TRUE/FALSE (Optional)
            default: false
            description: '* *Page "BUTTONPAGE03" - Ask for confirmation to execute **Button20** action*'
            selector:
              boolean:
          entity21:
            name: Button 21 - ENTITY (Optional)
            description: '* *Page "BUTTONPAGE03" - Entity which should be switched (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor | fan | climate)*'
            default: []
            selector: *button-entity-selector
          entity21_name:
            name: Button 21 name - LABEL (Optional)
            description: '* *Page "BUTTONPAGE03" - Label which should be displayed (10 characters are supported)*'
            default: []
            selector:
              text: {}
          entity21_icon:
            name: Button 21 - ICON (Optional)
            description: '* *Page "BUTTONPAGE03" - Icon which should be displayed (Default - an icon matching the entity will be set automatically)*'
            default: []
            selector: *icon-selector
          entity21_icon_color:
            name: Button 21 - ICON COLOR (Optional)
            description: '* *Page "BUTTONPAGE03" - Icon color which should be displayed when button is on*'
            default: [0,128,248] #1055 Blue
            selector: *color-selector
          entity21_confirm:
            name: Confirm execution of the button press - TRUE/FALSE (Optional)
            default: false
            description: '* *Page "BUTTONPAGE03" - Ask for confirmation to execute **Button21** action*'
            selector:
              boolean:
          entity22:
            name: Button 22 - ENTITY (Optional)
            description: '* *Page "BUTTONPAGE03" - Entity which should be switched (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor | fan | climate)*'
            default: []
            selector: *button-entity-selector
          entity22_name:
            name: Button 22 name - LABEL (Optional)
            description: '* *Page "BUTTONPAGE03" - Label which should be displayed (10 characters are supported)*'
            default: []
            selector:
              text: {}
          entity22_icon:
            name: Button 22 - ICON (Optional)
            description: '* *Page "BUTTONPAGE03" - Icon which should be displayed (Default - an icon matching the entity will be set automatically)*'
            default: []
            selector: *icon-selector
          entity22_icon_color:
            name: Button 22 - ICON COLOR (Optional)
            description: '* *Page "BUTTONPAGE03" - Icon color which should be displayed when button is on*'
            default: [0,128,248] #1055 Blue
            selector: *color-selector
          entity22_confirm:
            name: Confirm execution of the button press - TRUE/FALSE (Optional)
            default: false
            description: '* *Page "BUTTONPAGE03" - Ask for confirmation to execute **Button22** action*'
            selector:
              boolean:
          entity23:
            name: Button 23 - ENTITY (Optional)
            description: '* *Page "BUTTONPAGE03" - Entity which should be switched (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor | fan | climate)*'
            default: []
            selector: *button-entity-selector
          entity23_name:
            name: Button 23 name - LABEL (Optional)
            description: '* *Page "BUTTONPAGE03" - Label which should be displayed (10 characters are supported)*'
            default: []
            selector:
              text: {}
          entity23_icon:
            name: Button 23 - ICON (Optional)
            description: '* *Page "BUTTONPAGE03" - Icon which should be displayed (Default - an icon matching the entity will be set automatically)*'
            default: []
            selector: *icon-selector
          entity23_icon_color:
            name: Button 23 - ICON COLOR (Optional)
            description: '* *Page "BUTTONPAGE03" - Icon color which should be displayed when button is on*'
            default: [0,128,248] #1055 Blue
            selector: *color-selector
          entity23_confirm:
            name: Confirm execution of the button press - TRUE/FALSE (Optional)
            default: false
            description: '* *Page "BUTTONPAGE03" - Ask for confirmation to execute **Button23** action*'
            selector:
              boolean:
          entity24:
            name: Button 24 - ENTITY (Optional)
            description: '* *Page "BUTTONPAGE03" - Entity which should be switched (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor | fan | climate)*'
            default: []
            selector: *button-entity-selector
          entity24_name:
            name: Button 24 name - LABEL (Optional)
            description: '* *Page "BUTTONPAGE03" - Label which should be displayed (10 characters are supported)*'
            default: []
            selector:
              text: {}
          entity24_icon:
            name: Button 24 - ICON (Optional)
            description: '* *Page "BUTTONPAGE03" - Icon which should be displayed (Default - an icon matching the entity will be set automatically)*'
            default: []
            selector: *icon-selector
          entity24_icon_color:
            name: Button 24 - ICON COLOR (Optional)
            description: '* *Page "BUTTONPAGE03" - Icon color which should be displayed when button is on*'
            default: [0,128,248] #1055 Blue
            selector: *color-selector
          entity24_confirm:
            name: Confirm execution of the button press - TRUE/FALSE (Optional)
            default: false
            description: '* *Page "BUTTONPAGE03" - Ask for confirmation to execute **Button24** action*'
            selector:
              boolean:
      ##### Button page 04 #####
        ##### PLACEHOLDER ######################################################################
          placeholder10:
            name: 'Is only a placeholder without function for a better overview'
            description: '# ✅ BUTTON PAGE 04 ✅ '
            default: 'buttonpage04'
            selector:
              select:
                options:
                  - buttonpage04
        ##### PLACEHOLDER ######################################################################
          entity25:
            name: Button 25 - ENTITY (Optional)
            description: '* *Page "BUTTONPAGE04" - Entity which should be switched (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor | fan | climate)*'
            default: []
            selector: *button-entity-selector
          entity25_name:
            name: Button 25 name - LABEL (Optional)
            description: '* *Page "BUTTONPAGE04" - Label which should be displayed (10 characters are supported)*'
            default: []
            selector:
              text: {}
          entity25_icon:
            name: Button 25 - ICON (Optional)
            description: '* *Page "BUTTONPAGE04" - Icon which should be displayed (Default - an icon matching the entity will be set automatically)*'
            default: []
            selector: *icon-selector
          entity25_icon_color:
            name: Button 25 - ICON COLOR (Optional)
            description: '* *Page "BUTTONPAGE04" - Icon color which should be displayed when button is on*'
            default: [0,128,248] #1055 Blue
            selector: *color-selector
          entity25_confirm:
            name: Confirm execution of the button press - TRUE/FALSE (Optional)
            default: false
            description: '* *Page "BUTTONPAGE04" - Ask for confirmation to execute **Button25** action*'
            selector:
              boolean:
          entity26:
            name: Button 26 - ENTITY (Optional)
            description: '* *Page "BUTTONPAGE04" - Entity which should be switched (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor | fan | climate)*'
            default: []
            selector: *button-entity-selector
          entity26_name:
            name: Button 26 name - LABEL (Optional)
            description: '* *Page "BUTTONPAGE04" - Label which should be displayed (10 characters are supported)*'
            default: []
            selector:
              text: {}
          entity26_icon:
            name: Button 26 - ICON (Optional)
            description: '* *Page "BUTTONPAGE04" - Icon which should be displayed (Default - an icon matching the entity will be set automatically)*'
            default: []
            selector: *icon-selector
          entity26_icon_color:
            name: Button 26 - ICON COLOR (Optional)
            description: '* *Page "BUTTONPAGE04" - Icon color which should be displayed when button is on*'
            default: [0,128,248] #1055 Blue
            selector: *color-selector
          entity26_confirm:
            name: Confirm execution of the button press - TRUE/FALSE (Optional)
            default: false
            description: '* *Page "BUTTONPAGE04" - Ask for confirmation to execute **Button26** action*'
            selector:
              boolean:
          entity27:
            name: Button 27 - ENTITY (Optional)
            description: '* *Page "BUTTONPAGE04" - Entity which should be switched (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor | fan | climate)*'
            default: []
            selector: *button-entity-selector
          entity27_name:
            name: Button 27 name - LABEL (Optional)
            description: '* *Page "BUTTONPAGE04" - Label which should be displayed (10 characters are supported)*'
            default: []
            selector:
              text: {}
          entity27_icon:
            name: Button 27 - ICON (Optional)
            description: '* *Page "BUTTONPAGE04" - Icon which should be displayed (Default - an icon matching the entity will be set automatically)*'
            default: []
            selector: *icon-selector
          entity27_icon_color:
            name: Button 27 - ICON COLOR (Optional)
            description: '* *Page "BUTTONPAGE04" - Icon color which should be displayed when button is on*'
            default: [0,128,248] #1055 Blue
            selector: *color-selector
          entity27_confirm:
            name: Confirm execution of the button press - TRUE/FALSE (Optional)
            default: false
            description: '* *Page "BUTTONPAGE04" - Ask for confirmation to execute **Button27** action*'
            selector:
              boolean:
          entity28:
            name: Button 28 - ENTITY (Optional)
            description: '* *Page "BUTTONPAGE04" - Entity which should be switched (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor | fan | climate)*'
            default: []
            selector: *button-entity-selector
          entity28_name:
            name: Button 28 name - LABEL (Optional)
            description: '* *Page "BUTTONPAGE04" - Label which should be displayed (10 characters are supported)*'
            default: []
            selector:
              text: {}
          entity28_icon:
            name: Button 28 - ICON (Optional)
            description: '* *Page "BUTTONPAGE04" - Icon which should be displayed (Default - an icon matching the entity will be set automatically)*'
            default: []
            selector: *icon-selector
          entity28_icon_color:
            name: Button 28 - ICON COLOR (Optional)
            description: '* *Page "BUTTONPAGE04" - Icon color which should be displayed when button is on*'
            default: [0,128,248] #1055 Blue
            selector: *color-selector
          entity28_confirm:
            name: Confirm execution of the button press - TRUE/FALSE (Optional)
            default: false
            description: '* *Page "BUTTONPAGE04" - Ask for confirmation to execute **Button28** action*'
            selector:
              boolean:
          entity29:
            name: Button 29 - ENTITY (Optional)
            description: '* *Page "BUTTONPAGE04" - Entity which should be switched (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor | fan | climate)*'
            default: []
            selector: *button-entity-selector
          entity29_name:
            name: Button 29 name - LABEL (Optional)
            description: '* *Page "BUTTONPAGE04" - Label which should be displayed (10 characters are supported)*'
            default: []
            selector:
              text: {}
          entity29_icon:
            name: Button 29 - ICON (Optional)
            description: '* *Page "BUTTONPAGE04" - Icon which should be displayed (Default - an icon matching the entity will be set automatically)*'
            default: []
            selector: *icon-selector
          entity29_icon_color:
            name: Button 29 - ICON COLOR (Optional)
            description: '* *Page "BUTTONPAGE04" - Icon color which should be displayed when button is on*'
            default: [0,128,248] #1055 Blue
            selector: *color-selector
          entity29_confirm:
            name: Confirm execution of the button press - TRUE/FALSE (Optional)
            default: false
            description: '* *Page "BUTTONPAGE04" - Ask for confirmation to execute **Button29** action*'
            selector:
              boolean:
          entity30:
            name: Button 30 - ENTITY (Optional)
            description: '* *Page "BUTTONPAGE04" - Entity which should be switched (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor | fan | climate)*'
            default: []
            selector: *button-entity-selector
          entity30_name:
            name: Button 30 name - LABEL (Optional)
            description: '* *Page "BUTTONPAGE04" - Label which should be displayed (10 characters are supported)*'
            default: []
            selector:
              text: {}
          entity30_icon:
            name: Button 30 - ICON (Optional)
            description: '* *Page "BUTTONPAGE04" - Icon which should be displayed (Default - an icon matching the entity will be set automatically)*'
            default: []
            selector: *icon-selector
          entity30_icon_color:
            name: Button 30 - ICON COLOR (Optional)
            description: '* *Page "BUTTONPAGE04" - Icon color which should be displayed when button is on*'
            default: [0,128,248] #1055 Blue
            selector: *color-selector
          entity30_confirm:
            name: Confirm execution of the button press - TRUE/FALSE (Optional)
            default: false
            description: '* *Page "BUTTONPAGE04" - Ask for confirmation to execute **Button30** action*'
            selector:
              boolean:
          entity31:
            name: Button 31 - ENTITY (Optional)
            description: '* *Page "BUTTONPAGE04" - Entity which should be switched (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor | fan | climate)*'
            default: []
            selector: *button-entity-selector
          entity31_name:
            name: Button 31 name - LABEL (Optional)
            description: '* *Page "BUTTONPAGE04" - Label which should be displayed (10 characters are supported)*'
            default: []
            selector:
              text: {}
          entity31_icon:
            name: Button 31 - ICON (Optional)
            description: '* *Page "BUTTONPAGE04" - Icon which should be displayed (Default - an icon matching the entity will be set automatically)*'
            default: []
            selector: *icon-selector
          entity31_icon_color:
            name: Button 31 - ICON COLOR (Optional)
            description: '* *Page "BUTTONPAGE04" - Icon color which should be displayed when button is on*'
            default: [0,128,248] #1055 Blue
            selector: *color-selector
          entity31_confirm:
            name: Confirm execution of the button press - TRUE/FALSE (Optional)
            default: false
            description: '* *Page "BUTTONPAGE04" - Ask for confirmation to execute **Button31** action*'
            selector:
              boolean:
          entity32:
            name: Button 32 - ENTITY (Optional)
            description: '* *Page "BUTTONPAGE04" - Entity which should be switched (ONLY light | switch | cover | input_boolean | automation | button | input_button | scene | person | script | binary_sensor | fan | climate)*'
            default: []
            selector: *button-entity-selector
          entity32_name:
            name: Button 32 name - LABEL (Optional)
            description: '* *Page "BUTTONPAGE04" - Label which should be displayed (10 characters are supported)*'
            default: []
            selector: *icon-selector
          entity32_icon:
            name: Button 32 - ICON (Optional)
            description: '* *Page "BUTTONPAGE04" - Icon which should be displayed (Default - an icon matching the entity will be set automatically)*'
            default: []
            selector:
              text: {}
          entity32_icon_color:
            name: Button 32 - ICON COLOR (Optional)
            description: '* *Page "BUTTONPAGE04" - Icon color which should be displayed when button is on*'
            default: [0,128,248] #1055 Blue
            selector: *color-selector
          entity32_confirm:
            name: Confirm execution of the button press - TRUE/FALSE (Optional)
            default: false
            description: '* *Page "BUTTONPAGE04" - Ask for confirmation to execute **Button32** action*'
            selector:
              boolean:

    ##### Entity pages #####
      ##### Entity pages - Config #####
        ##### PLACEHOLDER ######################################################################
          placeholder11:
            name: 'Is only a placeholder without function for a better overview'
            description: '# ✅ ENTITY PAGE SETTINGS ✅ '
            default: 'entitypage'
            selector:
              select:
                options:
                  - entitypage
        ##### PLACEHOLDER ######################################################################
          entitypages_enabled:
            name: Activate entity page - TRUE/FALSE (Optional)
            default: false
            description: '* *"SYSTEM" - activate entity page and entity page Button on the home page* '
            selector:
              boolean:
          home_button06_icon:
            name: Entity page - ICON (Optional)
            description: '* *Page "HOME" - Icon which should be displayed (Default #EDCF) *'
            default:  #EDCF
            selector: *icon-selector
          home_button06_icon_color:
            name: Entity page - ICON COLOR (Optional)
            description: '* *Page "HOME" - Icon color which should be displayed (default color is set)*'
            default: [200,204,200] #52857 Grey super light
            selector: *color-selector
      ##### Entity pages - Labels #####
        ##### PLACEHOLDER ######################################################################
          placeholder12:
            name: 'Is only a placeholder without function for a better overview'
            description: '# ✅ ENTITY PAGE 01 ✅ '
            default: 'entitypage01'
            selector:
              select:
                options:
                  - entitypage01
        ##### PLACEHOLDER ######################################################################
          entity_page01_label:
            name: Entity page 01 name - LABEL (Optional)
            description: '* *Page "ENTITYPAGE01" - Label which should be displayed*'
            default: []
            selector:
              text: {}
          entity_page02_label:
            name: Entity page 02 name - LABEL (Optional)
            description: '* *Page "ENTITYPAGE02" - Label which should be displayed*'
            default: []
            selector:
              text: {}
          entity_page03_label:
            name: Entity page 03 name - LABEL (Optional)
            description: '* *Page "ENTITYPAGE03" - Label which should be displayed*'
            default: []
            selector:
              text: {}
          entity_page04_label:
            name: Entity page 04 name - LABEL (Optional)
            description: '* *Page "ENTITYPAGE04" - Label which should be displayed*'
            default: []
            selector:
              text: {}
      ##### Entity page 01 - Entities #####
          entities_entity01:
            name: Entity 01 - ENTITY (Optional)
            description: '* *Page "ENTITYPAGE01" - entity which should be displayed*'
            default: []
            selector:
              entity:
          entities_entity01_name:
            name: Entity 01 name - LABEL (Optional)
            description: '* *Page "ENTITYPAGE01" - Label which should be displayed (replaces the **"friendly_name"** of the entity)*'
            default: []
            selector:
              text: {}
          entities_entity01_icon:
            name: Entity 01 - ICON (Optional)
            description: '* *Page "BUTTONPAGE01" - Icon which should be displayed (if not set, no icon is shown)*'
            default: []
            selector: *icon-selector
          entities_entity02:
            name: Entity 02 - ENTITY (Optional)
            description: '* *Page "ENTITYPAGE01" - entity which should be displayed*'
            default: []
            selector:
              entity:
          entities_entity02_name:
            name: Entity 02 name - LABEL (Optional)
            description: '* *Page "ENTITYPAGE01" - Label which should be displayed (replaces the **"friendly_name"** of the entity)*'
            default: []
            selector:
              text: {}
          entities_entity02_icon:
            name: Entity 02 - ICON (Optional)
            description: '* *Page "BUTTONPAGE01" - Icon which should be displayed (if not set, no icon is shown)*'
            default: []
            selector: *icon-selector
          entities_entity03:
            name: Entity 03 - ENTITY (Optional)
            description: '* *Page "ENTITYPAGE01" - entity which should be displayed*'
            default: []
            selector:
              entity:
          entities_entity03_name:
            name: Entity 03 name - LABEL (Optional)
            description: '* *Page "ENTITYPAGE01" - Label which should be displayed (replaces the **"friendly_name"** of the entity)*'
            default: []
            selector:
              text: {}
          entities_entity03_icon:
            name: Entity 03 - ICON (Optional)
            description: '* *Page "BUTTONPAGE01" - Icon which should be displayed (if not set, no icon is shown)*'
            default: []
            selector: *icon-selector
          entities_entity04:
            name: Entity 04 - ENTITY (Optional)
            description: '* *Page "ENTITYPAGE01" - entity which should be displayed*'
            default: []
            selector:
              entity:
          entities_entity04_name:
            name: Entity 04 name - LABEL (Optional)
            description: '* *Page "ENTITYPAGE01" - Label which should be displayed (replaces the **"friendly_name"** of the entity)*'
            default: []
            selector:
              text: {}
          entities_entity04_icon:
            name: Entity 04 - ICON (Optional)
            description: '* *Page "BUTTONPAGE01" - Icon which should be displayed (if not set, no icon is shown)*'
            default: []
            selector: *icon-selector
          entities_entity05:
            name: Entity 05 - ENTITY (Optional)
            description: '* *Page "ENTITYPAGE01" - entity which should be displayed*'
            default: []
            selector:
              entity:
          entities_entity05_name:
            name: Entity 05 name - LABEL (Optional)
            description: '* *Page "ENTITYPAGE01" - Label which should be displayed (replaces the **"friendly_name"** of the entity)*'
            default: []
            selector:
              text: {}
          entities_entity05_icon:
            name: Entity 05 - ICON (Optional)
            description: '* *Page "BUTTONPAGE01" - Icon which should be displayed (if not set, no icon is shown)*'
            default: []
            selector: *icon-selector
          entities_entity06:
            name: Entity 06 - ENTITY (Optional)
            description: '* *Page "ENTITYPAGE01" - entity which should be displayed*'
            default: []
            selector:
              entity:
          entities_entity06_name:
            name: Entity 06 name - LABEL (Optional)
            description: '* *Page "ENTITYPAGE01" - Label which should be displayed (replaces the **"friendly_name"** of the entity)*'
            default: []
            selector:
              text: {}
          entities_entity06_icon:
            name: Entity 06 - ICON (Optional)
            description: '* *Page "BUTTONPAGE01" - Icon which should be displayed (if not set, no icon is shown)*'
            default: []
            selector: *icon-selector
          entities_entity07:
            name: Entity 07 - ENTITY (Optional)
            description: '* *Page "ENTITYPAGE01" - entity which should be displayed*'
            default: []
            selector:
              entity:
          entities_entity07_name:
            name: Entity 07 name - LABEL (Optional)
            description: '* *Page "ENTITYPAGE01" - Label which should be displayed (replaces the **"friendly_name"** of the entity)*'
            default: []
            selector:
              text: {}
          entities_entity07_icon:
            name: Entity 07 - ICON (Optional)
            description: '* *Page "BUTTONPAGE01" - Icon which should be displayed (if not set, no icon is shown)*'
            default: []
            selector: *icon-selector
          entities_entity08:
            name: Entity 08 - ENTITY (Optional)
            description: '* *Page "ENTITYPAGE01" - entity which should be displayed*'
            default: []
            selector:
              entity:
          entities_entity08_name:
            name: Entity 08 name - LABEL (Optional)
            description: '* *Page "ENTITYPAGE01" - Label which should be displayed (replaces the **"friendly_name"** of the entity)*'
            default: []
            selector:
              text: {}
          entities_entity08_icon:
            name: Entity 08 - ICON (Optional)
            description: '* *Page "BUTTONPAGE01" - Icon which should be displayed (if not set, no icon is shown)*'
            default: []
            selector: *icon-selector
      ##### Entity page 02 - Entities #####
        ##### PLACEHOLDER ######################################################################
          placeholder13:
            name: 'Is only a placeholder without function for a better overview'
            description: '# ✅ ENTITY PAGE 02 ✅ '
            default: 'entitypage02'
            selector:
              select:
                options:
                  - entitypage02
        ##### PLACEHOLDER ######################################################################
          entities_entity09:
            name: Entity 09 - ENTITY (Optional)
            description: '* *Page "ENTITYPAGE02" - entity which should be displayed*'
            default: []
            selector:
              entity:
          entities_entity09_name:
            name: Entity 09 name - LABEL (Optional)
            description: '* *Page "ENTITYPAGE02" - Label which should be displayed (replaces the **"friendly_name"** of the entity)*'
            default: []
            selector:
              text: {}
          entities_entity09_icon:
            name: Entity 09 - ICON (Optional)
            description: '* *Page "BUTTONPAGE02" - Icon which should be displayed (if not set, no icon is shown)*'
            default: []
            selector: *icon-selector
          entities_entity10:
            name: Entity 10 - ENTITY (Optional)
            description: '* *Page "ENTITYPAGE02" - entity which should be displayed*'
            default: []
            selector:
              entity:
          entities_entity10_name:
            name: Entity 10 name - LABEL (Optional)
            description: '* *Page "ENTITYPAGE02" - Label which should be displayed (replaces the **"friendly_name"** of the entity)*'
            default: []
            selector:
              text: {}
          entities_entity10_icon:
            name: Entity 10 - ICON (Optional)
            description: '* *Page "BUTTONPAGE02" - Icon which should be displayed (if not set, no icon is shown)*'
            default: []
            selector: *icon-selector
          entities_entity11:
            name: Entity 11 - ENTITY (Optional)
            description: '* *Page "ENTITYPAGE02" - entity which should be displayed*'
            default: []
            selector:
              entity:
          entities_entity11_name:
            name: Entity 11 name - LABEL (Optional)
            description: '* *Page "ENTITYPAGE02" - Label which should be displayed (replaces the **"friendly_name"** of the entity)*'
            default: []
            selector:
              text: {}
          entities_entity11_icon:
            name: Entity 11 - ICON (Optional)
            description: '* *Page "BUTTONPAGE02" - Icon which should be displayed (if not set, no icon is shown)*'
            default: []
            selector: *icon-selector
          entities_entity12:
            name: Entity 12 - ENTITY (Optional)
            description: '* *Page "ENTITYPAGE02" - entity which should be displayed*'
            default: []
            selector:
              entity:
          entities_entity12_name:
            name: Entity 12 name - LABEL (Optional)
            description: '* *Page "ENTITYPAGE02" - Label which should be displayed (replaces the **"friendly_name"** of the entity)*'
            default: []
            selector:
              text: {}
          entities_entity12_icon:
            name: Entity 12 - ICON (Optional)
            description: '* *Page "BUTTONPAGE02" - Icon which should be displayed (if not set, no icon is shown)*'
            default: []
            selector: *icon-selector
          entities_entity13:
            name: Entity 13 - ENTITY (Optional)
            description: '* *Page "ENTITYPAGE02" - entity which should be displayed*'
            default: []
            selector:
              entity:
          entities_entity13_name:
            name: Entity 13 name - LABEL (Optional)
            description: '* *Page "ENTITYPAGE02" - Label which should be displayed (replaces the **"friendly_name"** of the entity)*'
            default: []
            selector:
              text: {}
          entities_entity13_icon:
            name: Entity 13 - ICON (Optional)
            description: '* *Page "BUTTONPAGE02" - Icon which should be displayed (if not set, no icon is shown)*'
            default: []
            selector: *icon-selector
          entities_entity14:
            name: Entity 14 - ENTITY (Optional)
            description: '* *Page "ENTITYPAGE02" - entity which should be displayed*'
            default: []
            selector:
              entity:
          entities_entity14_name:
            name: Entity 14 name - LABEL (Optional)
            description: '* *Page "ENTITYPAGE02" - Label which should be displayed (replaces the **"friendly_name"** of the entity)*'
            default: []
            selector:
              text: {}
          entities_entity14_icon:
            name: Entity 14 - ICON (Optional)
            description: '* *Page "BUTTONPAGE02" - Icon which should be displayed (if not set, no icon is shown)*'
            default: []
            selector: *icon-selector
          entities_entity15:
            name: Entity 15 - ENTITY (Optional)
            description: '* *Page "ENTITYPAGE02" - entity which should be displayed*'
            default: []
            selector:
              entity:
          entities_entity15_name:
            name: Entity 15 name - LABEL (Optional)
            description: '* *Page "ENTITYPAGE02" - Label which should be displayed (replaces the **"friendly_name"** of the entity)*'
            default: []
            selector:
              text: {}
          entities_entity15_icon:
            name: Entity 15 - ICON (Optional)
            description: '* *Page "BUTTONPAGE02" - Icon which should be displayed (if not set, no icon is shown)*'
            default: []
            selector: *icon-selector
          entities_entity16:
            name: Entity 16 - ENTITY (Optional)
            description: '* *Page "ENTITYPAGE02" - entity which should be displayed*'
            default: []
            selector:
              entity:
          entities_entity16_name:
            name: Entity 16 name - LABEL (Optional)
            description: '* *Page "ENTITYPAGE02" - Label which should be displayed (replaces the **"friendly_name"** of the entity)*'
            default: []
            selector:
              text: {}
          entities_entity16_icon:
            name: Entity 16 - ICON (Optional)
            description: '* *Page "BUTTONPAGE02" - Icon which should be displayed (if not set, no icon is shown)*'
            default: []
            selector: *icon-selector
      ##### Entity page 03 - Entities #####
        ##### PLACEHOLDER ######################################################################
          placeholder14:
            name: 'Is only a placeholder without function for a better overview'
            description: '# ✅ ENTITY PAGE 03 ✅ '
            default: 'entitypage03'
            selector:
              select:
                options:
                  - entitypage03
        ##### PLACEHOLDER ######################################################################
          entities_entity17:
            name: Entity 17 - ENTITY (Optional)
            description: '* *Page "ENTITYPAGE03" - entity which should be displayed*'
            default: []
            selector:
              entity:
          entities_entity17_name:
            name: Entity 17 name - LABEL (Optional)
            description: '* *Page "ENTITYPAGE03" - Label which should be displayed (replaces the **"friendly_name"** of the entity)*'
            default: []
            selector:
              text: {}
          entities_entity17_icon:
            name: Entity 17 - ICON (Optional)
            description: '* *Page "BUTTONPAGE03" - Icon which should be displayed (if not set, no icon is shown)*'
            default: []
            selector: *icon-selector
          entities_entity18:
            name: Entity 18 - ENTITY (Optional)
            description: '* *Page "ENTITYPAGE03" - entity which should be displayed*'
            default: []
            selector:
              entity:
          entities_entity18_name:
            name: Entity 18 name - LABEL (Optional)
            description: '* *Page "ENTITYPAGE03" - Label which should be displayed (replaces the **"friendly_name"** of the entity)*'
            default: []
            selector:
              text: {}
          entities_entity18_icon:
            name: Entity 18 - ICON (Optional)
            description: '* *Page "BUTTONPAGE03" - Icon which should be displayed (if not set, no icon is shown)*'
            default: []
            selector: *icon-selector
          entities_entity19:
            name: Entity 19 - ENTITY (Optional)
            description: '* *Page "ENTITYPAGE03" - entity which should be displayed*'
            default: []
            selector:
              entity:
          entities_entity19_name:
            name: Entity 19 name - LABEL (Optional)
            description: '* *Page "ENTITYPAGE03" - Label which should be displayed (replaces the **"friendly_name"** of the entity)*'
            default: []
            selector:
              text: {}
          entities_entity19_icon:
            name: Entity 19 - ICON (Optional)
            description: '* *Page "BUTTONPAGE03" - Icon which should be displayed (if not set, no icon is shown)*'
            default: []
            selector: *icon-selector
          entities_entity20:
            name: Entity 20 - ENTITY (Optional)
            description: '* *Page "ENTITYPAGE03" - entity which should be displayed*'
            default: []
            selector:
              entity:
          entities_entity20_name:
            name: Entity 20 name - LABEL (Optional)
            description: '* *Page "ENTITYPAGE03" - Label which should be displayed (replaces the **"friendly_name"** of the entity)*'
            default: []
            selector:
              text: {}
          entities_entity20_icon:
            name: Entity 20 - ICON (Optional)
            description: '* *Page "BUTTONPAGE03" - Icon which should be displayed (if not set, no icon is shown)*'
            default: []
            selector: *icon-selector
          entities_entity21:
            name: Entity 21 - ENTITY (Optional)
            description: '* *Page "ENTITYPAGE03" - entity which should be displayed*'
            default: []
            selector:
              entity:
          entities_entity21_name:
            name: Entity 21 name - LABEL (Optional)
            description: '* *Page "ENTITYPAGE03" - Label which should be displayed (replaces the **"friendly_name"** of the entity)*'
            default: []
            selector:
              text: {}
          entities_entity21_icon:
            name: Entity 21 - ICON (Optional)
            description: '* *Page "BUTTONPAGE03" - Icon which should be displayed (if not set, no icon is shown)*'
            default: []
            selector: *icon-selector
          entities_entity22:
            name: Entity 22 - ENTITY (Optional)
            description: '* *Page "ENTITYPAGE03" - entity which should be displayed*'
            default: []
            selector:
              entity:
          entities_entity22_name:
            name: Entity 22 name - LABEL (Optional)
            description: '* *Page "ENTITYPAGE03" - Label which should be displayed (replaces the **"friendly_name"** of the entity)*'
            default: []
            selector:
              text: {}
          entities_entity22_icon:
            name: Entity 22 - ICON (Optional)
            description: '* *Page "BUTTONPAGE03" - Icon which should be displayed (if not set, no icon is shown)*'
            default: []
            selector: *icon-selector
          entities_entity23:
            name: Entity 23 - ENTITY (Optional)
            description: '* *Page "ENTITYPAGE03" - entity which should be displayed*'
            default: []
            selector:
              entity:
          entities_entity23_name:
            name: Entity 23 name - LABEL (Optional)
            description: '* *Page "ENTITYPAGE03" - Label which should be displayed (replaces the **"friendly_name"** of the entity)*'
            default: []
            selector:
              text: {}
          entities_entity23_icon:
            name: Entity 23 - ICON (Optional)
            description: '* *Page "BUTTONPAGE03" - Icon which should be displayed (if not set, no icon is shown)*'
            default: []
            selector: *icon-selector
          entities_entity24:
            name: Entity 24 - ENTITY (Optional)
            description: '* *Page "ENTITYPAGE03" - entity which should be displayed*'
            default: []
            selector:
              entity:
          entities_entity24_name:
            name: Entity 24 name - LABEL (Optional)
            description: '* *Page "ENTITYPAGE03" - Label which should be displayed (replaces the **"friendly_name"** of the entity)*'
            default: []
            selector:
              text: {}
          entities_entity24_icon:
            name: Entity 24 - ICON (Optional)
            description: '* *Page "BUTTONPAGE03" - Icon which should be displayed (if not set, no icon is shown)*'
            default: []
            selector: *icon-selector
      ##### Entity page 04 - Entities #####
        ##### PLACEHOLDER ######################################################################
          placeholder15:
            name: 'Is only a placeholder without function for a better overview'
            description: '# ✅ ENTITY PAGE 04 ✅ '
            default: 'entitypage04'
            selector:
              select:
                options:
                  - entitypage04
        ##### PLACEHOLDER ######################################################################
          entities_entity25:
            name: Entity 25 - ENTITY (Optional)
            description: '* *Page "ENTITYPAGE04" - entity which should be displayed*'
            default: []
            selector:
              entity:
          entities_entity25_name:
            name: Entity 25 name - LABEL (Optional)
            description: '* *Page "ENTITYPAGE04" - Label which should be displayed (replaces the **"friendly_name"** of the entity)*'
            default: []
            selector:
              text: {}
          entities_entity25_icon:
            name: Entity 25 - ICON (Optional)
            description: '* *Page "BUTTONPAGE04" - Icon which should be displayed (if not set, no icon is shown)*'
            default: []
            selector: *icon-selector
          entities_entity26:
            name: Entity 26 - ENTITY (Optional)
            description: '* *Page "ENTITYPAGE04" - entity which should be displayed*'
            default: []
            selector:
              entity:
          entities_entity26_name:
            name: Entity 26 name - LABEL (Optional)
            description: '* *Page "ENTITYPAGE04" - Label which should be displayed (replaces the **"friendly_name"** of the entity)*'
            default: []
            selector:
              text: {}
          entities_entity26_icon:
            name: Entity 26 - ICON (Optional)
            description: '* *Page "BUTTONPAGE04" - Icon which should be displayed (if not set, no icon is shown)*'
            default: []
            selector: *icon-selector
          entities_entity27:
            name: Entity 27 - ENTITY (Optional)
            description: '* *Page "ENTITYPAGE04" - entity which should be displayed*'
            default: []
            selector:
              entity:
          entities_entity27_name:
            name: Entity 27 name - LABEL (Optional)
            description: '* *Page "ENTITYPAGE04" - Label which should be displayed (replaces the **"friendly_name"** of the entity)*'
            default: []
            selector:
              text: {}
          entities_entity27_icon:
            name: Entity 27 - ICON (Optional)
            description: '* *Page "BUTTONPAGE04" - Icon which should be displayed (if not set, no icon is shown)*'
            default: []
            selector: *icon-selector
          entities_entity28:
            name: Entity 28 - ENTITY (Optional)
            description: '* *Page "ENTITYPAGE04" - entity which should be displayed*'
            default: []
            selector:
              entity:
          entities_entity28_name:
            name: Entity 28 name - LABEL (Optional)
            description: '* *Page "ENTITYPAGE04" - Label which should be displayed (replaces the **"friendly_name"** of the entity)*'
            default: []
            selector:
              text: {}
          entities_entity28_icon:
            name: Entity 28 - ICON (Optional)
            description: '* *Page "BUTTONPAGE04" - Icon which should be displayed (if not set, no icon is shown)*'
            default: []
            selector: *icon-selector
          entities_entity29:
            name: Entity 29 - ENTITY (Optional)
            description: '* *Page "ENTITYPAGE04" - entity which should be displayed*'
            default: []
            selector:
              entity:
          entities_entity29_name:
            name: Entity 29 name - LABEL (Optional)
            description: '* *Page "ENTITYPAGE04" - Label which should be displayed (replaces the **"friendly_name"** of the entity)*'
            default: []
            selector:
              text: {}
          entities_entity29_icon:
            name: Entity 29 - ICON (Optional)
            description: '* *Page "BUTTONPAGE04" - Icon which should be displayed (if not set, no icon is shown)*'
            default: []
            selector: *icon-selector
          entities_entity30:
            name: Entity 30 - ENTITY (Optional)
            description: '* *Page "ENTITYPAGE04" - entity which should be displayed*'
            default: []
            selector:
              entity:
          entities_entity30_name:
            name: Entity 30 name - LABEL (Optional)
            description: '* *Page "ENTITYPAGE04" - Label which should be displayed (replaces the **"friendly_name"** of the entity)*'
            default: []
            selector:
              text: {}
          entities_entity30_icon:
            name: Entity 30 - ICON (Optional)
            description: '* *Page "BUTTONPAGE04" - Icon which should be displayed (if not set, no icon is shown)*'
            default: []
            selector: *icon-selector
          entities_entity31:
            name: Entity 31 - ENTITY (Optional)
            description: '* *Page "ENTITYPAGE04" - entity which should be displayed*'
            default: []
            selector:
              entity:
          entities_entity31_name:
            name: Entity 31 name - LABEL (Optional)
            description: '* *Page "ENTITYPAGE04" - Label which should be displayed (replaces the **"friendly_name"** of the entity)*'
            default: []
            selector:
              text: {}
          entities_entity31_icon:
            name: Entity 31 - ICON (Optional)
            description: '* *Page "BUTTONPAGE04" - Icon which should be displayed (if not set, no icon is shown)*'
            default: []
            selector: *icon-selector
          entities_entity32:
            name: Entity 32 - ENTITY (Optional)
            description: '* *Page "ENTITYPAGE04" - entity which should be displayed*'
            default: []
            selector:
              entity:
          entities_entity32_name:
            name: Entity 32 name - LABEL (Optional)
            description: '* *Page "ENTITYPAGE04" - Label which should be displayed (replaces the **"friendly_name"** of the entity)*'
            default: []
            selector:
              text: {}
          entities_entity32_icon:
            name: Entity 32 - ICON (Optional)
            description: '* *Page "BUTTONPAGE04" - Icon which should be displayed (if not set, no icon is shown)*'
            default: []
            selector: *icon-selector

    ##### General Custom Design #####
        ##### PLACEHOLDER ######################################################################
          placeholder16:
            name: 'Is only a placeholder without function for a better overview'
            description: '# ✅ CUSTOM CONFIGURATION ✅ '
            default: 'configuration'
            selector:
              select:
                options:
                  - configuration
        ##### PLACEHOLDER ######################################################################
          home_button04_icon:
            name: Notification - ICON (Optional)
            description: '* *Page "HOME" - Icon which should be displayed (Default #E1ED) *'
            default:   #E1ED
            selector: *icon-selector
          home_button04_icon_color01:
            name: Notification read - ICON COLOR (Optional)
            description: '* *Page "HOME" - Icon color which should be displayed (default color is set)*'
            default: [200,204,200] #52857 Grey super light  #Grey super light
            selector: *color-selector
          home_button04_icon_color02:
            name: Notification unread - ICON COLOR (Optional)
            description: '* *Page "HOME" - Icon color which should be displayed (default color is set)*'
            default: [248,0,0] #63488 Red
            selector: *color-selector
          relay01_icon:
            name: Relay 01 - ICON (Optional)
            description: '* *Page "HOME" - Icon which should be displayed (Default #E3A5) *'
            default:   #E3A5
            selector: *icon-selector
          relay01_icon_color:
            name: Relay 01 - ICON COLOR (Optional)
            description: '* *Page "HOME" - Icon color which should be displayed (default color is set)*'
            default: [128,128,128] #33808 Grey light
            selector: *color-selector
          relay02_icon:
            name: Relay 02 - ICON (Optional)
            description: '* *Page "HOME" - Icon which should be displayed (Default #E3A8) *'
            default:   #E3A8
            selector: *icon-selector
          relay02_icon_color:
            name: Relay - ICON COLOR (Optional)
            description: '* *Page "HOME" - Icon color which should be displayed (default color is set)*'
            default: [128,128,128] #33808 Grey light
            selector: *color-selector
          thermostat_icon:
            name: Thermostat - ICON (Optional)
            description: '* *Page "HOME" - Icon which should be displayed (Default #E50E) *'
            default:   #E50E
            selector: *icon-selector
          heat_icon:
            name: Thermostat - ICON (Optional)
            description: '* *Page "HOME" - Icon which should be displayed (Default #E50F) *'
            default:   #E50F
            selector: *icon-selector
          thermostat_icon_color:
            name: Thermostat / Heat - ICON COLOR (Optional)
            description: '* *Page "HOME" - Icon color which should be displayed (default color is set)*'
            default: [128,128,128] #33808 Grey light
            selector: *color-selector
          time_label_color:
            name: Time - LABEL COLOR (Optional)
            description: '* *Page "HOME" - Label color which should be displayed (default color is set)*'
            default: [255,255,255] #65535 White
            selector: *color-selector
          date_label_color:
            name: Date - LABEL COLOR (Optional)
            description: '* *Page "HOME" - Label color which should be displayed (default color is set)*'
            default: [255,255,255] #65535 White
            selector: *color-selector

        ###### Muss noch Raus ###############################################################################################################################################################################
          hotwatertemp:
            name: Hot Water Temperature Sensor (Optional)
            description: '* *Choose your hot water sensor*'
            default: []
            selector:
              entity:
                domain:
                  - sensor
          tft_path:
            name: Nextion TFT File Folder (Optional)
            description: '* *TFT Path where the Nextion TFT File is stored. Attention! The **"Folder-Watcher"** must also be configured in the configuration.yaml. **Only necessary for manual upload of TFT file in ESPHome Advaced mode.** See HowTo*'
            default: []
            selector:
              text: {}
          sync_value_ha:
            name: Synchronization of all values (Optional)
            description: '* *Synchronization of values between HA and NSPanel for Lightsetting and Coversetting Page -> Maybe causes number jumps*'
            default: 'select_no'
            selector: &sync-selector-bool
              select:
                options:
                  - label: 'No'
                    value: select_no
                  - label: 'Yes'
                    value: select_yes
          sync_slider_ha:
            name: Synchronization of all Sliders (Optional)
            description: '* *Synchronization of sliders between HA and NSPanel for Lightsetting and Coversetting Page -> Maybe causes flickering on the Slider*'
            default: 'select_no'
            selector: *sync-selector-bool

#############################################################
##### CLOSE - INPUT #####
#############################################################

mode: parallel
max: 5000
trace:
  stored_traces: 10

#############################################################
##### START - Variables #####
#############################################################

trigger_variables:
  nspanel_name: !input "nspanel_name"
  last_click: "sensor.{{ nspanel_name }}_last_click"
  last_click_lightsettings: "sensor.{{ nspanel_name }}_last_click_lightsettings"
  last_click_coversettings: "sensor.{{ nspanel_name }}_last_click_coversettings"
  last_click_climatesettings: "sensor.{{ nspanel_name }}_last_click_climatesettings"
  left_button: "binary_sensor.{{ nspanel_name }}_left_button"
  right_button: "binary_sensor.{{ nspanel_name }}_right_button"
  weather_forcast_button: "binary_sensor.{{ nspanel_name }}_weather_forcast"
  nextion_inited_trigger: "switch.{{ nspanel_name }}_nextion_inited"
  # current_page: "sensor.{{ nspanel_name }}_current_page"
  current_page: "sensor.{{ nspanel_name }}_currentpage"
  hotwatercharge: !input "hotwatercharge"
  display_target_temperature: "sensor.{{ nspanel_name }}_display_target_temperature"
  relay01_entity: "switch.{{ nspanel_name }}_relay_1"
  relay02_entity: "switch.{{ nspanel_name }}_relay_2"
  nspaneltemp: "sensor.{{ nspanel_name }}_temperature"
  settings_entity: "sensor.{{ nspanel_name }}_settings_entity"
  reboot_button: "button.{{ nspanel_name }}_restart"

  ##### notification Trigger #####
  notification_unread: "switch.{{ nspanel_name }}_notification_unread"
  notification_text: "sensor.{{ nspanel_name }}_notification_text"
  notification_label: "sensor.{{ nspanel_name }}_notification_label"

variables:
  ##### GENERAL #####
  blueprint_version: "3.2.3DEV"
  language: !input "language"
  time_format: !input "time_format"
  time: "{{ as_timestamp(now()) | timestamp_custom(time_format) }}"
  meridiem: "{{ as_timestamp(now()) | timestamp_custom('%p') if time_format == '%-I:%M' else '' }}"
  sun_is_up: "{{ is_state('sun.sun', 'above_horizon') }}"

  notification_sound: "switch.{{ nspanel_name }}_notification_sound"
  confirmation_message: "switch.{{ nspanel_name }}_confirmation_message"

  ##### Nextion dict ####
  nextion:
    colors:
      blue: "1055"              # rgb(0,128,248)
      grey_dark: "10597"        # rgb(40,44,40)
      grey_light: "33808"       # rgb(128,128,128)
      grey_super_light: "52857" # rgb(200,204,200)
      red: "63488"              # rgb(248,0,0)
      white: "65535"            # rgb(255,255,255)
      yellow: "65472"           # rgb(248,248,0)
    commands:
      text_printf: "esphome.{{ nspanel_name }}_send_command_text_printf"
      value: "esphome.{{ nspanel_name }}_send_command_value"
      printf: "esphome.{{ nspanel_name }}_send_command_printf"
      font_color: "esphome.{{ nspanel_name }}_send_command_font_color"
      background_color: "esphome.{{ nspanel_name }}_send_command_background_color"
      thermostat_cycle: "esphome.{{ nspanel_name }}_send_thermostat_cycle_state"
      notification_show: "esphome.{{ nspanel_name }}_notification_show"
      notification_clear: "esphome.{{ nspanel_name }}_notification_clear"
      play_rtttl: "esphome.{{ nspanel_name }}_play_rtttl"
      set_settings_entity: "esphome.{{ nspanel_name }}_set_settings_entity"
      show_all: "esphome.{{ nspanel_name }}_send_command_show_all"
      tft_upload: "esphome.{{ nspanel_name }}_upload_tft"
      set_button: "esphome.{{ nspanel_name }}_set_button"
    icons:
      battery: "\U0000F2A1" #F2A1
      blank: "\U0000FFFF" #blank macbook bug
      buttons:
        automation: "\U0000F6FC" #F6FC
        binary_sensor: "\U0000E7C0"  #E7C0
        button: "\U0000ED76" #ED76
        climate: "\U0000E392"  #E392
        cover: "\U0000E0AB"  #E0AB
        fan: "\U0000E20F"  #E20F
        input_boolean: "\U0000EA19" #EA19
        input_button: "\U0000F2A7" #F2A7
        light: "\U0000E334"  #E334
        person: "\U0000E003" #E003
        scene: "\U0000EE0B"  #EE0B
        script: "\U0000F45D" #F45D
        switch: "\U0000E97D" #E97D
        unknown: "\U00000E27" #E027
      weather:
        lightning: "\U0000E592" #E592
        protect: "\U0000F05C" #F05C
        rain: "\U0000E595" #E595
        sun: "\U0000E5A7" #E5A7
        wind: "\U0000E59C" #E59C
    pages:
      home: "home"
      weatherpages:
        - "weather01"
        - "weather02"
        - "weather03"
        - "weather04"
        - "weather05"
      climate: "climate"
      settings: "settings"
      boot: "boot"
      screensaver: "screensaver"
      light: "lightsettings"
      cover: "coversettings"
      buttonpages:
        - "buttonpage01"
        - "buttonpage02"
        - "buttonpage03"
        - "buttonpage04"
      notification: "notification"
      qrcode: "qrcode"
      entitypages:
        - "entitypage01"
        - "entitypage02"
        - "entitypage03"
        - "entitypage04"
      current: "{{ states(current_page) | default('unavailable') if current_page is string else 'unavailable' }}"
    pics:
      hvac:
        button:
          blank: "79"
          'off': "80"
          'on': "81"
          unknown: "79"
      hardware:
        button:
          "off": "77"
          "on": "78"
      button:
        'off': "101"
        'on': "102"
      heating:
        button:
          "off": "82"
          "on": "83"
      weather:
        sunny: "{{ '2' if sun_is_up else '15'}}" #some weather providers returns 'sunny' for 'clear-night'
        cloudy: "3"
        rainy: "4"
        pouring: "5"
        snowy: "6"
        hail: "7"
        snowy_rainy: "7"
        fog: "8"
        windy: "9"
        windy_variant: "9"
        windy-variant: "9"
        lightning: "10"
        partlycloudy: "{{ '11' if sun_is_up else '12'}}"
        lightning_rainy: "{{ '13' if sun_is_up else '14'}}"
        execptional: "{{ '13' if sun_is_up else '14'}}"
        clear_night: "15"
        clear-night: "15"
        unknown: ''
        unavailable: ''

  ##### MUI Multilingual User Interface #####
  mui:
    BGR:
      weekdays:
        mon: Понеделник
        tue: Вторник
        wed: Сряда
        thu: Четвъртък
        fri: Петък
        sat: Събота
        sun: Неделя
      relative_day:
        today: Днес
        tomorrow: Утре
        in_2_days: за 2 дни
        in_3_days: за 3 дни
        in_4_days: за 4 дни
      climate:
        states:
          "on": на
          "off": изключване
        heat: топлина
      please_confirm: Моля, потвърдете
      unavailable: Unavailable
      no_name: No name
    CZE:
      weekdays:
        mon: Pondělí
        tue: Úterý
        wed: Středa
        thu: Čtvrtek
        fri: Pátek
        sat: Sobota
        sun: Neděle
      relative_day:
        today: Dnes
        tomorrow: Zítra
        in_2_days: za 2 dny
        in_3_days: za 3 dny
        in_4_days: za 4 dny
      climate:
        states:
          "on": zapnuto
          "off": vypnuto
        heat: topení
      please_confirm: Potvrďte prosím
      unavailable: Unavailable
      no_name: No name
    DEU:
      weekdays:
        mon: Montag
        tue: Dienstag
        wed: Mittwoch
        thu: Donnerstag
        fri: Freitag
        sat: Samstag
        sun: Sonntag
      relative_day:
        today: Heute
        tomorrow: Morgen
        in_2_days: in 2 Tagen
        in_3_days: in 3 Tagen
        in_4_days: in 4 Tagen
      climate:
        states:
          "on": ein
          "off": aus
        heat: heizen
      please_confirm: Bitte bestätigen
      unavailable: Unavailable
      no_name: No name
    DNK:
      weekdays:
        mon: Mandag
        tue: Tirsdag
        wed: Onsdag
        thu: Torsdag
        fri: Fredag
        sat: Lørdag
        sun: Søndag
      relative_day:
        today: I dag
        tomorrow: I morgen
        in_2_days: om 2 dage
        in_3_days: om 3 dage
        in_4_days: om 4 dage
      climate:
        states:
          "on": på
          "off": off
        heat: varme
      please_confirm: Bekræft venligst
      unavailable: Unavailable
      no_name: No name
    ENG:
      weekdays:
        mon: Monday
        tue: Tuesday
        wed: Wednesday
        thu: Thursday
        fri: Friday
        sat: Saturday
        sun: Sunday
      relative_day:
        today: Today
        tomorrow: Tomorrow
        in_2_days: In 2 days
        in_3_days: In 3 days
        in_4_days: In 4 days
      climate:
        states:
          "on": on
          "off": off
        heat: heat
      please_confirm: Please confirm
      unavailable: Unavailable
      no_name: No name
    ESP:
      weekdays:
        mon: Lunes
        tue: Martes
        wed: Miércoles
        thu: Jueves
        fri: Viernes
        sat: Sábado
        sun: Domingo
      relative_day:
        today: Hoy
        tomorrow: Mañana
        in_2_days: En 2 días
        in_3_days: En 3 días
        in_4_days: En 4 días
      climate:
        states:
          "on": Encendido
          "off": Apagado
        heat: calor
      please_confirm: Por favor, confirme
      unavailable: Indisponible
      no_name: Sin nombre
    EST:
      weekdays:
        mon: Esmaspäev
        tue: Teisipäev
        wed: Kolmapäev
        thu: Neljapäev
        fri: Reede
        sat: Laupäev
        sun: Pühapäev
      relative_day:
        today: Täna
        tomorrow: Homme
        in_2_days: 2 päeva pärast
        in_3_days: 3 päeva pärast
        in_4_days: 4 päeva pärast
      climate:
        states:
          "on": aadressil
          "off": välja
        heat: soojus
      please_confirm: Palun kinnitage
      unavailable: Unavailable
      no_name: No name
    FIN:
      weekdays:
        mon: Maanantai
        tue: Tiistai
        wed: Keskiviikko
        thu: Torstai
        fri: Perjantai
        sat: Lauantai
        sun: Sunnuntai
      relative_day:
        today: Tänään
        tomorrow: Huomenna
        in_2_days: 2 päivän päästä
        in_3_days: 3 päivän päästä
        in_4_days: 4 päivän päästä
      climate:
        states:
          "on": osoitteessa
          "off": off
        heat: lämpö
      please_confirm: Vahvistakaa
      unavailable: Unavailable
      no_name: No name
    FRA:
      weekdays:
        mon: Lundi
        tue: Mardi
        wed: Mercredi
        thu: Jeudi
        fri: Vendredi
        sat: Samedi
        sun: Dimanche
      relative_day:
        today: Aujourd hui
        tomorrow: Demain
        in_2_days: Dans 2 jours
        in_3_days: Dans 3 jours
        in_4_days: Dans 4 jours
      climate:
        states:
          "on": on
          "off": off
        heat: Chaleur
      please_confirm: Veuillez confirmer
      unavailable: Unavailable
      no_name: No name
    GRC:
      weekdays:
        mon: Δευτέρα
        tue: Τρίτη
        wed: Τετάρτη
        thu: Πέμπτη
        fri: Παρασκευή
        sat: Σάββατο
        sun: Κυριακή
      relative_day:
        today: Σήμερα
        tomorrow: Αύριο
        in_2_days: σε 2 ημέρες
        in_3_days: σε 3 ημέρες
        in_4_days: σε 4 ημέρες
      climate:
        states:
          "on": Ενεργό
          "off": Ανενεργό
        heat: Θέρμανση
      please_confirm: Παρακαλώ επιβεβαιώστε
      unavailable: Unavailable
      no_name: No name
    HEB:
      weekdays:
        mon: ינש
        tue: ישילש
        wed: יעיבר
        thu: ישימח
        fri: ישיש
        sat: תבש
        sun: ןושאר
      relative_day:
        today: םויה
        tomorrow: רחמ
        in_2_days: םיימוי דוע
        in_3_days: םימי 3 דוע
        in_4_days: םימי 4 דוע
      climate:
        states:
          "on": קולד
          "off": יובכ
        heat: םוח
      please_confirm: רשא השקבב
      unavailable: Unavailable
      no_name: No name
    HUN:
      weekdays:
        mon: Hétfő
        tue: Kedd
        wed: Szerda
        thu: Csütörtök
        fri: Péntek
        sat: Szombat
        sun: Vasárnap
      relative_day:
        today: Ma
        tomorrow: Holnap
        in_2_days: 2 nap múlva
        in_3_days: 3 nap múlva
        in_4_days: 4 nap múlva
      climate:
        states:
          "on": a oldalon
          "off": off
        heat: hő
      please_confirm: Kérjük, erősítse meg
      unavailable: Unavailable
      no_name: No name
    IDN:
      weekdays:
        mon: Senin
        tue: Selasa
        wed: Rabu
        thu: Kamis
        fri: Jumat
        sat: Sabtu
        sun: Minggu
      relative_day:
        today: Hari ini
        tomorrow: Besok
        in_2_days: dalam 2 Hari
        in_3_days: dalam 3 Hari
        in_4_days: dalam 4 Hari
      climate:
        states:
          "on": on
          "off": off
        heat: panas
      please_confirm: Mohon konfirmasi
      unavailable: Unavailable
      no_name: No name
    ITA:
      weekdays:
        mon: Lunedì
        tue: Martedì
        wed: Mercoledì
        thu: Giovedì
        fri: Venerdì
        sat: Sabato
        sun: Domenica
      relative_day:
        today: Oggi
        tomorrow: Domani
        in_2_days: in 2 giorni
        in_3_days: in 3 giorni
        in_4_days: in 4 giorni
      climate:
        states:
          "on": on
          "off": off
        heat: caldo
      please_confirm: Confermare
      unavailable: Unavailable
      no_name: No name
    LTU:
      weekdays:
        mon: Pirmadienis
        tue: Antradienis
        wed: Trečiadienis
        thu: Ketvirtadienis
        fri: Penktadienis
        sat: Šeštadienis
        sun: Sekmadienis
      relative_day:
        today: Šiandien
        tomorrow: Rytoj
        in_2_days: per 2 dienas
        in_3_days: per 3 dienas
        in_4_days: per 4 dienas
      climate:
        states:
          "on": svetainėje
          "off": išjungta
        heat: šiluma
      please_confirm: Prašome patvirtinti
      unavailable: Unavailable
      no_name: No name
    LVA:
      weekdays:
        mon: Pirmdiena
        tue: Otrdiena
        wed: Trešdiena
        thu: Ceturtdiena
        fri: Piektdiena
        sat: Sestdiena
        sun: Svētdiena
      relative_day:
        today: Šodien
        tomorrow: Rīt
        in_2_days: pēc 2 dienām
        in_3_days: pēc 3 dienām
        in_4_days: pēc 4 dienām
      climate:
        states:
          "on": vietnē
          "off": izslēgts
        heat: siltums
      please_confirm: Lūdzu, apstipriniet
      unavailable: Unavailable
      no_name: No name
    NLD:
      weekdays:
        mon: Maandag
        tue: Dinsdag
        wed: Woensdag
        thu: Donderdag
        fri: Vrijdag
        sat: Zaterdag
        sun: Zondag
      relative_day:
        today: Vandaag
        tomorrow: Morgen
        in_2_days: in 2 dagen
        in_3_days: in 3 dagen
        in_4_days: in 4 dagen
      climate:
        states:
          "on": aan
          "off": uit
        heat: verwarm
      please_confirm: Bevestig alstublieft
      unavailable: Unavailable
      no_name: No name
    NOR:
      weekdays:
        mon: Mandag
        tue: Tirsdag
        wed: Onsdag
        thu: Torsdag
        fri: Fredag
        sat: Lørdag
        sun: Søndag
      relative_day:
        today: I dag
        tomorrow: I morgen
        in_2_days: om 2 dager
        in_3_days: om 3 dager
        in_4_days: om 4 dager
      climate:
        states:
          "on": på
          "off": av
        heat: varme
      please_confirm: Vennligst bekreft
      unavailable: Unavailable
      no_name: No name
    POL:
      weekdays:
        mon: Poniedziałek
        tue: Wtorek
        wed: Środa
        thu: Czwartek
        fri: Piątek
        sat: Sobota
        sun: Niedziela
      relative_day:
        today: Dzisiaj
        tomorrow: Jutro
        in_2_days: za 2 dni
        in_3_days: za 3 dni
        in_4_days: za 4 dni
      climate:
        states:
          "on": na
          "off": off
        heat: ciepło
      please_confirm: Proszę o potwierdzenie
      unavailable: Unavailable
      no_name: No name
    PRT:
      weekdays:
        mon: Segunda-feira
        tue: Terça-feira
        wed: Quarta-feira
        thu: Quinta-feira
        fri: Sexta-feira
        sat: Sábado
        sun: Domingo
      relative_day:
        today: Hoje
        tomorrow: Amanhã
        in_2_days: Em 2 dias
        in_3_days: Em 3 dias
        in_4_days: Em 4 dias
      climate:
        states:
          "on": Ligado
          "off": Desligado
        heat: Aquecimento
      please_confirm: Confirme, por favor
      unavailable: Indisponível
      no_name: Sem nome
    ROU:
      weekdays:
        mon: Luni
        tue: Marți
        wed: Miercuri
        thu: Joi
        fri: Vineri
        sat: Sâmbătă
        sun: Duminică
      relative_day:
        today: Astăzi
        tomorrow: Mâine
        in_2_days: în 2 zile
        in_3_days: în 3 zile
        in_4_days: în 4 zile
      climate:
        states:
          "on": pe
          "off": off
        heat: căldură
      please_confirm: Vă rugăm să confirmați
      unavailable: Unavailable
      no_name: No name
    RUS:
      weekdays:
        mon: Понедельник
        tue: Вторник
        wed: Среда
        thu: Четверг
        fri: Пятница
        sat: Суббота
        sun: Воскресение
      relative_day:
        today: Сегодня
        tomorrow: Завтра
        in_2_days: на 2 дня
        in_3_days: на 3 дня
        in_4_days: на 4 дня
      climate:
        states:
          "on": включено
          "off": выключено
        heat: нагрев
      please_confirm: Пожалуйста, подтвердите
      unavailable: Unavailable
      no_name: No name
    SVK:
      weekdays:
        mon: Pondelok
        tue: Utorok
        wed: Streda
        thu: Štvrtok
        fri: Piatok
        sat: Sobota
        sun: Nedeľa
      relative_day:
        today: Dnes
        tomorrow: Zajtra
        in_2_days: o 2 dni
        in_3_days: o 3 dni
        in_4_days: o 4 dni
      climate:
        states:
          "on": zapnuté
          "off": vypnuté
        heat: kúrenie
      please_confirm: Potvrďte, prosím
      unavailable: Unavailable
      no_name: No name
    SVN:
      weekdays:
        mon: Ponedeljek
        tue: Torek
        wed: Sreda
        thu: Četrtek
        fri: Petek
        sat: Sobota
        sun: Nedelja
      relative_day:
        today: Danes
        tomorrow: Jutri
        in_2_days: v 2 dneh
        in_3_days: v 3 dneh
        in_4_days: v 4 dneh
      climate:
        states:
          "on": na
          "off": izklop
        heat: toplota
      please_confirm: Prosimo, potrdite
      unavailable: Unavailable
      no_name: No name
    SWE:
      weekdays:
        mon: Måndag
        tue: Tisdag
        wed: Onsdag
        thu: Torsdag
        fri: Fredag
        sat: Lördag
        sun: Söndag
      relative_day:
        today: Idag
        tomorrow: Imorgon
        in_2_days: om 2 dagar
        in_3_days: om 3 dagar
        in_4_days: om 4 dagar
      climate:
        states:
          "on": på
          "off": av
        heat: värme
      please_confirm: Vänligen bekräfta
      unavailable: Unavailable
      no_name: No name
    TUR:
      weekdays:
        mon: Pazartesi
        tue: Salı
        wed: Çarşamba
        thu: Perşembe
        fri: Cuma
        sat: Cumartesi
        sun: Pazar
      relative_day:
        today: Bugün
        tomorrow: Yarın
        in_2_days: 2 Gün İçinde
        in_3_days: 3 Gün İçinde
        in_4_days: 4 Gün İçinde
      climate:
        states:
          "on": üzerinde
          "off": kapalı
        heat: ısı
      please_confirm: Lütfen onaylayın
      unavailable: Unavailable
      no_name: No name
    UKR:
      weekdays:
        mon: Понеділок
        tue: Вівторок
        wed: середа
        thu: четвер
        fri: п ятниця
        sat: Субота
        sun: Неділя
      relative_day:
        today: Сьогодні
        tomorrow: Завтра
        in_2_days: через 2 дні
        in_3_days: через 3 дні
        in_4_days: через 2 дні
      climate:
        states:
          "on": увімк
          "off": вимк
        heat: нагрів
      please_confirm: Будь ласка, підтвердіть
      unavailable: Unavailable
      no_name: No name

  ##### WEATHER ####
  weather_entity: !input "weather_entity" # used only during the creation of weather in variables

  ##### Home page #####
  page_home:
    buttons: ### Feature Buttons ###
      - icon: ''    # NOT IN USE
        color_rgb:
          'on': ''  # NOT IN USE
          'off': '' # NOT IN USE
      - icon: ''    # NOT IN USE
        color_rgb:
          'on': ''  # NOT IN USE
          'off': '' # NOT IN USE
      - icon: ''    # NOT IN USE
        color_rgb:
          'on': ''  # NOT IN USE
          'off': '' # NOT IN USE
      - icon: !input "home_button04_icon" #E1ED
        color_rgb:
          'on': !input "home_button04_icon_color01"
          'off': !input "home_button04_icon_color02"
      - icon: !input "home_button05_icon" #E432
        color_rgb:
          'on': !input "home_button05_icon_color"
          'off': '' # NOT IN USE
      - icon: !input "home_button06_icon"  #EDCF
        color_rgb:
          'on': !input "home_button06_icon_color"
          'off': '' # NOT IN USE
      - icon: ''    # NOT IN USE
        color_rgb:
          'on': ''  # NOT IN USE
          'off': '' # NOT IN USE
    general:
      outdoor_temp:
        label:
          color_rgb: !input "home_outdoor_temp_label_color"
      indoor_temp:
        icon:
          icon: !input "home_indoor_temp_icon" #E50E
          color_rgb: !input "home_indoor_temp_icon_color"
        label:
          color_rgb: !input "home_indoor_temp_label_color"
      time:
        label:
          color_rgb: !input "time_label_color"
      date:
        label:
          color_rgb: !input "date_label_color"
    hardware:
      buttons: #### HARDWARE BUTTONS #####
        left:
          entity: !input "left_button_entity"
          name: !input "left_button_name"
          color_rgb: !input "left_button_color"
          hold_select: !input "left_button_hold_select"
          #sequence: !input left_button_hold_custom_action
        right:
          entity: !input "right_button_entity"
          name: !input "right_button_name"
          color_rgb: !input "right_button_color"
          hold_select: !input "right_button_hold_select"
          #sequence: !input right_button_hold_custom_action
  qrcode_enabled: !input "qrcode_enabled"

  ###### SYNC SETTINGS #####
  #delay_boot: !input "delay"              # NOT IN USE
  delay_value: !input "delay"
  #delay_jump_page: !input "delay"         # NOT IN USE
  #sync_slider_ha: !input "sync_slider_ha" # NOT IN USE
  #sync_value_ha: !input "sync_value_ha"   # NOT IN USE
  climate_optimistic: !input "climate_optimistic"

  ##### GENERAL ENTITYS #####
  hotwatertemp: !input "hotwatertemp"
  outdoortemp: !input "outdoortemp"
  indoortemp: !input "indoortemp"
  climate: !input "climate"
  relay_1_local_fallback: !input "relay_1_local_fallback"
  relay_2_local_fallback: !input "relay_2_local_fallback"

  ##### ENTITIES #####
  entitypages_enabled: !input "entitypages_enabled"

#############################################################
##### CLOSE - Variables #####
#############################################################


#############################################################
##### START - Trigger #####
#############################################################

trigger:

 ##### Trigger - General #################################################################################################################

  ###### DELME - Trigger "nspanel_boot_init" ######
  - platform: state
    entity_id: input_boolean.trigger_nspanel_boot
    to: 'on'
    id: nspanel_boot_init

  ##### Reboot - Trigger "nspanel_boot_init" #####
  - platform: template
    value_template: "{{ is_state(nextion_inited_trigger, 'on') | default(false) if nextion_inited_trigger is string else false }}"
    for:
      seconds: 1
    id: nspanel_boot_init

  ##### settings_entity - Trigger "settings_entity" #####
  - platform: event
    event_type: state_changed
    event_data:
      entity_id: "{{ settings_entity }}"
    id: settings_entity

  ##### Automation reload
  - platform: event
    event_type: automation_reloaded
    id: automation_reloaded

  ##### TFT Upload - Trigger "tft_upload" #####
  - platform: event
    event_type: folder_watcher
    event_data:
      event_type: modified
      path: !input "tft_path"
    id: tft_upload

  ##### Time - Trigger "time_state" #####
  - platform: time_pattern
    minutes: "/1"
    id: time_state

  #### Weather state changed #######
  - platform: event
    event_type: state_changed
    event_data:
      entity_id: !input "weather_entity"
    id: weather_state_change

  ##### HOME Value 01 - Trigger "home_value01_state" #####
  - platform: state
    entity_id: !input "home_value01"
    not_to:
      - unknown
      - unavailable
    id: home_value01_state

  ##### HOME Value 01 - Trigger "home_value02_state" #####
  - platform: state
    entity_id: !input "home_value02"
    not_to:
      - unknown
      - unavailable
    id: home_value02_state

  ##### HOME Value 01 - Trigger "home_value03_state" #####
  - platform: state
    entity_id: !input "home_value03"
    not_to:
      - unknown
      - unavailable
    id: home_value03_state

  ##### Climate - Trigger "climate_state" #####
  - platform: event
    event_type: state_changed
    event_data:
      entity_id: !input "climate"
    id: climate_state

  ##### Hot Water - Trigger "hotwatertemp_state" #####
  - platform: event
    event_type: state_changed
    event_data:
      entity_id: !input "hotwatertemp"
    id: hotwatertemp_state

  ##### Outdoor Temp - Trigger "outdoortemp_state" #####
  - platform: event
    event_type: state_changed
    event_data:
      entity_id: !input "outdoortemp"
    id: outdoortemp_state

  ##### indoor Temp Sensor - Trigger "indoortemp_state" #####
  - platform: event
    event_type: state_changed
    event_data:
      entity_id: !input "indoortemp"
    id: indoortemp_state

  ##### NSPAnel Temp Sensor - Trigger "nspaneltemp_state" #####
  - platform: event
    event_type: state_changed
    event_data:
      entity_id: "{{ nspaneltemp }}"
    id: nspaneltemp_state

  ##### Hot Water Charge - Trigger "hotwatercharge_state" #####
  - platform: event
    event_type: state_changed
    event_data:
      entity_id: !input "hotwatercharge"
    id: hotwatercharge_state

  ##### Chip 01 - Trigger "chip01_state" #####
  - platform: event
    event_type: state_changed
    event_data:
      entity_id: !input "chip01"
    id: chip01_state

  ##### Chip 02 - Trigger "chip02_state" #####
  - platform: event
    event_type: state_changed
    event_data:
      entity_id: !input "chip02"
    id: chip02_state

  ##### Chip 03 - Trigger "chip03_state" #####
  - platform: event
    event_type: state_changed
    event_data:
      entity_id: !input "chip03"
    id: chip03_state

  ##### Chip 04 - Trigger "chip04_state" #####
  - platform: event
    event_type: state_changed
    event_data:
      entity_id: !input "chip04"
    id: chip04_state

  ##### Chip 05 - Trigger "chip05_state" #####
  - platform: event
    event_type: state_changed
    event_data:
      entity_id: !input "chip05"
    id: chip05_state

  ##### Chip 06 - Trigger "chip06_state" #####
  - platform: event
    event_type: state_changed
    event_data:
      entity_id: !input "chip06"
    id: chip06_state

  ##### Chip 07 - Trigger "chip07_state" #####
  - platform: event
    event_type: state_changed
    event_data:
      entity_id: !input "chip07"
    id: chip07_state

  ##### Relay01 - Trigger "relay01_state" #####
  - platform: event
    event_type: state_changed
    event_data:
      entity_id: "{{ relay01_entity }}"
    id: relay01_state

  ##### Relay02 - Trigger "relay02_state" #####
  - platform: event
    event_type: state_changed
    event_data:
      entity_id: "{{ relay02_entity }}"
    id: relay02_state

  ##### Left Button - Trigger "left_button_press" #####
  - platform: template
    value_template: "{{ is_state(left_button, 'on') | default(false) if left_button is string else false }}"
    id: left_button_press

  ##### Right Button - Trigger "right_button_press" #####
  - platform: template
    value_template: "{{ is_state(right_button, 'on') | default(false) if right_button is string else false }}"
    id: right_button_press

  ##### Left Button - State "left_button_state" #####
  - platform: state
    entity_id: !input "left_button_entity"
    to:
      - 'on'
      - 'off'
    id: left_button_state

  ##### Right Button - State "right_button_state" #####
  - platform: state
    entity_id: !input "right_button_entity"
    to:
      - 'on'
      - 'off'
    id: right_button_state

  ##### Notification Text - Trigger "notification_text_state" #####
  - platform: event
    event_type: state_changed
    event_data:
      entity_id: "{{ notification_text }}"
    id: notification_text_state

  ##### Notification Text - Trigger "notification_text_state" #####
  - platform: event
    event_type: state_changed
    event_data:
      entity_id: "{{ notification_unread }}"
    id: notification_unread_state

  #### Show notification - Trigger ####
  - platform: template
    value_template: "{{ is_state(last_click, 'homebutton04release') | default(false) if last_click is string else false }}"
    id: open_notification_page

  #### Notification clear - Trigger ####
  - platform: template
    value_template: "{{ (states(last_click) | default('unavailable') is match 'notificationclearrelease') if last_click is string else false }}"
    id: btn_notificationclearrelease

  #### Notification accept - Trigger ####
  - platform: template
    value_template: "{{ (states(last_click) | default('unavailable') is match 'notificationacceptrelease') if last_click is string else false }}"
    id: btn_notificationacceptrelease

  #### Show QR code - Trigger ####
  - platform: template
    value_template: "{{ (states(last_click) | default('unavailable') is match 'homebutton05release') if last_click is string else false }}"
    id: open_qrcode_page

  #### Show ENTITIES - Trigger ####
  - platform: template
    value_template: "{{ (states(last_click) | default('unavailable') is match 'homebutton06release') if last_click is string else false }}"
    id: open_entity_page

  #### Show Climate - Trigger ####
  - platform: template
    value_template: "{{ (states(last_click) | default('unavailable') is match 'weatherpagerelease') if last_click is string else false }}"
    id: open_weather_page

  #### Climate - Trigger ####
  - platform: template
    value_template: "{{ (states(last_click) | default('unavailable') is match 'climaterelease') if last_click is string else false }}"
    id: open_climate_page

  ##### Trigger - Button General #################################################################################################################

  ##### Page Button - Trigger "short_press" - SHORT Press via "last_click" #####
  - platform: template
    value_template: "{{ (states(last_click) | default('unavailable') is match 'releasebutton') if last_click is string else false }}"
    id: short_press

  ##### Page Button - Trigger "long_press" - LONG Press via "last_click" - Button LONG Press for jump to Lightsetting or Coversetting Page #####
  - platform: template
    value_template: "{{ (states(last_click) | default('unavailable') is match 'press') if last_click is string else false }}"
    for:
      seconds: 1
    id: long_press

  ##### Page Lightsettings - Trigger "light_settings" - Changes Lightsettings Page via "last_click_lightsettings" #####
  - platform: event
    event_type: state_changed
    event_data:
      entity_id: "{{ last_click_lightsettings }}"
    id: light_settings

  ##### Page Coversettings - Trigger "cover_settings" - Changes Coversettings Page via "last_click_coversettings" #####
  - platform: event
    event_type: state_changed
    event_data:
      entity_id: "{{ last_click_coversettings }}"
    id: cover_settings

   ##### Page Climatesettings - Trigger "climate_settings" - Changes Climatesettings Page via "last_click_climatesettings" #####
  - platform: event
    event_type: state_changed
    event_data:
      entity_id: "{{ last_click_climatesettings }}"
    id: climate_settings

  ##### Current page changed #####
  - platform: event
    event_type: state_changed
    event_data:
      entity_id: "{{ current_page }}"
    id: current_page_changed

  ##### Page Button - Trigger "button_page" Entity sync #####
  - platform: template
    value_template: "{{ (states(last_click) | default('unavailable') is match 'button') if last_click is string else false }}"
    id: button_page



  ##### Trigger - Button State change #################################################################################################################

  ##### Button01 Sync - Trigger "current_state_entity01" #####
  - platform: state
    entity_id: !input "entity01"
    id: current_state_entity01

  ##### Button02 Sync - Trigger "current_state_entity02" #####
  - platform: state
    entity_id: !input "entity02"
    id: current_state_entity02

  ##### Button03 Sync - Trigger "current_state_entity03" #####
  - platform: state
    entity_id: !input "entity03"
    id: current_state_entity03

  ##### Button04 Sync - Trigger "current_state_entity04" #####
  - platform: state
    entity_id: !input "entity04"
    id: current_state_entity04

  ##### Button05 Sync - Trigger "current_state_entity05" #####
  - platform: state
    entity_id: !input "entity05"
    id: current_state_entity05

  ##### Button06 Sync - Trigger "current_state_entity06" #####
  - platform: state
    entity_id: !input "entity06"
    id: current_state_entity06

  ##### Button07 Sync - Trigger "current_state_entity07" #####
  - platform: state
    entity_id: !input "entity07"
    id: current_state_entity07

  ##### Button08 Sync - Trigger "current_state_entity08" #####
  - platform: state
    entity_id: !input "entity08"
    id: current_state_entity08

  ##### Button09 Sync - Trigger "current_state_entity09" #####
  - platform: state
    entity_id: !input "entity09"
    id: current_state_entity09

  ##### Button10 Sync - Trigger "current_state_entity10" #####
  - platform: state
    entity_id: !input "entity10"
    id: current_state_entity10

  ##### Button11 Sync - Trigger "current_state_entity11" #####
  - platform: state
    entity_id: !input "entity11"
    id: current_state_entity11

  ##### Button12 Sync - Trigger "current_state_entity12" #####
  - platform: state
    entity_id: !input "entity12"
    id: current_state_entity12

  ##### Button13 Sync - Trigger "current_state_entity13" #####
  - platform: state
    entity_id: !input "entity13"
    id: current_state_entity13

  ##### Button14 Sync - Trigger "current_state_entity14" #####
  - platform: state
    entity_id: !input "entity14"
    id: current_state_entity14

  ##### Button15 Sync - Trigger "current_state_entity15" #####
  - platform: state
    entity_id: !input "entity15"
    id: current_state_entity15

  ##### Button16 Sync - Trigger "current_state_entity16" #####
  - platform: state
    entity_id: !input "entity16"
    id: current_state_entity16

  ##### Button17 Sync - Trigger "current_state_entity17" #####
  - platform: state
    entity_id: !input "entity17"
    id: current_state_entity17

  ##### Button18 Sync - Trigger "current_state_entity18" #####
  - platform: state
    entity_id: !input "entity18"
    id: current_state_entity18

  ##### Button19 Sync - Trigger "current_state_entity19" #####
  - platform: state
    entity_id: !input "entity19"
    id: current_state_entity19

  ##### Button20 Sync - Trigger "current_state_entity20" #####
  - platform: state
    entity_id: !input "entity20"
    id: current_state_entity20

  ##### Button21 Sync - Trigger "current_state_entity21" #####
  - platform: state
    entity_id: !input "entity21"
    id: current_state_entity21

  ##### Button22 Sync - Trigger "current_state_entity22" #####
  - platform: state
    entity_id: !input "entity22"
    id: current_state_entity22

  ##### Button23 Sync - Trigger "current_state_entity23" #####
  - platform: state
    entity_id: !input "entity23"
    id: current_state_entity23

  ##### Button24 Sync - Trigger "current_state_entity24" #####
  - platform: state
    entity_id: !input "entity24"
    id: current_state_entity24

  ##### Button25 Sync - Trigger "current_state_entity25" #####
  - platform: state
    entity_id: !input "entity25"
    id: current_state_entity25

  ##### Button26 Sync - Trigger "current_state_entity26" #####
  - platform: state
    entity_id: !input "entity26"
    id: current_state_entity26

  ##### Button27 Sync - Trigger "current_state_entity27" #####
  - platform: state
    entity_id: !input "entity27"
    id: current_state_entity27

  ##### Button28 Sync - Trigger "current_state_entity28" #####
  - platform: state
    entity_id: !input "entity28"
    id: current_state_entity28

  ##### Button29 Sync - Trigger "current_state_entity29" #####
  - platform: state
    entity_id: !input "entity29"
    id: current_state_entity29

  ##### Button30 Sync - Trigger "current_state_entity30" #####
  - platform: state
    entity_id: !input "entity30"
    id: current_state_entity30

  ##### Button31 Sync - Trigger "current_state_entity31" #####
  - platform: state
    entity_id: !input "entity31"
    id: current_state_entity31

  ##### Button32 Sync - Trigger "current_state_entity32" #####
  - platform: state
    entity_id: !input "entity32"
    id: current_state_entity32


#############################################################
##### CLOSE - Trigger #####
#############################################################

condition: "{{ is_state(nextion_inited_trigger, 'on') | default(false) if nextion_inited_trigger is string else false }}"

#############################################################
##### START - Action #####
#############################################################
action:
  - variables:
      #settings_entity_value: "{{ states(settings_entity) }}"
      settings_entity_value: "{{ states(settings_entity) | default('unavailable') if settings_entity is string else 'unavailable' }}"
      settings_entity_split: "{{ settings_entity_value.split(',') if settings_entity_value is string and settings_entity_value not in ['unavailable', 'unknown', None] else [] }}"
      settings_entity_count: "{{ settings_entity_split | count if settings_entity_split else 0 }}"
      entity_long:            "{{ settings_entity_split[0] if settings_entity_count >= 1 else 'unknown' }}"
      entity_back:            "{{ settings_entity_split[1] if settings_entity_count >= 2 else 'unknown' }}"
      entity_long_name:       "{{ settings_entity_split[2] if settings_entity_count >= 3 else 'unknown' }}"
      entity_long_icon:       "{{ settings_entity_split[3] if settings_entity_count >= 4 else 'unknown' }}"
      entity_long_icon_color: "{{ settings_entity_split[4] if settings_entity_count >= 5 else 'unknown' }}"
      entity_long_domain:     "{{ entity_long.split('.')[0] if entity_long.split('.') | count > 0 else 'unknown' }}"

  ########################################################################################################################

  # main - alias: "choose alias (name)"
  - alias: Main choices
    choose:
      ##### JUMP TO - settings page lightsettings /coversettings / climate (SETTINGS ENTITY CHANGED) #####
      - alias: "Jump to light/cover/climate settings page"
        conditions:
          - condition: trigger
            id: settings_entity
          - "{{ trigger.event.data.new_state.state not in ['unavailable', 'unknown', None] }}"
          - "{{ entity_long_domain in ['light', 'cover', 'climate'] }}"
        sequence:
          - service: "{{ nextion.commands.printf }}"
            data:
              cmd: "page {{ nextion.pages[entity_long_domain] }}"

      ##### BOOT NSPANEL - boot init #####
      - alias: Boot init
        conditions:
          - condition: trigger
            id: nspanel_boot_init
          - "{{ nextion.pages.current != nextion.pages.home or (is_state(last_click, ['unavailable', 'unknown', None]) | default(False) if last_click is string else False) }}"
        sequence:
          ##### NSPanel boot init only #####
          - delay:
              milliseconds: 100
          - service: "{{ nextion.commands.text_printf }}"
            data:
              component: boot.bluep_version
              message: "{{ blueprint_version }}"

          ###### Set local fallback ######
          - service: "switch.turn_{{ 'on' if relay_1_local_fallback else 'off' }}"
            data:
              entity_id: 'switch.{{ nspanel_name }}_relay_1_local_fallback'
          - service: "switch.turn_{{ 'on' if relay_2_local_fallback else 'off' }}"
            data:
              entity_id: 'switch.{{ nspanel_name }}_relay_2_local_fallback'

          ##### clear notification icon #####
          - service: "{{ nextion.commands.notification_clear }}"
            data: {}

          ###### NSPanel beep ######
          - delay:
              milliseconds: 2000
          - if: "{{ is_state(notification_sound, 'on') }}"
            then:
              - service: "{{ nextion.commands.play_rtttl }}"
                data:
                  song_str: "two short:d=4,o=5,b=100:16e6,16e6"

          ##### NSPanel boot init finished and jump to Home Page#####
          - &delay-default
            delay:
              milliseconds: "{{ delay_value }}"
          - service: "{{ nextion.commands.printf }}"
            data:
              cmd: page home

      ##### PAGE CHANGED - changes when page changed #####
      - alias: Page changed
        conditions:
          - condition: trigger
            id: current_page_changed
        sequence:
          ##### climate-page left - apply climate temperature if climate_optimistic ##### ## TODO - remove from here
          - if: "{{ trigger.event.data.old_state.state == nextion.pages.climate and climate_optimistic }}"
            then:
              - variables:
                  display_target_temperature_state: "{{ states(display_target_temperature) | default('unavailable') if display_target_temperature is string else 'unavailable' }}"
              - if: "{{ is_number(display_target_temperature_state) }}"
                then:
                  - service: climate.set_temperature
                    data:
                      entity_id: "{{ entity_long }}"
                      #hvac_mode: 'heat'
                      temperature: "{{ display_target_temperature_state }}"
          - choose:
              ## PAGE HOME ##
              - alias: Home page
                conditions: "{{ trigger.event.data.new_state.state == nextion.pages.home }}"
                sequence: &refresh_page_home
                  - &variables-weather
                    variables:
                      weather_attribution: "{{ state_attr(weather_entity, 'attribution') | default('unavailable') if weather_entity is string else 'unavailable' }}"
                      weather_type: >
                        {% if   'AccuWeather'     in weather_attribution %} AccuWeather
                        {% elif 'OpenWeatherMap'  in weather_attribution %} OpenWeather
                        {% elif 'SMHI'            in weather_attribution %} SMHI
                        {% elif 'met.no'          in weather_attribution %} Met.no
                        {% elif 'OpenWeatherMap'  in weather_attribution %} OpenWeather
                        {% else %} Other
                        {% endif %}
                      weather_units:
                        hours_of_sun:               "{{ state_attr(weather_entity, 'hours_of_sun_unit')               | default('h')  if weather_entity is string and state_attr(weather_entity, 'hours_of_sun_unit')               else 'h' }}"
                        precipitation:              "{{ state_attr(weather_entity, 'precipitation_unit')              | default('mm') if weather_entity is string and state_attr(weather_entity, 'precipitation_unit')              else 'mm' }}"
                        precipitation_probability:  "{{ state_attr(weather_entity, 'precipitation_probability_unit')  | default('%')  if weather_entity is string and state_attr(weather_entity, 'precipitation_probability_unit')  else '%' }}"
                        pressure:                   "{{ state_attr(weather_entity, 'pressure_unit')                   | default('')   if weather_entity is string and state_attr(weather_entity, 'pressure_unit') }}"
                        temperature:                "{{ state_attr(weather_entity, 'temperature_unit')                | default('°')  if weather_entity is string and state_attr(weather_entity, 'temperature_unit')                else '°' }}"
                        thunderstorm_probability:   "{{ state_attr(weather_entity, 'thunderstorm_probability_unit')   | default('%')  if weather_entity is string and state_attr(weather_entity, 'thunderstorm_probability_unit')   else '%' }}"
                        uv_index:                   "{{ state_attr(weather_entity, 'uv_index_unit')                   | default('')   if weather_entity is string and state_attr(weather_entity, 'uv_index_unit') }}"
                        visibility:                 "{{ state_attr(weather_entity, 'visibility_unit')                 | default('')   if weather_entity is string and state_attr(weather_entity, 'visibility_unit') }}"
                        wind_speed:                 "{{ state_attr(weather_entity, 'wind_speed_unit')                 | default('')   if weather_entity is string and state_attr(weather_entity, 'wind_speed_unit') }}"

                  - service: "{{ nextion.commands.set_settings_entity }}"
                    data:
                      entity: 'unknown'
                  ##### NSPanel Date #####
                  ### DATE Font Color ###
                  - &variables-date_format
                    variables:
                      date_format: !input "date_format"
                  - *delay-default
                  - service: "{{ nextion.commands.font_color }}"
                    data:
                      component: home.date
                      message: "{{ page_home.general.date.label.color_rgb if is_number(page_home.general.date.label.color_rgb) else ((page_home.general.date.label.color_rgb[0] //(2**3)) *(2**11))+((page_home.general.date.label.color_rgb[1] //(2**2)) *(2**5))+(page_home.general.date.label.color_rgb[2] //(2**3)) }}"
                  ### DATE Font ###
                  - *delay-default
                  - service: "{{ nextion.commands.text_printf }}"
                    data:
                      component: home.date
                      message: "{{ (dict.values(mui[language].weekdays) | list)[now().weekday()] ~ ', ' ~ as_timestamp(now()) | timestamp_custom(date_format) }}"
                  ##### NSPanel Time #####
                  ### TIME Font Color ###
                  - *delay-default
                  - service: "{{ nextion.commands.font_color }}"
                    data:
                      component: home.time
                      message: "{{ page_home.general.time.label.color_rgb if is_number(page_home.general.time.label.color_rgb) else ((page_home.general.time.label.color_rgb[0] //(2**3)) *(2**11))+((page_home.general.time.label.color_rgb[1] //(2**2)) *(2**5))+(page_home.general.time.label.color_rgb[2] //(2**3)) }}"
                  ### TIME Font ###
                  - *delay-default
                  - service: "{{ nextion.commands.text_printf }}"
                    data:
                      component: home.time
                      message: "{{ time }}"
                  ### TIME Meridiem Font Color ###
                  - *delay-default
                  - service: "{{ nextion.commands.font_color }}"
                    data:
                      component: home.meridiem
                      message: "{{ page_home.general.time.label.color_rgb if is_number(page_home.general.time.label.color_rgb) else ((page_home.general.time.label.color_rgb[0] //(2**3)) *(2**11))+((page_home.general.time.label.color_rgb[1] //(2**2)) *(2**5))+(page_home.general.time.label.color_rgb[2] //(2**3)) }}"
                  ### TIME Meridiem Font ###
                  - *delay-default
                  - service: "{{ nextion.commands.text_printf }}"
                    data:
                      component: home.meridiem
                      message: "{{ meridiem }}"

                  ##### NSPanel Outdoor Temp #####
                  - variables:
                      outdoor_temp_state: "{{ states(outdoortemp) | default('unavailable') if outdoortemp is string else 'unavailable' }}"
                      outdoor_temp: "{{ outdoor_temp_state if is_number(outdoor_temp_state) else state_attr(weather_entity, 'temperature') | default('unavailable') if weather_entity is string else 'unavailable' }}"
                  ### LABEL Outdoor Temp Font Color ###
                  - *delay-default
                  - service: "{{ nextion.commands.font_color }}"
                    data:
                      component: home.outdoor_temp
                      message: "{{ page_home.general.outdoor_temp.label.color_rgb if is_number(page_home.general.outdoor_temp.label.color_rgb) else ((page_home.general.outdoor_temp.label.color_rgb[0] //(2**3)) *(2**11))+((page_home.general.outdoor_temp.label.color_rgb[1] //(2**2)) *(2**5))+(page_home.general.outdoor_temp.label.color_rgb[2] //(2**3)) }}"
                  ### LABEL Outdoor Temp Font ###
                  - *delay-default
                  - service: "{{ nextion.commands.text_printf }}"
                    data:
                      component: home.outdoor_temp
                      message: "{{ (outdoor_temp | round(1) ~ weather_units.temperature) if is_number(outdoor_temp) else (mui[language].unavailable if outdoor_temp in ['unavailable', 'unknown', None] else outdoor_temp) }}"

                  ##### NSPanel Indoor Temp #####
                  - variables:
                      indoor_temp_state: "{{ states(indoortemp) | default('unavailable') if indoortemp is string else 'unavailable' }}"
                  ### ICON Indoor Temp Font Color ###
                  - *delay-default
                  - service: "{{ nextion.commands.font_color }}"
                    data:
                      component: home.indoortempicon
                      message: "{{ page_home.general.indoor_temp.icon.color_rgb if is_number(page_home.general.indoor_temp.icon.color_rgb) else ((page_home.general.indoor_temp.icon.color_rgb[0] //(2**3)) *(2**11))+((page_home.general.indoor_temp.icon.color_rgb[1] //(2**2)) *(2**5))+(page_home.general.indoor_temp.icon.color_rgb[2] //(2**3)) }}"
                  ### ICON Indoor Temp Font ###
                  - *delay-default
                  - service: "{{ nextion.commands.text_printf }}"
                    data:
                      component: home.indoortempicon
                      message: "{{ page_home.general.indoor_temp.icon.icon }}"
                  ### LABEL Indoor Temp Font Color ###
                  - *delay-default
                  - service: "{{ nextion.commands.font_color }}"
                    data:
                      component: home.current_temp
                      message: "{{ page_home.general.indoor_temp.label.color_rgb if is_number(page_home.general.indoor_temp.label.color_rgb) else ((page_home.general.indoor_temp.label.color_rgb[0] //(2**3)) *(2**11))+((page_home.general.indoor_temp.label.color_rgb[1] //(2**2)) *(2**5))+(page_home.general.indoor_temp.label.color_rgb[2] //(2**3)) }}"
                  ### LABEL Indoor Temp Font ###
                  - *delay-default
                  - service: "{{ nextion.commands.text_printf }}"
                    data:
                      component: home.current_temp
                      message: "{{ (indoor_temp_state | round(1) ~ weather_units.temperature) if is_number(indoor_temp_state) else (mui[language].unavailable if indoor_temp_state in ['unavailable', 'unknown', None] else indoor_temp_state) }}"

                  ##### Weather Icon Home Page #####
                  - *delay-default
                  - service: "{{ nextion.commands.printf }}"
                    data:
                      cmd: home.weather.pic={{ nextion.pics.weather[states(weather_entity) | default('unavailable') if weather_entity is string else 'unavailable'] | default(None) }}

                  ##### NSPanel Buttons #####
                  - variables:
                      left_button_state: "{{ states(page_home.hardware.buttons.left.entity) | default('unavailable') if page_home.hardware.buttons.left.entity is string else 'unavailable' }}"
                      right_button_state: "{{ states(page_home.hardware.buttons.right.entity) | default('unavailable') if page_home.hardware.buttons.right.entity is string else 'unavailable' }}"

                  ##### NSPanel Left Button Name #####
                  - if: "{{ page_home.hardware.buttons.left.name | length > 0 }}"
                    then:
                      ### LABEL Font Color ###
                      - *delay-default
                      - service: "{{ nextion.commands.font_color }}"
                        data:
                          component: home.left_bt_text
                          message: "{{ page_home.hardware.buttons.left.color_rgb if is_number(page_home.hardware.buttons.left.color_rgb) else ((page_home.hardware.buttons.left.color_rgb[0] //(2**3)) *(2**11))+((page_home.hardware.buttons.left.color_rgb[1] //(2**2)) *(2**5))+(page_home.hardware.buttons.left.color_rgb[2] //(2**3)) }}"
                      ### LABEL Font ###
                      - *delay-default
                      - service: "{{ nextion.commands.text_printf }}"
                        data:
                          component: home.left_bt_text
                          message: "{{ page_home.hardware.buttons.left.name }}"

                  ##### SET Left Hardware Button PIC on Home Page ####
                  - if: "{{ left_button_state not in ['unavailable', 'unknown', None] }}"
                    then:
                      - variables:
                          # Hardware Button PIC
                          left_hardware_button_state: "{{ nextion.pics.hardware.button[left_button_state] | default(None) }}"
                      - *delay-default
                      - service: "{{ nextion.commands.printf }}"
                        data:
                          cmd: home.left_bt_pic.pic={{ left_hardware_button_state }}

                  ##### NSPanel Right Button Name #####
                  - if: "{{ page_home.hardware.buttons.right.name | length > 0 }}"
                    then:
                      ### LABEL Font Color ###
                      - *delay-default
                      - service: "{{ nextion.commands.font_color }}"
                        data:
                          component: home.right_bt_text
                          message: "{{ page_home.hardware.buttons.right.color_rgb if is_number(page_home.hardware.buttons.right.color_rgb) else ((page_home.hardware.buttons.right.color_rgb[0] //(2**3)) *(2**11))+((page_home.hardware.buttons.right.color_rgb[1] //(2**2)) *(2**5))+(page_home.hardware.buttons.right.color_rgb[2] //(2**3)) }}"
                      ### LABEL Font ###
                      - *delay-default
                      - service: "{{ nextion.commands.text_printf }}"
                        data:
                          component: home.right_bt_text
                          message: "{{ page_home.hardware.buttons.right.name }}"

                  ##### SET Right Hardware Button PIC on Home Page #####
                  - if: "{{ right_button_state not in ['unavailable', 'unknown', None] }}"
                    then:
                      - variables:
                      # Hardware Button PIC
                          right_hardware_button_state: "{{ nextion.pics.hardware.button[right_button_state] | default(None) }}"
                      - *delay-default
                      - service: "{{ nextion.commands.printf }}"
                        data:
                          cmd: home.right_bt_pic.pic={{ right_hardware_button_state }}

                  ###### Status bar ######
                  - &variables-home_page_status_bar
                    variables:
                      thermostat_icon: !input "thermostat_icon" #E50E
                      heat_icon: !input "heat_icon" #\U0000E50F
                      climate_state: "{{ states(climate) | default('unavailable') if climate is string else 'unavailable' }}"
                      climate_action: "{{ state_attr(climate, 'hvac_action') | default('unavailable') if climate is string else 'unavailable'  }}"
                      home_page_status_bar:
                        - entity:         "{{ relay01_entity }}"
                          icon:           !input "relay01_icon" #E3A5
                          icon_color_rgb: !input "relay01_icon_color"
                        - entity:         "{{ relay02_entity }}"
                          icon:           !input "relay02_icon" #E3A8
                          icon_color_rgb: !input "relay02_icon_color"
                        - entity:         "{{ climate }}"
                          icon: "{{ (heat_icon if climate_action == 'heating' else thermostat_icon) if climate_state == 'heat' else nextion.icons.blank }}"
                          icon_color_rgb: !input "thermostat_icon_color"
                        - entity:         !input "chip01"
                          icon:           !input "chip01_icon"
                          icon_color_rgb: !input "chip01_icon_color"
                        - entity:         !input "chip02"
                          icon:           !input "chip02_icon"
                          icon_color_rgb: !input "chip02_icon_color"
                        - entity:         !input "chip03"
                          icon:           !input "chip03_icon"
                          icon_color_rgb: !input "chip03_icon_color"
                        - entity:         !input "chip04"
                          icon:           !input "chip04_icon"
                          icon_color_rgb: !input "chip04_icon_color"
                        - entity:         !input "chip05"
                          icon:           !input "chip05_icon"
                          icon_color_rgb: !input "chip05_icon_color"
                        - entity:         !input "chip06"
                          icon:           !input "chip06_icon"
                          icon_color_rgb: !input "chip06_icon_color"
                        - entity:         !input "chip07"
                          icon:           !input "chip07_icon"
                          icon_color_rgb: !input "chip07_icon_color"
                  - repeat:
                      for_each: "{{ home_page_status_bar }}"
                      sequence:
                        - &display-home_page_status_bar
                          if: "{{ repeat.item.entity is defined and repeat.item.entity is string and repeat.item.entity | length > 0 }}"
                          then:
                            ### ICON Font Color ###
                            - *delay-default
                            - service: "{{ nextion.commands.font_color }}"
                              data:
                                component: "{{ 'home.icon_top_%02d' | format(repeat.index) }}"
                                message: "{{ repeat.item.icon_color_rgb if is_number(repeat.item.icon_color_rgb) else ((repeat.item.icon_color_rgb[0] //(2**3)) *(2**11))+((repeat.item.icon_color_rgb[1] //(2**2)) *(2**5))+(repeat.item.icon_color_rgb[2] //(2**3)) }}"
                            ### ICON Font ###
                            - *delay-default
                            - service: "{{ nextion.commands.text_printf }}"
                              data:
                                component: "{{ 'home.icon_top_%02d' | format(repeat.index) }}"
                                message: "{{ repeat.item.icon if is_state(repeat.item.entity, 'on') | default(False) else nextion.icons.blank }}"
                                # {{ is_state(repeat.item.entity, 'on') | default(False) if repeat.item.entity is string else 'unavailable' }}

                  ##### HOME VALUE 01 - 03
                  - *delay-default
                  - &variables-home_page_values
                    variables:
                      home_page_values:
                        - entity:          !input "home_value01"
                          icon:            !input "home_value01_icon"
                          icon_color_rgb:  !input "home_value01_icon_color"
                          label_color_rgb: !input "home_value01_label_color"
                        - entity:          !input "home_value02"
                          icon:            !input "home_value02_icon"
                          icon_color_rgb:  !input "home_value02_icon_color"
                          label_color_rgb: !input "home_value02_label_color"
                        - entity:          !input "home_value03"
                          icon:            !input "home_value03_icon"
                          icon_color_rgb:  !input "home_value03_icon_color"
                          label_color_rgb: !input "home_value03_label_color"
                  - repeat:
                      for_each: "{{ home_page_values }}"
                      sequence:
                        - &display-home_page_value
                          if: "{{ repeat.item.entity is string and repeat.item.entity is match 'sensor.' and states(repeat.item.entity) not in ['unavailable', 'unknown', None] }}"
                          then:
                            - if: "{{ repeat.item.entity_icon | length > 0 }}"
                              then:
                                ### ICON Font Color ###
                                - *delay-default
                                - service: "{{ nextion.commands.font_color }}"
                                  data:
                                    component: "{{ 'home.value%02d_icon' | format(repeat.index) }}"
                                    message: "{{ repeat.item.icon_color_rgb if is_number(repeat.item.icon_color_rgb) else ((repeat.item.icon_color_rgb[0] //(2**3)) *(2**11))+((repeat.item.icon_color_rgb[1] //(2**2)) *(2**5))+(repeat.item.icon_color_rgb[2] //(2**3)) }}"
                                ### ICON Font ###
                                - *delay-default
                                - service: "{{ nextion.commands.text_printf }}"
                                  data:
                                    component: "{{ 'home.value%02d_icon' | format(repeat.index) }}"
                                    message: "{{ repeat.item.icon }}"
                            ### LABEL Font Color ###
                            - *delay-default
                            - service: "{{ nextion.commands.font_color }}"
                              data:
                                component: "{{ 'home.value%02d_state' | format(repeat.index) }}"
                                message: "{{ repeat.item.label_color_rgb if is_number(repeat.item.label_color_rgb) else ((repeat.item.label_color_rgb[0] //(2**3)) *(2**11))+((repeat.item.label_color_rgb[1] //(2**2)) *(2**5))+(repeat.item.label_color_rgb[2] //(2**3)) }}"
                            ### LABEL Font ###
                            - *delay-default
                            - service: "{{ nextion.commands.text_printf }}"
                              data:
                                component: "{{ 'home.value%02d_state' | format(repeat.index) }}"
                                message: "{{ (states(repeat.item.entity) | round(1) ~ (state_attr(repeat.item.entity, 'unit_of_measurement') if state_attr(repeat.item.entity, 'unit_of_measurement') else '')) if is_number(states(repeat.item.entity)) else states(repeat.item.entity) | default('unknown') }}"

                  ##### Set notify icon #####
                  - variables:
                      notification_unread_state: "{{ states(notification_unread) | default('unavailable') if notification_unread is string else 'unavailable' }}"
                      notification_text_state: "{{ states(notification_text) | default(None) if notification_text is string else None }}"
                      set_button04_icon: >-
                        {%- if notification_unread_state == 'on' and notification_text_state | length > 0 -%} {{ page_home.buttons[3].icon}}
                        {%- elif notification_unread_state == 'off' and notification_text_state | length > 0 -%} {{ page_home.buttons[3].icon }}
                        {%- else -%} {{ nextion.icons.blank }}
                        {%- endif -%}
                      set_button04_icon_font: >-
                        {%- if notification_unread_state == 'on' and notification_text_state | length > 0 -%}
                          {% set rgb = page_home.buttons[3].color_rgb.on %}
                          {{ rgb if is_number(rgb) else ((rgb[0] //(2**3)) *(2**11))+((rgb[1] //(2**2)) *(2**5))+(rgb[2] //(2**3)) }}
                        {%- elif notification_unread_state == 'off' and notification_text_state | length > 0 -%}
                          {% set rgb = page_home.buttons[3].color_rgb.off %}
                          {{ rgb if is_number(rgb) else ((rgb[0] //(2**3)) *(2**11))+((rgb[1] //(2**2)) *(2**5))+(rgb[2] //(2**3)) }}
                        {%- else -%} {{ nextion.colors.grey_light }}
                        {%- endif -%}
                  ##### SET ICON Font - Notify #####
                  - *delay-default
                  - service: "{{ nextion.commands.text_printf }}"
                    data:
                      component: home.button04_icon
                      message: "{{ set_button04_icon }}"

                  ##### SET ICON Font Color - Notify #####
                  - *delay-default
                  - service: "{{ nextion.commands.font_color }}"
                    data:
                      component: home.button04_icon
                      message: "{{ set_button04_icon_font }}"

                  ###### QR Code - Icon ######
                  - *delay-default
                  - if: "{{ qrcode_enabled == true }}"
                    then: # Display QR code icon
                      ### ICON Font Color ###
                      - service: "{{ nextion.commands.font_color }}"
                        data:
                          component: home.button05_icon
                          message: "{{ page_home.buttons[4].color_rgb.on if is_number(page_home.buttons[4].color_rgb.on) else ((page_home.buttons[4].color_rgb.on[0] //(2**3)) *(2**11))+((page_home.buttons[4].color_rgb.on[1] //(2**2)) *(2**5))+(page_home.buttons[4].color_rgb.on[2] //(2**3)) }}"
                      ### ICON Font ###
                      - *delay-default
                      - service: "{{ nextion.commands.text_printf }}"
                        data:
                          component: home.button05_icon
                          message: "{{ page_home.buttons[4].icon }}"
                    else: # Display blank icon
                      - service: "{{ nextion.commands.text_printf }}"
                        data:
                          component: home.button05_icon
                          message: "{{ nextion.icons.blank }}"

                  ###### ENTITIES - Icon ######
                  - *delay-default
                  - if: "{{ entitypages_enabled }}"
                    then: # Display entities icon
                      ### ICON Font Color ###
                      - service: "{{ nextion.commands.font_color }}"
                        data:
                          component: home.button06_icon
                          message: "{{ page_home.buttons[5].color_rgb.on if is_number(page_home.buttons[5].color_rgb.on) else ((page_home.buttons[5].color_rgb.on[0] //(2**3)) *(2**11))+((page_home.buttons[5].color_rgb.on[1] //(2**2)) *(2**5))+(page_home.buttons[5].color_rgb.on[2] //(2**3)) }}"
                      ### ICON Font ###
                      - *delay-default
                      - service: "{{ nextion.commands.text_printf }}"
                        data:
                          component: home.button06_icon
                          message: "{{ page_home.buttons[5].icon }}"
                    else: # Display blank icon
                      - service: "{{ nextion.commands.text_printf }}"
                        data:
                          component: home.button06_icon
                          message: "{{ nextion.icons.blank }}"

                  ###### SHOW All component when page loading done #####
                  - *delay-default
                  - service: "{{ nextion.commands.show_all }}"

              ## BUTTON PAGES 01 - 04 ##
              - alias: Button pages
                conditions: "{{ trigger.event.data.new_state.state in nextion.pages.buttonpages }}"
                sequence: &refresh_page_buttonpage
                  - &variables-page_buttons
                    variables:
                      button_page_index: "{{ (nextion.pages.current[-2:] | int(-1)) - 1 }}"
                      first_button: "{{ button_page_index * 8 }}"
                      last_button: "{{ first_button + 8 }}"
                      ##### BUTTON Page Labels #####
                      button_pages_labels:
                        - label: !input button_page01_label
                        - label: !input button_page02_label
                        - label: !input button_page03_label
                        - label: !input button_page04_label
                      ##### BUTTONS Page - Buttons 1 - 32 #####
                      button_pages_buttons:
                        - entity:         !input "entity01"
                          name:           !input "entity01_name"
                          icon:           !input "entity01_icon"
                          icon_color_rgb: !input "entity01_icon_color"
                          confirm:        !input "entity01_confirm"
                          component: buttonpage01.button01
                        - entity:         !input "entity02"
                          name:           !input "entity02_name"
                          icon:           !input "entity02_icon"
                          icon_color_rgb: !input "entity02_icon_color"
                          confirm:        !input "entity02_confirm"
                          component: buttonpage01.button02
                        - entity:         !input "entity03"
                          name:           !input "entity03_name"
                          icon:           !input "entity03_icon"
                          icon_color_rgb: !input "entity03_icon_color"
                          confirm:        !input "entity03_confirm"
                          component: buttonpage01.button03
                        - entity:         !input "entity04"
                          name:           !input "entity04_name"
                          icon:           !input "entity04_icon"
                          icon_color_rgb: !input "entity04_icon_color"
                          confirm:        !input "entity04_confirm"
                          component: buttonpage01.button04
                        - entity:         !input "entity05"
                          name:           !input "entity05_name"
                          icon:           !input "entity05_icon"
                          icon_color_rgb: !input "entity05_icon_color"
                          confirm:        !input "entity05_confirm"
                          component: buttonpage01.button05
                        - entity:         !input "entity06"
                          name:           !input "entity06_name"
                          icon:           !input "entity06_icon"
                          icon_color_rgb: !input "entity06_icon_color"
                          confirm:        !input "entity06_confirm"
                          component: buttonpage01.button06
                        - entity:         !input "entity07"
                          name:           !input "entity07_name"
                          icon:           !input "entity07_icon"
                          icon_color_rgb: !input "entity07_icon_color"
                          confirm:        !input "entity07_confirm"
                          component: buttonpage01.button07
                        - entity:         !input "entity08"
                          name:           !input "entity08_name"
                          icon:           !input "entity08_icon"
                          icon_color_rgb: !input "entity08_icon_color"
                          confirm:        !input "entity08_confirm"
                          component: buttonpage01.button08
                        - entity:         !input "entity09"
                          name:           !input "entity09_name"
                          icon:           !input "entity09_icon"
                          icon_color_rgb: !input "entity09_icon_color"
                          confirm:        !input "entity09_confirm"
                          component: buttonpage02.button01
                        - entity:         !input "entity10"
                          name:           !input "entity10_name"
                          icon:           !input "entity10_icon"
                          icon_color_rgb: !input "entity10_icon_color"
                          confirm:        !input "entity10_confirm"
                          component: buttonpage02.button02
                        - entity:         !input "entity11"
                          name:           !input "entity11_name"
                          icon:           !input "entity11_icon"
                          icon_color_rgb: !input "entity11_icon_color"
                          confirm:        !input "entity11_confirm"
                          component: buttonpage02.button03
                        - entity:         !input "entity12"
                          name:           !input "entity12_name"
                          icon:           !input "entity12_icon"
                          icon_color_rgb: !input "entity12_icon_color"
                          confirm:        !input "entity12_confirm"
                          component: buttonpage02.button04
                        - entity:         !input "entity13"
                          name:           !input "entity13_name"
                          icon:           !input "entity13_icon"
                          icon_color_rgb: !input "entity13_icon_color"
                          confirm:        !input "entity13_confirm"
                          component: buttonpage02.button05
                        - entity:         !input "entity14"
                          name:           !input "entity14_name"
                          icon:           !input "entity14_icon"
                          icon_color_rgb: !input "entity14_icon_color"
                          confirm:        !input "entity14_confirm"
                          component: buttonpage02.button06
                        - entity:         !input "entity15"
                          name:           !input "entity15_name"
                          icon:           !input "entity15_icon"
                          icon_color_rgb: !input "entity15_icon_color"
                          confirm:        !input "entity15_confirm"
                          component: buttonpage02.button07
                        - entity:         !input "entity16"
                          name:           !input "entity16_name"
                          icon:           !input "entity16_icon"
                          icon_color_rgb: !input "entity16_icon_color"
                          confirm:        !input "entity16_confirm"
                          component: buttonpage02.button08
                        - entity:         !input "entity17"
                          name:           !input "entity17_name"
                          icon:           !input "entity17_icon"
                          icon_color_rgb: !input "entity17_icon_color"
                          confirm:        !input "entity17_confirm"
                          component: buttonpage03.button01
                        - entity:         !input "entity18"
                          name:           !input "entity18_name"
                          icon:           !input "entity18_icon"
                          icon_color_rgb: !input "entity18_icon_color"
                          confirm:        !input "entity18_confirm"
                          component: buttonpage03.button02
                        - entity:         !input "entity19"
                          name:           !input "entity19_name"
                          icon:           !input "entity19_icon"
                          icon_color_rgb: !input "entity19_icon_color"
                          confirm:        !input "entity19_confirm"
                          component: buttonpage03.button03
                        - entity:         !input "entity20"
                          name:           !input "entity20_name"
                          icon:           !input "entity20_icon"
                          icon_color_rgb: !input "entity20_icon_color"
                          confirm:        !input "entity20_confirm"
                          component: buttonpage03.button04
                        - entity:         !input "entity21"
                          name:           !input "entity21_name"
                          icon:           !input "entity21_icon"
                          icon_color_rgb: !input "entity21_icon_color"
                          confirm:        !input "entity21_confirm"
                          component: buttonpage03.button05
                        - entity:         !input "entity22"
                          name:           !input "entity22_name"
                          icon:           !input "entity22_icon"
                          icon_color_rgb: !input "entity22_icon_color"
                          confirm:        !input "entity22_confirm"
                          component: buttonpage03.button06
                        - entity:         !input "entity23"
                          name:           !input "entity23_name"
                          icon:           !input "entity23_icon"
                          icon_color_rgb: !input "entity23_icon_color"
                          confirm:        !input "entity23_confirm"
                          component: buttonpage03.button07
                        - entity:         !input "entity24"
                          name:           !input "entity24_name"
                          icon:           !input "entity24_icon"
                          icon_color_rgb: !input "entity24_icon_color"
                          confirm:        !input "entity24_confirm"
                          component: buttonpage03.button08
                        - entity:         !input "entity25"
                          name:           !input "entity25_name"
                          icon:           !input "entity25_icon"
                          icon_color_rgb: !input "entity25_icon_color"
                          confirm:        !input "entity25_confirm"
                          component: buttonpage04.button01
                        - entity:         !input "entity26"
                          name:           !input "entity26_name"
                          icon:           !input "entity26_icon"
                          icon_color_rgb: !input "entity26_icon_color"
                          confirm:        !input "entity26_confirm"
                          component: buttonpage04.button02
                        - entity:         !input "entity27"
                          name:           !input "entity27_name"
                          icon:           !input "entity27_icon"
                          icon_color_rgb: !input "entity27_icon_color"
                          confirm:        !input "entity27_confirm"
                          component: buttonpage04.button03
                        - entity:         !input "entity28"
                          name:           !input "entity28_name"
                          icon:           !input "entity28_icon"
                          icon_color_rgb: !input "entity28_icon_color"
                          confirm:        !input "entity28_confirm"
                          component: buttonpage04.button04
                        - entity:         !input "entity29"
                          name:           !input "entity29_name"
                          icon:           !input "entity29_icon"
                          icon_color_rgb: !input "entity29_icon_color"
                          confirm:        !input "entity29_confirm"
                          component: buttonpage04.button05
                        - entity:         !input "entity30"
                          name:           !input "entity30_name"
                          icon:           !input "entity30_icon"
                          icon_color_rgb: !input "entity30_icon_color"
                          confirm:        !input "entity30_confirm"
                          component: buttonpage04.button06
                        - entity:         !input "entity31"
                          name:           !input "entity31_name"
                          icon:           !input "entity31_icon"
                          icon_color_rgb: !input "entity31_icon_color"
                          confirm:        !input "entity31_confirm"
                          component: buttonpage04.button07
                        - entity:         !input "entity32"
                          name:           !input "entity32_name"
                          icon:           !input "entity32_icon"
                          icon_color_rgb: !input "entity32_icon_color"
                          confirm:        !input "entity32_confirm"
                          component: buttonpage04.button08
                  - if: "{{ button_page_index >= 0 and button_page_index <= 3 }}"
                    then:
                      - service: "{{ nextion.commands.set_settings_entity }}"
                        data:
                          entity: 'unknown'
                      ##### Button Page Label #####
                      - if: "{{ button_pages_labels[button_page_index].label | length > 0 }}"
                        then:
                          - service: "{{ nextion.commands.text_printf }}"
                            data:
                              component: "{{ 'bpage%02d_label' | format(button_page_index+1) }}"
                              message: "{{ button_pages_labels[button_page_index].label }}"

                      - *variables-weather
                      ##### NSPanel build Button page #####
                      - repeat:
                          for_each: "{{ button_pages_buttons[first_button:last_button] }}"
                          sequence: &display-button_page_button
                            - if: "{{ repeat.item.entity is string and repeat.item.entity | length > 0 and repeat.item.entity.split('.') | default([]) | count > 0 }}"
                              then:
                                - variables:
                                    item_domain: "{{ repeat.item.entity.split('.')[0] | default('unknown') }}"
                                    # {{ states(entity_id) | default('unavailable') if entity_id is string else 'unavailable' }}
                                    current_entity_state: "{{ states(repeat.item.entity) | default('unavailable') }}"
                                    current_entity_state_available: "{{ current_entity_state not in ['unknown', 'unavailable', None] }}"
                                    # Button PIC GRAY/WHITE
                                    btn_pic: "{{ nextion.pics.button.on if current_entity_state in ['on', 'open', 'home'] or (item_domain == 'climate' and current_entity_state != 'off') else nextion.pics.button.off }}"
                                    # TEXT, BRIGHTNESS and ICON Background
                                    btn_bg: "{{ nextion.colors.white if current_entity_state in ['on', 'open', 'home'] or (item_domain == 'climate' and current_entity_state != 'off') else nextion.colors.grey_dark }}"
                                    # ICON Font Color
                                    btn_icon_font: >
                                      {% if not current_entity_state_available %} {{ nextion.colors.red }}
                                      {% elif item_domain in ['button', 'input_button', 'scene'] or current_entity_state in ['off', 'closed'] or (item_domain == 'person' and current_entity_state != 'home') %} {{ nextion.colors.grey_light }}
                                      {% elif current_entity_state in ['on', 'open', 'home'] or (item_domain == 'climate' and current_entity_state != 'off') %} {{ repeat.item.icon_color_rgb if is_number(repeat.item.icon_color_rgb) else ((repeat.item.icon_color_rgb[0] //(2**3)) *(2**11))+((repeat.item.icon_color_rgb[1] //(2**2)) *(2**5))+(repeat.item.icon_color_rgb[2] //(2**3)) }}
                                      {% else %} {{ nextion.colors.red }}
                                      {% endif %}
                                    # LABEL Font Color
                                    btn_txt_font: >-
                                      {% if not current_entity_state_available %} {{ nextion.colors.white }}
                                      {% elif item_domain in ['button', 'input_button', 'scene'] or current_entity_state in ['off', 'closed'] or (item_domain == 'person' and current_entity_state != 'home') %} {{ nextion.colors.white }}
                                      {% elif current_entity_state in ['on', 'open', 'home'] or (item_domain == 'climate' and current_entity_state != 'off') %} {{ nextion.colors.grey_dark }}
                                      {% else %} {{ nextion.colors.white }}
                                      {% endif %}
                                    # BRIGHTNESS Font Color
                                    btn_bri_font: "{{ nextion.colors.grey_dark }}"
                                    # ICON Value
                                    btn_icon: "{{ repeat.item.icon if repeat.item.icon | length > 0 else nextion.icons.buttons[repeat.item.entity.split('.')[0] if repeat.item.entity else 'unknown'] }}"
                                    # LABEL Value
                                    btn_label: "{{ repeat.item.name }}"
                                    # BRIGHTNESS Value
                                    btn_bri_txt: >-
                                      {% if not current_entity_state_available %} 0
                                      {% elif item_domain == 'light' and current_entity_state == 'on' and state_attr(repeat.item.entity, 'brightness') != None %} {{ (state_attr(repeat.item.entity, 'brightness') | int * 100 /255) | round(0) }}%
                                      {% elif item_domain == 'cover' and current_entity_state == 'open' and state_attr(repeat.item.entity, 'current_position') != None %} {{ (state_attr(repeat.item.entity, 'current_position') | int(100)) | round(0) }}%
                                      {% elif item_domain == 'climate' and current_entity_state != 'off' and state_attr(repeat.item.entity, "current_temperature") != None %} {{ (state_attr(repeat.item.entity, "current_temperature") | float) | round(0) }}{{ weather_units.temperature }}
                                      {% else -%} 0
                                      {% endif -%}
                                - *delay-default
                                - service: "{{ nextion.commands.set_button }}"
                                  data:
                                    btn_id: "{{ repeat.item.component }}"
                                    btn_pic: "{{ btn_pic }}"
                                    btn_bg: "{{ btn_bg }}"
                                    btn_icon_font: "{{ btn_icon_font }}"
                                    btn_txt_font: "{{ btn_txt_font }}"
                                    btn_bri_font: "{{ btn_bri_font }}"
                                    btn_icon: "{{ btn_icon }}"
                                    btn_label: "{{ btn_label }}"
                                    btn_bri_txt: "{{ btn_bri_txt }}"
                  ###### SHOW All component when page loading done #####
                  - *delay-default
                  - service: "{{ nextion.commands.show_all }}"

              ## PAGE LIGHTSETTINGS ##
              - alias: Light settings page
                conditions: "{{ trigger.event.data.new_state.state == nextion.pages.light }}"
                sequence:
                  - service: "{{ nextion.commands.text_printf }}"
                    data:
                      component: lightsettings.light_name
                      message: "{{ entity_long_name }}"
                  ##### LIGHT ICON - ON / OFF #####
                  - variables:
                      lightsettings_icon_font: "{{ entity_long_icon if entity_long_icon not in ['unavailable', 'unknown', None] and entity_long_icon | length > 0 else nextion.icons.buttons.light }}"
                      lightsettings_icon_font_color: "{{ entity_long_icon_color if is_state(entity_long, 'on') else nextion.colors.grey_light }}"
                  - *delay-default
                  - service: "{{ nextion.commands.text_printf }}"
                    data:
                      component: lightsettings.icon_state
                      message: "{{ lightsettings_icon_font }}"
                  - *delay-default
                  - service: "{{ nextion.commands.font_color }}"
                    data:
                      component: lightsettings.icon_state
                      message: "{{ lightsettings_icon_font_color }}"
                  ##### LIGHT State #####
                  - *delay-default
                  - if: "{{ state_attr(entity_long, 'brightness') != none }}"
                    then:
                      - service: "{{ nextion.commands.value }}"
                        data:
                          component: lightsettings.lightslider
                          message: "{{ (state_attr(entity_long, 'brightness') | int * 100 / 255) | round(0) }}"
                      - *delay-default
                      - service: "{{ nextion.commands.text_printf }}"
                        data:
                          component: lightsettings.light_value
                          message: "{{ (state_attr(entity_long, 'brightness') | int * 100 / 255) | round(0) }}%"
                      - *delay-default
                      - service: "{{ nextion.commands.text_printf }}"
                        data:
                          component: lightsettings.light_value_2
                          message: "{{ (state_attr(entity_long, 'brightness') | int * 100 /255) | round(0) }}%"
                    else:
                      - service: "{{ nextion.commands.value }}"
                        data:
                          component: lightsettings.lightslider
                          message: '0'
                      - *delay-default
                      - service: "{{ nextion.commands.text_printf }}"
                        data:
                          component: lightsettings.light_value
                          message: '0 %'
                      - *delay-default
                      - service: "{{ nextion.commands.text_printf }}"
                        data:
                          component: lightsettings.light_value_2
                          message: '0 %'

                  ##### LIGHT Check Color_Temp Value is available when yes send some current Values #####
                  - if: "{{ state_attr(entity_long, 'color_temp') != none }}"
                    then:
                      - *delay-default
                      - service: "{{ nextion.commands.text_printf }}"
                        data:
                          component: lightsettings.temp_value
                          message: "{{ (state_attr(entity_long, 'color_temp') | int ) | round(0) }}"
                      - *delay-default
                      - service: "{{ nextion.commands.text_printf }}"
                        data:
                          component: lightsettings.temp_value_2
                          message: "{{ (state_attr(entity_long, 'color_temp') | int ) | round(0) }}"
                      - *delay-default
                      - service: "{{ nextion.commands.value }}"
                        data:
                          component: lightsettings.tempslider
                          message: "{{ (state_attr(entity_long, 'color_temp') | int ) | round(0) }}"

              ## PAGE COVERSETTINGS ##
              - alias: Cover settings page
                conditions: "{{ trigger.event.data.new_state.state == nextion.pages.cover }}"
                sequence:
                  ##### COVER - OPEN / CLOSE #####
                  - variables:
                      coversettings_icon_font: "{{ entity_long_icon if entity_long_icon | length > 0 else nextion.icons.buttons.cover }}"
                      coversettings_icon_font_color: "{{ entity_long_icon_color if is_state(entity_long, 'open') else nextion.colors.grey_light }}"
                  - *delay-default
                  - service: "{{ nextion.commands.text_printf }}"
                    data:
                      component: coversettings.icon_state
                      message: "{{ coversettings_icon_font }}"
                  - *delay-default
                  - service: "{{ nextion.commands.font_color }}"
                    data:
                      component: coversettings.icon_state
                      message: "{{ coversettings_icon_font_color }}"
                  - *delay-default
                  - service: "{{ nextion.commands.text_printf }}"
                    data:
                      component: coversettings.cover_name
                      message: "{{ entity_long_name }}"

                  ##### COVER State
                  - service: "{{ nextion.commands.value }}"
                    data:
                      component: coversettings.coverslider
                      message: "{{ (state_attr(entity_long, 'current_position') | int ) | round(0) }}"
                  - *delay-default
                  - service: "{{ nextion.commands.text_printf }}"
                    data:
                      component: coversettings.cover_value
                      message: "{{ (state_attr(entity_long, 'current_position') | int ) | round(0) }} %"

                  ##### COVER Battery ICON Yes / NO #####
                  - variables:
                      battery_level: >
                        {% if state_attr(entity_long, 'battery') | default('unavailable') not in ['unavailable', 'unknown', None] %}
                          {{ state_attr(entity_long, 'battery') | default('unavailable') }}
                        {% elif expand(device_entities(device_id(entity_long))) | selectattr('attributes.device_class', 'defined') | selectattr('attributes.device_class', 'eq', 'battery') | map(attribute='state') | map('float') | list | count > 0 %}
                          {{ expand(device_entities(device_id(entity_long))) | selectattr('attributes.device_class', 'defined') | selectattr('attributes.device_class', 'eq', 'battery') | map(attribute='state') | map('float') | list | first }}
                        {% elif states(entity_long | replace('cover.','sensor.') ~ '_battery') | default('unavailable') not in ['unavailable', 'unknown', None] %}
                          {{ states(entity_long | replace('cover.','sensor.') ~ '_battery') | default('unavailable') }}
                        {% elif states(entity_long | replace('cover.','sensor.') | replace('cover', 'battery')) | default('unavailable') not in ['unavailable', 'unknown', None] %}
                          {{ states(entity_long | replace('cover.','sensor.') | replace('cover', 'battery')) | default('unavailable') }}
                        {% else %} unavailable
                        {% endif %}
                  - if: "{{ is_number(battery_level) }}"
                    then:
                      - *delay-default
                      - service: "{{ nextion.commands.text_printf }}"
                        data:
                          component: coversettings.battery_value
                          message: "{{ battery_level | round(0) }} %"
                      ### ICON Battery Font Color ###
                      - *delay-default
                      - service: "{{ nextion.commands.font_color }}"
                        data:
                          component: coversettings.battery_icon
                          message: "{{ nextion.colors.grey_super_light }}"
                      ### ICON Battery Font ###
                      - *delay-default
                      - service: "{{ nextion.commands.text_printf }}"
                        data:
                          component: coversettings.battery_icon
                          message: "{{ nextion.icons.battery }}"

              ## ENTITY PAGES 01 - 04 ##
              - alias: Entity pages
                conditions: "{{ trigger.event.data.new_state.state in nextion.pages.entitypages }}"
                sequence: &refresh-entity_pages
                  - &variables-entity_pages
                    variables:
                      ##### Entity pages #####
                      entity_pages_labels:
                        - label: !input "entity_page01_label"
                        - label: !input "entity_page02_label"
                        - label: !input "entity_page03_label"
                        - label: !input "entity_page04_label"
                      entity_pages_entities:
                        - entity: !input "entities_entity01"
                          name:   !input "entities_entity01_name"
                          icon:   !input "entities_entity01_icon"
                          component: entitypage01.value01
                        - entity: !input "entities_entity02"
                          name:   !input "entities_entity02_name"
                          icon:   !input "entities_entity02_icon"
                          component: entitypage01.value02
                        - entity: !input "entities_entity03"
                          name:   !input "entities_entity03_name"
                          icon:   !input "entities_entity03_icon"
                          component: entitypage01.value03
                        - entity: !input "entities_entity04"
                          name:   !input "entities_entity04_name"
                          icon:   !input "entities_entity04_icon"
                          component: entitypage01.value04
                        - entity: !input "entities_entity05"
                          name:   !input "entities_entity05_name"
                          icon:   !input "entities_entity05_icon"
                          component: entitypage01.value05
                        - entity: !input "entities_entity06"
                          name:   !input "entities_entity06_name"
                          icon:   !input "entities_entity06_icon"
                          component: entitypage01.value06
                        - entity: !input "entities_entity07"
                          name:   !input "entities_entity07_name"
                          icon:   !input "entities_entity07_icon"
                          component: entitypage01.value07
                        - entity: !input "entities_entity08"
                          name:   !input "entities_entity08_name"
                          icon:   !input "entities_entity08_icon"
                          component: entitypage01.value08
                        - entity: !input "entities_entity09"
                          name:   !input "entities_entity09_name"
                          icon:   !input "entities_entity09_icon"
                          component: entitypage02.value01
                        - entity: !input "entities_entity10"
                          name:   !input "entities_entity10_name"
                          icon:   !input "entities_entity10_icon"
                          component: entitypage02.value02
                        - entity: !input "entities_entity11"
                          name:   !input "entities_entity11_name"
                          icon:   !input "entities_entity11_icon"
                          component: entitypage02.value03
                        - entity: !input "entities_entity12"
                          name:   !input "entities_entity12_name"
                          icon:   !input "entities_entity12_icon"
                          component: entitypage02.value04
                        - entity: !input "entities_entity13"
                          name:   !input "entities_entity13_name"
                          icon:   !input "entities_entity13_icon"
                          component: entitypage02.value05
                        - entity: !input "entities_entity14"
                          name:   !input "entities_entity14_name"
                          icon:   !input "entities_entity14_icon"
                          component: entitypage02.value06
                        - entity: !input "entities_entity15"
                          name:   !input "entities_entity15_name"
                          icon:   !input "entities_entity15_icon"
                          component: entitypage02.value07
                        - entity: !input "entities_entity16"
                          name:   !input "entities_entity16_name"
                          icon:   !input "entities_entity16_icon"
                          component: entitypage02.value08
                        - entity: !input "entities_entity17"
                          name:   !input "entities_entity17_name"
                          icon:   !input "entities_entity17_icon"
                          component: entitypage03.value01
                        - entity: !input "entities_entity18"
                          name:   !input "entities_entity18_name"
                          icon:   !input "entities_entity18_icon"
                          component: entitypage03.value02
                        - entity: !input "entities_entity19"
                          name:   !input "entities_entity19_name"
                          icon:   !input "entities_entity19_icon"
                          component: entitypage03.value03
                        - entity: !input "entities_entity20"
                          name:   !input "entities_entity20_name"
                          icon:   !input "entities_entity20_icon"
                          component: entitypage03.value04
                        - entity: !input "entities_entity21"
                          name:   !input "entities_entity21_name"
                          icon:   !input "entities_entity21_icon"
                          component: entitypage03.value05
                        - entity: !input "entities_entity22"
                          name:   !input "entities_entity22_name"
                          icon:   !input "entities_entity22_icon"
                          component: entitypage03.value06
                        - entity: !input "entities_entity23"
                          name:   !input "entities_entity23_name"
                          icon:   !input "entities_entity23_icon"
                          component: entitypage03.value07
                        - entity: !input "entities_entity24"
                          name:   !input "entities_entity24_name"
                          icon:   !input "entities_entity24_icon"
                          component: entitypage03.value08
                        - entity: !input "entities_entity25"
                          name:   !input "entities_entity25_name"
                          icon:   !input "entities_entity25_icon"
                          component: entitypage04.value01
                        - entity: !input "entities_entity26"
                          name:   !input "entities_entity26_name"
                          icon:   !input "entities_entity26_icon"
                          component: entitypage04.value02
                        - entity: !input "entities_entity27"
                          name:   !input "entities_entity27_name"
                          icon:   !input "entities_entity27_icon"
                          component: entitypage04.value03
                        - entity: !input "entities_entity28"
                          name:   !input "entities_entity28_name"
                          icon:   !input "entities_entity28_icon"
                          component: entitypage04.value04
                        - entity: !input "entities_entity29"
                          name:   !input "entities_entity29_name"
                          icon:   !input "entities_entity29_icon"
                          component: entitypage04.value05
                        - entity: !input "entities_entity30"
                          name:   !input "entities_entity30_name"
                          icon:   !input "entities_entity30_icon"
                          component: entitypage04.value06
                        - entity: !input "entities_entity31"
                          name:   !input "entities_entity31_name"
                          icon:   !input "entities_entity31_icon"
                          component: entitypage04.value07
                        - entity: !input "entities_entity32"
                          name:   !input "entities_entity32_name"
                          icon:   !input "entities_entity32_icon"
                          component: entitypage04.value08
                  - variables:
                      entity_page_index: "{{ (nextion.pages.current[-2:] | int(-1)) - 1 }}"
                      first_entity: "{{ entity_page_index * 8 }}"
                      last_entity: "{{ first_entity + 8 }}"
                  ##### Entity page - Label #####
                  - if: "{{ entity_pages_labels[entity_page_index].label | length > 0 }}"
                    then:
                      - service: "{{ nextion.commands.text_printf }}"
                        data:
                          component: "{{ 'entity%02d_label' | format(entity_page_index + 1) }}"
                          message: "{{ entity_pages_labels[entity_page_index].label }}"
                      - *delay-default
                  ##### Entities #####
                  - repeat:
                      for_each: "{{ entity_pages_entities[first_entity:last_entity] }}"
                      sequence: &update-entity_page_entity
                        - if: "{{ repeat.item.entity is string and repeat.item.entity | length > 0 }}"
                          then:
                            - variables:
                                repeat_item_state: "{{ states(repeat.item.entity) | default('unavailable') }}"
                            - if: "{{ repeat.item.icon | length > 0 }}"
                              then:
                                - *delay-default
                                - service: "{{ nextion.commands.text_printf }}"
                                  data:
                                    component: "{{ repeat.item.component }}_pic"
                                    message: "{{ repeat.item.icon }}"
                            - *delay-default
                            - service: "{{ nextion.commands.text_printf }}"
                              data:
                                component: "{{ repeat.item.component }}_label"
                                message: >-
                                  {%- if repeat.item.name | length > 0 -%} {{ repeat.item.name }}
                                  {%- elif repeat_item_state in ['unavailable', 'unknown', None] -%} {{ repeat.item.entity }}
                                  {%- else -%} {{ state_attr(repeat.item.entity, 'friendly_name') | default(mui[language].no_name) }}
                                  {%- endif -%}
                            - *delay-default
                            - service: "{{ nextion.commands.text_printf }}"
                              data:
                                component: "{{ repeat.item.component }}"
                                message: "{{ repeat_item_state ~ ((state_attr(repeat.item.entity, 'unit_of_measurement') | default('')) if state_attr(repeat.item.entity, 'unit_of_measurement') else '') }}"

              ## PAGE CLIMATE ##
              - alias: Climate page
                conditions: "{{ trigger.event.data.new_state.state == nextion.pages.climate }}"
                sequence:
                  - *variables-weather
                  - variables:
                      hvac_mode: "{{ states(entity_long) | default('unavailable') if entity_long is string else 'unavailable' }}"
                      outdoor_temp_state: "{{ states(outdoortemp) | default('unavailable') if outdoortemp is string else 'unavailable' }}"
                      outdoor_temp: "{{ outdoor_temp_state if is_number(outdoor_temp_state) else state_attr(weather_entity, 'temperature') | default('unavailable') if weather_entity is string else 'unavailable' }}"
                      heating_state: "{{ mui[language].climate.states.off if hvac_mode == 'off' else mui[language].climate.states.on }}"
                  - service: "{{ nextion.commands.text_printf }}"
                    data:
                      component: climate.climate_label
                      message: "{{ entity_long_name }}"
                  - *delay-default
                  - service: "{{ nextion.commands.text_printf }}"
                    data:
                      component: outdoor_temp
                      message: "{{ (outdoor_temp | round(1) ~ weather_units.temperature) if is_number(outdoor_temp) else (mui[language].unavailable if outdoor_temp in ['unavailable', 'unknown', None] else outdoor_temp) }}"

                  - service: "{{ nextion.commands.text_printf }}"
                    data:
                      component: current_temp
                      message: "{{ (state_attr(entity_long, 'current_temperature') | round(1) ~ weather_units.temperature) if is_number(state_attr(entity_long, 'current_temperature')) else '' }}" # mui[language].unavailable?
                  - if: "{{ hvac_mode != 'off' and is_number(state_attr(entity_long, 'temperature')) }}"
                    then:
                      - variables:
                          target_temp: "{{state_attr(entity_long, 'temperature') | round(1)}}"
                      - service: "{{ nextion.commands.thermostat_cycle }}"
                        data:
                          value: "{{ target_temp }}"
                    else:
                      - service: "{{ nextion.commands.thermostat_cycle }}"
                        data:
                          value: "0"
                      - service: "{{ nextion.commands.text_printf }}"
                        data:
                          component: target_temp
                          message: " "
                  - service: "{{ nextion.commands.text_printf }}"
                    data:
                      component: heating_state
                      message: "{{ heating_state }}"

                  # HVAC Button PIC
                  - variables:
                      heating_bt_pic: >-
                        {%- if hvac_mode == 'off' -%} {{ nextion.pics.heating.button.off }}
                        {%- else -%} {{ nextion.pics.heating.button.on }}
                        {%- endif -%}
                  - *delay-default
                  - service: "{{ nextion.commands.printf }}"
                    data:
                      cmd: heating_bt_pic.pic={{ heating_bt_pic }}
                  - variables:
                      hotwatercharge_state: "{{ states(hotwatercharge) | default('unavailable') if hotwatercharge is string else 'unavailable' }}"
                      hotwatertemp_state: "{{ states(hotwatertemp) | default('unavailable') if hotwatertemp is string else 'unavailable' }}"
                      hotw_bt_pic: "{{ nextion.pics.hvac.button[hotwatercharge_state] | default(nextion.pics.hvac.button.blank) if hotwatercharge_state not in ['unavailable', 'unknown', None] else nextion.pics.hvac.button.blank }}"
                  - *delay-default
                  - service: "{{ nextion.commands.printf }}"
                    data:
                      cmd: hotw_bt_pic.pic={{ hotw_bt_pic }}
                  - if: "{{ hotwatertemp_state not in ['unavailable', 'unknown', None] }}"
                    then:
                      - *delay-default
                      - service: "{{ nextion.commands.text_printf }}"
                        data:
                          component: climate.hotwater_temp
                          message: "{{ (hotwatertemp_state | round(1) ~ weather_units.temperature) if is_number(hotwatertemp_state) else hotwatertemp_state }}"

              ## PAGE WEATHER (WEATHER01 to WEATHER05) ##
              - alias: Weather pages
                conditions: "{{ trigger.event.data.new_state.state in nextion.pages.weatherpages }}"
                sequence:
                  - *variables-weather
                  - variables:
                      page_name: "{{ trigger.event.data.new_state.state }}"
                      page_index: "{{ (page_name[-2:] | int(0)) - 1 }}"

                  ##### Display relative day #####
                  - service: "{{ nextion.commands.text_printf }}"
                    data:
                      component: "{{ page_name }}.day"
                      message: "{{ (dict.values(mui[language].relative_day) | list)[page_index] }}"
                  - *delay-default

                  ##### Display date (long) #####
                  - *variables-date_format
                  - service: "{{ nextion.commands.text_printf }}"
                    data:
                      component: "{{ page_name }}.date"
                      message: "{{ (dict.values(mui[language].weekdays) | list)[(now() + timedelta(days= (page_index))).weekday()] ~ ', ' ~ as_timestamp(now() + timedelta(days= (page_index))) | timestamp_custom(date_format) }}"
                  - *delay-default

                  ##### Display weather data only when available #####
                  - variables:
                      forecast_day: >
                        {{ state_attr(weather_entity, 'forecast') | default([])
                          | selectattr('datetime', 'defined')
                          | selectattr('datetime', '>=', (today_at('00:00') + timedelta(days= page_index)) | as_timestamp | timestamp_local )
                          | selectattr('datetime', '<', (today_at('00:00') + timedelta(days= (page_index+1))) | as_timestamp | timestamp_local )
                          | list
                        }}
                  - if: "{{ forecast_day | count > 0 }}"
                    then: # Display forecast
                      - variables:
                          accuweather: "{{ weather_type == 'AccuWeather' }}"
                          accuweather_day_name: "{{ 'day_' ~ page_index }}"
                          accuweather_sensor_prefix: "{{ 'sensor.' ~ (weather_entity | replace('weather.','')) ~ '_' }}"
                          accuweather_sensor_sufix: "{{ '_' ~ page_index ~ 'd' }}"
                          temp_min: >
                            {{ forecast_day | selectattr('templow', 'defined') | map(attribute='templow') | map('float') | list | min 
                              if forecast_day | selectattr('templow', 'defined') | map(attribute='templow') | map('float') | list | count > 0 
                              else forecast_day | selectattr('temperature', 'defined') | map(attribute='temperature') | map('float') | list | min | default('unknown')
                            }}
                          temp_max: "{{ forecast_day | selectattr('temperature', 'defined') | map(attribute='temperature') | map('float') | list | max | default('unknown') }}"
                          condition: "{{ forecast_day | selectattr('condition', 'defined') | map(attribute='condition') | list | first | default('unknown') }}"
                          precipitation: "{{ forecast_day | selectattr('precipitation', 'defined') | map(attribute='precipitation') | map('float') | list | sum | default('unknown') }}"
                          precipitation_probability: "{{ forecast_day | selectattr('precipitation_probability', 'defined') | map(attribute='precipitation_probability') | map('float') | list | sum | default('unknown') }}"
                          hours_of_sun: "{{ states(accuweather_sensor_prefix ~ 'hours_of_sun' ~ accuweather_sensor_sufix) | default('unknown') if accuweather else forecast_day | selectattr('hours_of_sun', 'defined') | map(attribute='hours_of_sun') | map('float') | list | sum | default('unknown') }}"
                          uv_index: "{{ states(accuweather_sensor_prefix ~ 'uv_index' ~ accuweather_sensor_sufix) | default('unknown') if accuweather else forecast_day | selectattr('uv_index', 'defined') | map(attribute='uv_index') | map('float') | list | max | default('unknown') }}"
                          wind_speed: "{{ forecast_day | selectattr('wind_speed', 'defined') | map(attribute='wind_speed') | map('float') | list | max | default('unknown') }}"
                          thunderstorm_probability: "{{ states(accuweather_sensor_prefix ~ 'thunderstorm_probability_day' ~ accuweather_sensor_sufix) | default('unknown') if accuweather else forecast_day | selectattr('thunderstorm_probability', 'defined') | map(attribute='thunderstorm_probability') | map('float') | list | max | default('unknown') }}"
                          parameters:
                            - name: hours_of_sun
                              visibility: "{{ is_number(hours_of_sun) }}"
                              value: "{{ (hours_of_sun | round(0) ~ ' ' ~ weather_units.hours_of_sun) if is_number(hours_of_sun) }}"
                              icon: "{{ nextion.icons.weather.sun }}"
                            - name: thunderstorm_probability
                              visibility: "{{ is_number(thunderstorm_probability) }}"
                              value: "{{ (thunderstorm_probability | round(0) ~ weather_units.thunderstorm_probability) if is_number(thunderstorm_probability) }}"
                              icon: "{{ nextion.icons.weather.lightning }}"
                            - name: precipitation
                              visibility: "{{ is_number(precipitation) or is_number(precipitation_probability) }}"
                              value: >
                                {{ (precipitation | round(0) ~ ' ' ~ weather_units.precipitation) if is_number(precipitation) }}
                                {{ '-' if is_number(precipitation) and is_number(precipitation_probability) }}
                                {{ (precipitation_probability | round(0) ~ weather_units.precipitation_probability) if is_number(precipitation_probability) }}
                              icon: "{{ nextion.icons.weather.rain }}"
                            - name: uv_index
                              visibility: "{{ is_number(uv_index) }}"
                              value: >
                                {{ (state_attr(accuweather_sensor_prefix ~ 'uv_index' ~ accuweather_sensor_sufix, 'level') | default(None) ~ ': ') if weather_type == 'AccuWeather' }}
                                {{ (uv_index | round(0) ~ weather_units.uv_index) if is_number(uv_index) }}
                              icon: "{{ nextion.icons.weather.protect }}"
                            - name: wind_speed
                              visibility: "{{ is_number(wind_speed) }}"
                              value: "{{ (wind_speed | round(0) ~ ' ' ~ weather_units.wind_speed) if is_number(wind_speed) }}"
                              icon: "{{ nextion.icons.weather.wind }}"
                      ##### Display weather PIC when available
                      - if: "{{ condition not in ['unknown', None] }}"
                        then:
                        - service: "{{ nextion.commands.printf }}"
                          data:
                            cmd: "{{ page_name }}.weather_icon.pic={{ nextion.pics.weather[states(weather_entity) | default('unavailable') if weather_entity is string else 'unavailable'] | default(None) if condition == 'unknown' and page_name == nextion.pages.weatherpages[0] else nextion.pics.weather[condition] | default(None) }}"
                        - *delay-default
                      ##### Display temperature (min) when available
                      - if: "{{ is_number(temp_min) }}"
                        then:
                          ##### SET TEMP MIN ####
                          - service: "{{ nextion.commands.text_printf }}"
                            data:
                              component: "{{ page_name }}.temp_min" ### Temperature MIN ###
                              message: "{{temp_min | round(0)}}{{ weather_units.temperature }}"
                          - *delay-default
                          ##### Slash #####
                          - service: "{{ nextion.commands.text_printf }}"
                            data:
                              component: "{{ page_name }}.slash"
                              message: '/'
                          - *delay-default

                      ##### Display temperature (max)) when available
                      - if: "{{ is_number(temp_max) }}"
                        then:
                          - service: "{{ nextion.commands.text_printf }}"
                            data:
                              component: "{{ page_name }}.temp_max" ### Temperature MAX ###
                              message: "{{ (temp_max | round(0) ~ weather_units.temperature) if is_number(temp_max) else '?' }}"
                          - *delay-default

                      ##### fields 1 to 5 (Parameters) #####
                      - repeat:
                          for_each: "{{ (parameters | selectattr('visibility', 'eq', true) | list)[:5] }}"
                          sequence:
                          - service: "{{ nextion.commands.text_printf }}"
                            data:
                              component: "{{ page_name }}.value0{{ repeat.index }}"
                              message: "{{ repeat.item.value }}"
                          - *delay-default
                          - service: "{{ nextion.commands.text_printf }}"
                            data:
                              component: "{{ page_name }}.value0{{ repeat.index }}_icon"
                              message: "{{ repeat.item.icon }}"
                          - *delay-default
                    else: # Display "Unavailable"
                      - service: "{{ nextion.commands.text_printf }}"
                        data:
                          component: "{{ page_name }}.value01"
                          message: "{{ mui[language].unavailable }}"
                      - *delay-default
 
              ## PAGE NOTIFICATION ##
              - alias: Notification page
                conditions: "{{ trigger.event.data.new_state.state == nextion.pages.notification }}"
                sequence:
                  - service: "{{ nextion.commands.text_printf }}"
                    data:
                      component: notification.notifi_text01
                      message: "{{ states(notification_text) | default(mui[language].unavailable) if notification_text is string else mui[language].unavailable }}"
                  - *delay-default
                  - service: "{{ nextion.commands.text_printf }}"
                    data:
                      component: notification.notifi_label
                      message: "{{ states(notification_label) | default(mui[language].unavailable) if notification_label is string else mui[language].unavailable }}"

              ## PAGE QR Code ##
              - alias: QRCode page
                conditions: "{{ trigger.event.data.new_state.state == nextion.pages.qrcode }}"
                sequence:
                  - variables:
                      qrcode_label: !input "qrcode_label"
                      qrcode_value: !input "qrcode_value"
                  - if: "{{ qrcode_label | length > 0 }}"
                    then:
                      - service: "{{ nextion.commands.text_printf }}"
                        data:
                          component: "qrcode_label"
                          message: "{{ qrcode_label }}"
                      - *delay-default
                  - service: "{{ nextion.commands.text_printf }}"
                    data:
                      component: "qrcode_value"
                      message: "{{ qrcode_value }}"

              ## PAGE SETTINGS ##
              #- alias: Settings page
              #  conditions: "{{ trigger.event.data.new_state.state == nextion.pages.settings }}"
              #  sequence:

              ## PAGE BOOT ##
              #- alias: Boot page
              #  conditions: "{{ trigger.event.data.new_state.state == nextion.pages.boot }}"
              #  sequence:

              ## PAGE SCREENSAVER ##
              #- alias: Screensaver page
              #  conditions: "{{ trigger.event.data.new_state.state == nextion.pages.screensaver }}"
              #  sequence:

      ##### BOOT NSPANEL - automation reload #####
      - alias: Automation reloaded
        conditions:
          - condition: trigger
            id: automation_reloaded
        sequence:
          - choose:
            ## PAGE HOME ##
            - conditions: "{{ nextion.pages.current == nextion.pages.home }}"
              sequence: *refresh_page_home
            
            ## PAGE BUTTON PAGES 01 - 04 ##
            - conditions: "{{ nextion.pages.current in nextion.pages.buttonpages }}"
              sequence: *refresh_page_buttonpage

            ## ENTITY PAGES ##
            - conditions: "{{ nextion.pages.current in nextion.pages.entitypages }}"
              sequence: *refresh-entity_pages

      ##### UPDATE BUTTONS AND PAGES -  button page / lightsettings page / coversettings page  #####
      - alias: "Update buttons & pages"
        conditions:
          - condition: trigger
            id:
              - current_state_entity01
              - current_state_entity02
              - current_state_entity03
              - current_state_entity04
              - current_state_entity05
              - current_state_entity06
              - current_state_entity07
              - current_state_entity08
              - current_state_entity09
              - current_state_entity10
              - current_state_entity11
              - current_state_entity12
              - current_state_entity13
              - current_state_entity14
              - current_state_entity15
              - current_state_entity16
              - current_state_entity17
              - current_state_entity18
              - current_state_entity19
              - current_state_entity20
              - current_state_entity21
              - current_state_entity22
              - current_state_entity23
              - current_state_entity24
              - current_state_entity25
              - current_state_entity26
              - current_state_entity27
              - current_state_entity28
              - current_state_entity29
              - current_state_entity30
              - current_state_entity31
              - current_state_entity32
          - "{{ nextion.pages.current in nextion.pages.buttonpages and trigger.to_state.state not in ['unavailable', 'unknown'] }}"
        sequence:
          - *variables-page_buttons
          - variables:
              buttonpage: "{{ nextion.pages.current }}"
          - repeat:
              for_each: "{{ button_pages_buttons | selectattr('component', 'defined') | selectattr('component', 'match', buttonpage) | selectattr('entity', 'defined') | selectattr('entity', 'eq', trigger.entity_id) | list }}"
              sequence: *display-button_page_button
          ##### release button/scene (stateless) #####
          - if: "{{ trigger.to_state.entity_id is match 'button.' or trigger.to_state.entity_id is match 'input_button.' or trigger.to_state.entity_id is match 'scene.' }}"
            then:
              - delay:
                  milliseconds: "1000"

      ##### SHORT PRESS BUTTON PAGE - toggle enities #####
      - alias: Button page - Short press
        conditions:
          - condition: trigger
            id: short_press
          - "{{ nextion.pages.current in nextion.pages.buttonpages }}"
        sequence:
          - *variables-page_buttons
          - variables:
              ##### Entity - Page Button - Toggle Entity #####
              last_click_state: "{{ states(last_click) | default('unavailable') if last_click is string else 'unavailable' }}"
              last_click_coordinates: "{{ last_click_state.replace('releasebuttonpage', '').split('button') if last_click_state not in ['unavailable', 'unknown', None] else [-1, -1] }}"
              last_click_entity_index: "{{ (last_click_coordinates[0] | int(-99) -1)*8 + last_click_coordinates[1] | int(-99) - 1 }}"
          - condition: "{{ last_click_entity_index >= 0 }}"
          - variables:
              last_click_button: "{{ button_pages_buttons[last_click_entity_index] | default([]) }}"
              entity_short: "{{ last_click_button.entity | default('unavailable') if last_click_button and last_click_button.entity is defined }}"
              entity_domain: "{{ (entity_short.split('.')[0] | default('unknown')) if entity_short is string and entity_short | length > 0 else 'unknown' }}"
          - condition: "{{ entity_domain not in ['unknown', 'person', 'binary_sensor', 'sensor'] }}"
          - if: "{{ entity_domain == 'climate' }}"
            then:
              - variables:
                  entity_long: "{{ entity_short }}"
                  entity_short_state: "{{ states(entity_short) | default('unavailable') if entity_short is string else 'unavailable' }}"
                  entity_long_name: "{{ entity_short if entity_short_state in ['unavailable', 'unknown'] else state_attr(entity_short, 'friendly_name') | default(mui[language].no_name) }}"
                  entity_back: "{{ nextion.pages.current }}"
              - service: "{{ nextion.commands.set_settings_entity }}"
                data:
                  entity: "{{ entity_long }},{{ entity_back }},{{ entity_long_name }}"
            else:
              - if: "{{ last_click_button.confirm }}"
                then:
                  - variables:
                      buttonpage: "{{ nextion.pages.current }}"
                      btn_entity_name: >-
                        {%- if state_attr(entity_short, 'friendly_name') != None -%} {{ state_attr(entity_short, 'friendly_name') }}
                        {%- elif state_attr(entity_short, 'name') != None -%} {{ state_attr(entity_short, 'name') }}
                        {%- else -%} 'unknown'
                        {%- endif -%}
                  #### turn on switch confirmation_message
                  - service: switch.turn_on
                    data:
                      entity_id: "{{ confirmation_message }}"
                  - service: "{{ nextion.commands.printf }}"
                    data:
                      cmd: "page {{ nextion.pages.notification }}"
                  - service: "{{ nextion.commands.text_printf }}"
                    data:
                      component: notification.notifi_text01
                      message: "{{ btn_entity_name }}"
                  - *delay-default
                  - service: "{{ nextion.commands.text_printf }}"
                    data:
                      component: notification.notifi_label
                      message: "{{ mui[language].please_confirm }}"
                  - wait_template: "{{ is_state(last_click, ['notificationacceptrelease', 'notificationclearrelease', 'homepage']) }}"
                    timeout:
                      seconds: 10
                    continue_on_timeout: true
                  - choose:
                    - conditions: "{{ is_state(last_click, 'notificationacceptrelease') }}"
                      sequence:
                        - service: "{{ nextion.commands.printf }}"
                          data:
                            cmd: "page {{ buttonpage }}"
                        - service: switch.turn_off
                          data:
                            entity_id: "{{ confirmation_message }}"
                        - &service-button_changed
                          service: >-
                            {% if entity_domain in ['light', 'switch', 'cover', 'input_boolean', 'automation', 'fan'] %}
                              {{ entity_domain }}.toggle
                            {% elif entity_domain in ['button', 'input_button'] %}
                              {{ entity_domain }}.press
                            {% elif entity_domain in ['scene', 'script'] %}
                              {{ entity_domain }}.turn_on
                            {% else %}
                              homeassistant.update_entity
                            {% endif %}
                          data:
                            entity_id: "{{ entity_short }}"
                          continue_on_error: true
                    - conditions: "{{ is_state(last_click, 'notificationclearrelease') }}"
                      sequence:
                        - service: "{{ nextion.commands.printf }}"
                          data:
                            cmd: "page {{ buttonpage }}"
                        - service: switch.turn_off
                          data:
                            entity_id: "{{ confirmation_message }}"
                    - conditions: "{{ is_state(last_click, 'homepage') }}"
                      sequence:
                        - service: switch.turn_off
                          data:
                            entity_id: "{{ confirmation_message }}"
                    default:
                      - service: switch.turn_off
                        data:
                          entity_id: "{{ confirmation_message }}"
                      - service: "{{ nextion.commands.printf }}"
                        data:
                          cmd: "page {{ nextion.pages.home }}"
                else:
                  - *service-button_changed

      ##### LONG PRESS BUTTON PAGE - save entity for settings pages #####
      - alias: Button page - Long press
        conditions:
          - condition: trigger
            id: long_press
          - "{{ nextion.pages.current in nextion.pages.buttonpages }}"
        sequence:
          - *variables-page_buttons
          - variables:
              last_click_state: "{{ trigger.to_state.state }}"
              last_click_coordinates: "{{ last_click_state.replace('pressbuttonpage', '').split('button') }}"
              last_click_entity_index: "{{ (last_click_coordinates[0] | int(-99) -1)*8 + last_click_coordinates[1] | int(-99) - 1 }}"
              last_click_button: "{{ button_pages_buttons[last_click_entity_index] }}"
              ##### Long Press Entity #####
              entity_long: "{{ last_click_button.entity }}"
              entity_domain: "{{ (entity_long.split('.')[0] | default('unknown')) if entity_long | length > 0 else 'unknown' }}"
              ##### Long Press Entity Name #####
              entity_long_name: "{{ last_click_button.name }}"
              ##### Long Press Entity Icon #####
              entity_long_icon: "{{ last_click_button.icon }}"
              ##### Long Press Entity Icon Color #####
              entity_long_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)) }}"
              ##### Current Page #####
              entity_back: "{{ nextion.pages.current }}"
          - service: "{{ nextion.commands.set_settings_entity }}"
            data:
              entity: "{{ entity_long }},{{ entity_back }},{{ entity_long_name }},{{ entity_long_icon }},{{ entity_long_icon_color }}"

      ##### LASTCLICK_LIGHTSETTINGS - changes on page lightsettings #####
      - alias: Changes on page lightsettings
        conditions:
          - condition: trigger
            id: light_settings
          - "{{ nextion.pages.current == nextion.pages.light }}"
        sequence:
          - choose:
              ##### Page Lightsettings - Brightness Slider MOVE #####
              - conditions:
                  #- '{{ trigger.event.data.new_state.state is match "brightness\d+" and trigger.event.data.new_state.state == states(last_click_lightsettings) }}'
                  - '{{ trigger.event.data.new_state.state is match "brightness\d+" }}'
                sequence:
                  - service: light.turn_on
                    data:
                      entity_id: "{{ entity_long }}"
                      brightness: "{{ (trigger.event.data.new_state.state | replace('brightness','') | int / 100 * 255) | round(0) }}"
                  #### wird nicht mehr benötigt, da es im nextion editor nun direkt gemacht wird
                  # - delay:
                  #     milliseconds: "{{ delay_value }}"
                  # - service: "{{ nextion.commands.text_printf }}"
                  #   data:
                  #     component: lightsettings.light_value
                  #     message: "{{ (trigger.event.data.new_state.state | replace('brightness','') | int * 100 /255) | round(0) }}%'
                  # - delay:
                  #     milliseconds: "{{ delay_value }}"
                  # - service: "{{ nextion.commands.text_printf }}"
                  #   data:
                  #     component: lightsettings.light_value_2
                  #     message: "{{ (trigger.event.data.new_state.state | replace('brightness','') | int * 100 /255) | round(0) }}%'

                #     value_template: "{{ states(last_click_lightsettings) is match 'brightness\d+' }}"
                # sequence:
                #   - service: light.turn_on
                #     data:
                #       entity_id: "{{ entity_long }}"
                #       brightness: "{{ states(last_click_lightsettings) | replace('brightness','') | int }}"
                #   - service: "{{ nextion.commands.text_printf }}"
                #     data:
                #       component: lightsettings.light_value
                #       message: "{{ (states(last_click_lightsettings) | replace('brightness','') | int * 100 /255) | round(0) }}"


              ##### Page Lightsettings - color_Temp Slider MOVE #####
              - conditions:
                  - '{{ trigger.event.data.new_state.state is match "colortemp\d+" and trigger.event.data.new_state.state == (states(last_click_lightsettings) | default("unavailable") if last_click_lightsettings is string else "unavailable") }}'
                sequence:
                  - service: light.turn_on
                    data:
                      entity_id: "{{ entity_long }}"
                      color_temp: "{{ trigger.event.data.new_state.state | replace('colortemp','') | int }}"
                  #### wird nicht mehr benötigt, da es im nextion editor nun direkt gemacht wird
                  # - delay:
                  #     milliseconds: "{{ delay_value }}"
                  # - service: "{{ nextion.commands.text_printf }}"
                  #   data:
                  #     component: lightsettings.temp_value
                  #     message: "{{ trigger.event.data.new_state.state | replace('colortemp','') | int }}"
                  # - delay:
                  #     milliseconds: "{{ delay_value }}"
                  # - service: "{{ nextion.commands.text_printf }}"
                  #   data:
                  #     component: lightsettings.temp_value_2
                  #     message: "{{ trigger.event.data.new_state.state | replace('colortemp','') | int }}"

              ##### Page Lightsettings - Color RGB Slider MOVE #####
              - conditions:
                  - '{{ trigger.event.data.new_state.state is match "\d+,\d+,\d+" }}'
                sequence:
                  - service: light.turn_on
                    data:
                      entity_id: "{{ entity_long }}"
                      rgb_color: "{{ trigger.event.data.new_state.state.split(',') }}"

              ##### Page Lightsettings - Close Lightsetting Page #####
              - conditions:
                  - "{{ trigger.event.data.new_state.state == 'releaselightsettingsclose' }}"
                sequence:
                  - service: "{{ nextion.commands.printf }}"
                    data:
                      cmd: "page {{ entity_back }}"

      ##### LASTCLICK_COVERSETTINGS - changes on page coversettings #####
      - alias: Changes on page coversettings
        conditions:
          - condition: trigger
            id: cover_settings
          - "{{ nextion.pages.current == nextion.pages.cover }}"
        sequence:
          - choose:
              ##### Page Coversettings - Cover Slider MOVE #####
              - conditions:
                  # - "{{ trigger.event.data.new_state.state is match 'coverposition\d+' and trigger.event.data.new_state.state == states(last_click_coversettings) }}"
                  - '{{ trigger.event.data.new_state.state is match "coverposition\d+" }}'
                sequence:
                  - service: cover.set_cover_position
                    data:
                      entity_id: "{{ entity_long }}"
                      position: "{{ trigger.event.data.new_state.state | replace('coverposition','') | int }}"
                  #### wird nicht mehr benötigt, da es im nextion editor nun direkt gemacht wird
                  # - delay:
                  #     milliseconds: "{{ delay_value }}"
                  # - service: "{{ nextion.commands.text_printf }}"
                  #   data:
                  #     component: coversettings.cover_value
                  #     message: "{{ trigger.event.data.new_state.state | replace('coverposition','') | int }} %'
                  # - delay:
                  #     milliseconds: "{{ delay_value }}"
                  # - service: "{{ nextion.commands.text_printf }}"
                  #   data:
                  #     component: coversettings.cover_value_2
                  #     message: "{{ trigger.event.data.new_state.state | replace('coverposition','') | int }} %'

              ##### Page Coversettings - Cover CLOSE Button #####
              - conditions:
                  - "{{ trigger.event.data.new_state.state == 'cover_close_press' }}"
                sequence:
                  - service: cover.close_cover
                    data:
                      entity_id: "{{ entity_long }}"

              ##### Page Coversettings - Cover OPEN Button #####
              - conditions:
                  - "{{ trigger.event.data.new_state.state == 'cover_open_press' }}"
                sequence:
                  - service: cover.open_cover
                    data:
                      entity_id: "{{ entity_long }}"

              ##### Page Coversettings - Cover STOP Button #####
              - conditions:
                  - "{{ trigger.event.data.new_state.state == 'cover_stop_press' }}"
                sequence:
                  - service: cover.stop_cover
                    data:
                      entity_id: "{{ entity_long }}"

              ##### Page Coversettings - Close Coversettings Page #####
              - conditions:
                  - "{{ trigger.event.data.new_state.state == 'releasecoversettingsclose' }}"
                sequence:
                  - service: "{{ nextion.commands.printf }}"
                    data:
                      cmd: "page {{ entity_back }}"

      ##### LASTCLICK_CLIMATESETTINGS - changes on page climatesettings #####
      - alias: Changes on page climatesettings
        conditions:
          - condition: trigger
            id: climate_settings
          - "{{ nextion.pages.current == nextion.pages.climate }}"
        sequence:
          - variables:
              entity_long_state: "{{ states(entity_long) | default('unavailable') if entity_long is string else 'unavailable' }}"
          - choose:
              ##### Page Climatesettings - hotwater #####
              - conditions: "{{ trigger.event.data.new_state.state == 'releasehotwater' }}"
                sequence:
                  - service: >-
                      {% if hotwatercharge is match 'switch.' %}
                        switch.toggle
                      {% elif hotwatercharge is match 'input_boolean.' %}
                        input_boolean.toggle
                      {% endif %}
                    data:
                      entity_id: "{{ hotwatercharge }}"

              ##### Page Climatesettings - heating #####
              - conditions: "{{ trigger.event.data.new_state.state == 'releaseheating' }}"
                sequence:
                  - if: "{{ entity_long_state == 'off' }}"
                    then:
                      - service: climate.turn_on ############
                        data:
                          entity_id: "{{ entity_long }}"
                      # - service: climate.set_temperature
                      #   data:
                      #     entity_id: !input climate
                      #     hvac_mode: 'heat'
                      #     temperature: "{{ state_attr(climate, 'temperature') }}"
                    else:
                      - service: climate.turn_off ############
                        data:
                          entity_id: "{{ entity_long }}"
                      # - service: climate.set_temperature
                      #   data:
                      #     entity_id:  !input climate
                      #     hvac_mode: 'off'
                      #     temperature: "{{ state_attr(climate, 'temperature') }}"

              ##### Page Climatesettings - increase/decrease temp #####
              - conditions: "{{ trigger.event.data.new_state.state in [ 'releaseincreasetemp', 'releasedecreasetemp'] }}"
                sequence:
                  - variables:
                      delta: "{{ +0.5 if trigger.event.data.new_state.state == 'releaseincreasetemp' else -0.5 }}"
                  - if: "{{ entity_long_state != 'off' }}"
                    then:
                      - if: "{{ climate_optimistic == true }}" ## TODO - remove from here
                        then:
                          - variables:
                              current_setpoint: "{{ states(display_target_temperature) | default('unavailable') if display_target_temperature is string else 'unavailable' }}"
                          - if: "{{ is_number(current_setpoint) }}"
                            then:
                              - service: "{{ nextion.commands.thermostat_cycle }}"
                                data:
                                  value: "{{ (current_setpoint + delta) | round(1) }}"
                        else:
                          - variables:
                              current_setpoint: "{{state_attr(entity_long, 'temperature') | default('unavailable') if entity_long is string else 'unavailable' }}"
                          - if: "{{ is_number(current_setpoint) }}"
                            then:
                              - service: climate.set_temperature
                                data:
                                  entity_id: "{{ entity_long }}"
                                  #hvac_mode: 'heat'
                                  temperature: "{{ (current_setpoint + delta) | round(1) }}"

              ##### Page Climatesettings - climateslider #####
              - conditions: '{{ trigger.event.data.new_state.state is match "climateslider\d+" and trigger.event.data.new_state.state == states(last_click_climatesettings) }}'
                sequence:
                  - if: "{{ entity_long_state != 'off' }}"
                    then:
                      - variables:
                          climateslider: "{{ trigger.event.data.new_state.state | replace('climateslider','') | int(-1) }}"
                          new_setpoint: "{{ (13.0 + (climateslider * 0.5)) if climateslider >= 0 and climateslider <= 27 }}"
                      - if: "{{ climate_optimistic == true }}" ## TODO - remove from here
                        then:
                          - service: "{{ nextion.commands.thermostat_cycle }}"
                            data:
                              value: "{{ new_setpoint }}"
                        else:
                          - service: climate.set_temperature
                            data:
                              entity_id: "{{ entity_long }}"
                              #hvac_mode: 'heat'
                              temperature: "{{ new_setpoint }}"

              #### Page Climate - Close Climate Page #####
              - conditions:
                  - "{{ trigger.event.data.new_state.state == 'releaseclimateclose' }}"
                sequence:
                  - service: "{{ nextion.commands.printf }}"
                    data:
                      cmd: "page {{ entity_back }}"

##### TRIGGER - HOME PAGE ######

      ##### HOME PAGE - Values #####
      - alias: Home page - Values
        conditions:
          - condition: trigger
            id:
              - home_value01_state
              - home_value02_state
              - home_value03_state
          - "{{ nextion.pages.current == nextion.pages.home }}"
        sequence:
          - *variables-home_page_values
          #- *display-home_page_values
          - repeat:
              for_each: "{{ home_page_values | selectattr('entity', 'defined') | selectattr('entity', 'eq', trigger.entity_id) | list }}"
              sequence:
                - *display-home_page_value

      ##### HOME PAGE - Status bar #####
      - alias: Home page - status bar
        conditions:
          - condition: trigger
            id: 
              - relay01_state
              - relay02_state
              - climate_state
              - chip01_state
              - chip02_state
              - chip03_state
              - chip04_state
              - chip05_state
              - chip06_state
              - chip07_state
          - "{{ nextion.pages.current == nextion.pages.home and trigger.event.data.new_state.state not in ['unavailable', 'unknown'] }}"
        sequence:
          - *variables-home_page_status_bar
          - repeat:
              for_each: "{{ home_page_status_bar | selectattr('entity', 'defined') | selectattr('entity', 'eq', trigger.event.data.entity_id) | list }}"
              sequence:
                - *display-home_page_status_bar

      ##### JUMP TO - climate page #####
      - alias: Jump to climate page
        conditions:
          - condition: trigger
            id: open_climate_page
          - condition: template
            value_template: "{{ nextion.pages.current == nextion.pages.home and climate | length > 0 }} "
        sequence:
          - variables:
              entity_long: "{{ climate }}"
              entity_long_state: "{{ states(climate) | default('unavailable') if climate is string else 'unavailable' }}"
              entity_long_name: "{{ climate if entity_long_state in ['unavailable', 'unknown', None] else (state_attr(climate, 'friendly_name') | default(mui[language].no_name) if climate is string else mui[language].unavailable )}}"
              entity_back: "{{ nextion.pages.home }}"
          - service: "{{ nextion.commands.set_settings_entity }}"
            data:
              entity: "{{ entity_long }},{{ entity_back }},{{ entity_long_name }}"

          - service: "{{ nextion.commands.printf }}"
            data:
              cmd: "page {{ nextion.pages.climate }}"

      ##### JUMP TO - Weather Page  #####
      - alias: Jump to weather page
        conditions:
          - condition: trigger
            id: open_weather_page
          - condition: template
            value_template: "{{ nextion.pages.current == nextion.pages.home }}"
        sequence:
          - service: "{{ nextion.commands.printf }}"
            data:
              cmd: "page {{ nextion.pages.weatherpages[0] }}"

      ##### JUMP TO - QR Code Page  #####
      - alias: Jump to QR code page
        conditions:
          - condition: trigger
            id: open_qrcode_page
          - condition: template
            value_template: "{{ nextion.pages.current == nextion.pages.home and qrcode_enabled == true }}"
        sequence:
          - service: "{{ nextion.commands.printf }}"
            data:
              cmd: "page {{ nextion.pages.qrcode }}"

      ##### JUMP TO - ENTITY Page  #####
      - alias: Jump to entity page
        conditions:
          - condition: trigger
            id: open_entity_page
          - condition: template
            value_template: "{{ nextion.pages.current == nextion.pages.home and entitypages_enabled == true }}"
        sequence:
          - service: "{{ nextion.commands.printf }}"
            data:
              cmd: "page {{ nextion.pages.entitypages[0] }}"

      ##### JUMP TO - notification #####
      - alias: Jump to notification page
        conditions:
          - condition: trigger
            id: open_notification_page
          - condition: template
            value_template: "{{ nextion.pages.current == nextion.pages.home and notification_text is string and states(notification_text) | length > 0 }}"
        sequence:
          - service: "{{ nextion.commands.printf }}"
            data:
              cmd: "page {{ nextion.pages.notification }}"

      #### SHOW BUTTON - notification ####
      - alias: Show button - Notification
        conditions:
          - condition: trigger
            id:
              - notification_text_state
              - notification_unread_state
          - condition: template
            value_template: "{{ nextion.pages.current == nextion.pages.home and trigger.event.data.new_state.state not in ['unavailable', 'unknown', None] }}"
        sequence:
          - alias: "Set notifiy pic"
            variables:
              notification_text_state: "{{ states(notification_text) | default('unavailable') if notification_text is string else 'unavailable' }}"
              notification_text_available: "{{ notification_text_state not in ['unavailable', 'unknown', None] }}"
              notification_unread_state: "{{ states(notification_unread) | default('unavailable') if notification_unread is string else 'unavailable' }}"
              set_button04_icon: "{{ page_home.buttons[3].icon if notification_unread_state in ['on', 'off'] and notification_text_available else nextion.icons.blank }}"
              set_button04_icon_font: >
                {{
                  (page_home.buttons[3].color_rgb[notification_unread_state] if is_number(page_home.buttons[3].color_rgb[notification_unread_state]) else ((page_home.buttons[3].color_rgb[notification_unread_state][0] //(2**3)) *(2**11))+((page_home.buttons[3].color_rgb[notification_unread_state][1] //(2**2)) *(2**5))+(page_home.buttons[3].color_rgb[notification_unread_state][2] //(2**3)))
                  if notification_unread_state in ['on', 'off'] and notification_text_available
                  else nextion.colors.grey_light
                }}
          ##### SET ICON Font - Notify #####
          - *delay-default
          - service: "{{ nextion.commands.text_printf }}"
            data:
              component: home.button04_icon
              message: "{{ set_button04_icon }}"

          ##### SET ICON Font Color - Notify #####
          - *delay-default
          - service: "{{ nextion.commands.font_color }}"
            data:
              component: home.button04_icon
              message: "{{ set_button04_icon_font }}"

      ##### SHOW BUTTON - notification clear #####
      - alias: Show button - Notification clear
        conditions:
          - condition: trigger
            id: btn_notificationclearrelease
          - condition: template
            value_template: "{{ nextion.pages.current == nextion.pages.notification and confirmation_message is string and states(confirmation_message) | default('unavailable') != 'on' }}"
        sequence:
          - service: switch.turn_off
            data:
              entity_id: "{{ notification_unread }}"
          - service: "{{ nextion.commands.printf }}"
            data:
              cmd: "page {{ nextion.pages.home }}"

      ##### SHOW BUTTON - notification accept #####
      - alias: Show button - Notification accept
        conditions:
          - condition: trigger
            id: btn_notificationacceptrelease
          - condition: template
            value_template: "{{ nextion.pages.current == nextion.pages.notification and confirmation_message is string and states(confirmation_message) | default('unavailable') != 'on' }}"
        sequence:
          - service: switch.turn_off
            data:
              entity_id: "{{ notification_unread }}"
          - service: "{{ nextion.commands.notification_clear }}"
            data: {}
          - service: "{{ nextion.commands.printf }}"
            data:
              cmd: "page {{ nextion.pages.home }}"

      ##### BUTTON - press #####
      - alias: Button - Press
        conditions:
          - condition: trigger
            id: 
              - left_button_press
              - right_button_press
        sequence:
          - variables:
              button_context: "{{ page_home.hardware.buttons.left if trigger.id == 'left_button_press' else page_home.hardware.buttons.right }}"
          - wait_template: "{{ is_state(left_button if trigger.id == 'left_button_press' else right_button, 'off') }}"
            timeout: !input hold_delay
            continue_on_timeout: true
          - if: "{{ not wait.completed }}"
            then: # Hold
              - choose:
                  - conditions: "{{ button_context.hold_select == 'Default' and button_context.entity | length > 0 }}"
                    sequence:
                      - variables:
                          entity_long: "{{ button_context.entity }}"
                          button_status: "{{ states(button_context.entity) | default('unavailable') if button_context.entity is string else 'unavailable' }}"
                          entity_long_name: >-
                            {%- if button_context.name | length > 0 -%} {{ button_context.name }}
                            {%- elif button_status in ['unavailable', 'unknown', None] -%} {{ button_context.entity }}
                            {%- else -%} {{ state_attr(button_context.entity, 'friendly_name') | default(mui[language].no_name) }}
                            {%- endif -%}
                          entity_back: "{{ nextion.pages.home }}"
                          entity_long_icon: "{{ nextion.icons.buttons[button_context.entity.split('.')[0] if button_context.entity else 'unknown'] }}"
                          entity_long_icon_color: 1055
                      - service: "{{ nextion.commands.set_settings_entity }}"
                        data:
                          entity: "{{ entity_long }},{{ entity_back }},{{ entity_long_name }},{{ entity_long_icon }},{{ entity_long_icon_color }}"
                  - conditions: "{{ button_context.hold_select == 'Custom Action' and trigger.id == 'left_button_press' }}"
                    sequence: !input left_button_hold_custom_action
                  - conditions: "{{ button_context.hold_select == 'Custom Action' and trigger.id == 'right_button_press' }}"
                    sequence: !input right_button_hold_custom_action
            else: # Single Click
              - condition: template
                value_template: "{{ button_context.entity | length > 0 }}"
              - variables:
                  button_domain: "{{ (button_context.entity.split('.')[0] | default('unknown')) if button_context.entity | length > 0 else 'unknown' }}"
              - service: >
                  {% if button_domain in ['light', 'switch', 'cover', 'input_boolean', 'automation', 'fan'] %}
                    {{ button_domain }}.toggle
                  {% elif button_domain in ['button', 'input_button'] %}
                    {{ button_domain }}.press
                  {% elif button_domain in ['scene', 'script'] %}
                    {{ button_domain }}.turn_on
                  {% else %}
                    homeassistant.update_entity
                  {% endif %}
                data:
                  entity_id: "{{ button_context.entity }}"

      ##### BUTTON - state #####
      - alias: Button - State
        conditions:
          - condition: trigger
            id: 
              - left_button_state
              - right_button_state
          - condition: template
            value_template: "{{ nextion.pages.current == nextion.pages.home }}"
        sequence:
          - variables:
              # Hardware Button PIC
              current_hardware_button_state: "{{ nextion.pics.hardware.button[trigger.to_state.state] }}"
          ##### SET hardware Button PIC on Home Page ####
          - service: "{{ nextion.commands.printf }}"
            data:
              cmd: "home.{{ 'left' if trigger.id == 'left_button_state' else 'right'}}_bt_pic.pic={{ current_hardware_button_state }}"

      ##### DATE AND TIME #####
      - alias: "Date & Time"
        conditions:
          - condition: trigger
            id: time_state
          - condition: template
            value_template: "{{ nextion.pages.current == nextion.pages.home }}"
        sequence:
          ### TIME Font Color ###
          - *delay-default
          - service: "{{ nextion.commands.font_color }}"
            data:
              component: home.time
              message: "{{ page_home.general.time.label.color_rgb if is_number(page_home.general.time.label.color_rgb) else ((page_home.general.time.label.color_rgb[0] //(2**3)) *(2**11))+((page_home.general.time.label.color_rgb[1] //(2**2)) *(2**5))+(page_home.general.time.label.color_rgb[2] //(2**3)) }}"
          ### TIME Font ###
          - service: "{{ nextion.commands.text_printf }}"
            data:
              component: home.time
              message: "{{ time }}"
          ### TIME Meridiem Font Color ###
          - *delay-default
          - service: "{{ nextion.commands.font_color }}"
            data:
              component: home.meridiem
              message: "{{ page_home.general.time.label.color_rgb if is_number(page_home.general.time.label.color_rgb) else ((page_home.general.time.label.color_rgb[0] //(2**3)) *(2**11))+((page_home.general.time.label.color_rgb[1] //(2**2)) *(2**5))+(page_home.general.time.label.color_rgb[2] //(2**3)) }}"
          ### TIME Meridiem Font ###
          - *delay-default
          - service: "{{ nextion.commands.text_printf }}"
            data:
              component: home.meridiem
              message: "{{ meridiem }}"

          ### DATE Font Color ###
          - *delay-default
          - service: "{{ nextion.commands.font_color }}"
            data:
              component: home.date
              message: "{{ page_home.general.date.label.color_rgb if is_number(page_home.general.date.label.color_rgb) else ((page_home.general.date.label.color_rgb[0] //(2**3)) *(2**11))+((page_home.general.date.label.color_rgb[1] //(2**2)) *(2**5))+(page_home.general.date.label.color_rgb[2] //(2**3)) }}"
          ### DATE Font ###
          - *delay-default
          - service: "{{ nextion.commands.text_printf }}"
            data:
              component: home.date
              message: "{{ (dict.values(mui[language].weekdays) | list)[now().weekday()] ~ ', ' ~ as_timestamp(now()) | timestamp_custom('%d.%m') }}"

      ##### OUTDOOR TEMP - entity #####
      - alias: Outdoor temp - Entity
        conditions:
          - condition: trigger
            id: outdoortemp_state
          - condition: template
            value_template: "{{ nextion.pages.current == nextion.pages.home and is_number(trigger.event.data.new_state.state) }}"
        sequence:
          - *variables-weather
          ### LABEL Outdoor Temp Font Color ###
          - *delay-default
          - service: "{{ nextion.commands.font_color }}"
            data:
              component: home.outdoor_temp
              message: "{{ page_home.general.outdoor_temp.label.color_rgb if is_number(page_home.general.outdoor_temp.label.color_rgb) else ((page_home.general.outdoor_temp.label.color_rgb[0] //(2**3)) *(2**11))+((page_home.general.outdoor_temp.label.color_rgb[1] //(2**2)) *(2**5))+(page_home.general.outdoor_temp.label.color_rgb[2] //(2**3)) }}"
          ### LABEL Outdoor Temp Font ###
          - *delay-default
          - service: "{{ nextion.commands.text_printf }}"
            data:
              component: home.outdoor_temp
              message: "{{ trigger.event.data.new_state.state | round(1) }}{{ weather_units.temperature }}"

      ##### INDOOR TEMP - entity #####
      - alias: Indoor temp - Entity
        conditions:
          - condition: trigger
            id: indoortemp_state
          - condition: template
            value_template: "{{ nextion.pages.current == nextion.pages.home and trigger.event.data.new_state.state not in ['unavailable', 'unknown', None] }}"
        sequence:
          - *variables-weather
          ### LABEL Indoor Temp Font Color ###
          - *delay-default
          - service: "{{ nextion.commands.font_color }}"
            data:
              component: home.current_temp
              message: "{{ page_home.general.indoor_temp.label.color_rgb if is_number(page_home.general.indoor_temp.label.color_rgb) else ((page_home.general.indoor_temp.label.color_rgb[0] //(2**3)) *(2**11))+((page_home.general.indoor_temp.label.color_rgb[1] //(2**2)) *(2**5))+(page_home.general.indoor_temp.label.color_rgb[2] //(2**3)) }}"
          ### LABEL Indoor Temp Font ###
          - *delay-default
          - service: "{{ nextion.commands.text_printf }}"
            data:
              component: home.current_temp
              message: "{{ trigger.event.data.new_state.state | round(1) }}{{ weather_units.temperature }}"

      ##### INDOOR TEMP - nspanel #####
      - alias: Indoor temp - NSPanel
        conditions:
          - condition: trigger
            id: nspaneltemp_state
          - condition: template
            value_template: "{{ nextion.pages.current == nextion.pages.home and is_number(trigger.event.data.new_state.state) }}"
        sequence:
          - *variables-weather
          - if: "{{ indoortemp is not match 'sensor.' }}"
            then:
              ### LABEL Indoor Temp Font Color ###
              - *delay-default
              - service: "{{ nextion.commands.font_color }}"
                data:
                  component: home.current_temp
                  message: "{{ page_home.general.indoor_temp.label.color_rgb if is_number(page_home.general.indoor_temp.label.color_rgb) else ((page_home.general.indoor_temp.label.color_rgb[0] //(2**3)) *(2**11))+((page_home.general.indoor_temp.label.color_rgb[1] //(2**2)) *(2**5))+(page_home.general.indoor_temp.label.color_rgb[2] //(2**3)) }}"
              ### LABEL Indoor Temp Font ###
              - *delay-default
              - service: "{{ nextion.commands.text_printf }}"
                data:
                  component: home.current_temp
                  message: "{{ trigger.event.data.new_state.state | round(1) }}{{ weather_units.temperature }}"

      ##### WEATHER STATE - change update #####
      - alias: Weather - State changed
        conditions:
          - condition: trigger
            id: weather_state_change
          - condition: template
            value_template: "{{ nextion.pages.current == nextion.pages.home and trigger.event.data.new_state.state not in ['unavailable', 'unknown', None] }}"
        sequence:
          - *variables-weather
          - if: "{{ outdoortemp is not match 'sensor.' }}"
            then:
              ### LABEL Outdoor Temp Font Color ###
              - *delay-default
              - service: "{{ nextion.commands.font_color }}"
                data:
                  component: home.outdoor_temp
                  message: "{{ page_home.general.outdoor_temp.label.color_rgb if is_number(page_home.general.outdoor_temp.label.color_rgb) else ((page_home.general.outdoor_temp.label.color_rgb[0] //(2**3)) *(2**11))+((page_home.general.outdoor_temp.label.color_rgb[1] //(2**2)) *(2**5))+(page_home.general.outdoor_temp.label.color_rgb[2] //(2**3)) }}"
              ### LABEL Outdoor Temp Font ###
              - *delay-default
              - service: "{{ nextion.commands.text_printf }}"
                data:
                  component: home.outdoor_temp
                  message: "{{trigger.event.data.new_state.attributes.temperature | round(1)}}{{ weather_units.temperature }}"
              - service: "{{ nextion.commands.text_printf }}"
                data:
                  component: climate.outdoor_temp
                  message: "{{trigger.event.data.new_state.attributes.temperature | round(1)}}{{ weather_units.temperature }}"

          - service: "{{ nextion.commands.printf }}"
            data:
              cmd: home.weather.pic={{ nextion.pics.weather[trigger.event.data.new_state.state | default('unknown')] }}

      ##### Sync Climate ##### -> muss noch in page changed climate wwenn climate page fertig
      - alias: Climate - Sync
        conditions:
          - condition: trigger
            id: climate_state
          - "{{ trigger.event.data.new_state.state not in ['unavailable', 'unknown', None] }}"
          # - condition: template
          #   value_template: "{{ nextion.pages.current == nextion.pages.climate }}"
          # - condition: template
          #   value_template: "{{ climate_optimistic == false }}"
        sequence:
          - *variables-weather
          - variables:
              heating_state: "{{ mui[language].climate.states.off if trigger.event.data.new_state.state == 'off' else mui[language].climate.states.on }}"
              heating_bt_pic: >-
                {%- if trigger.event.data.new_state.state == 'off' -%} {{ nextion.pics.heating.button.off }}
                {%- else -%} {{ nextion.pics.heating.button.on }}
                {%- endif -%}

          - service: "{{ nextion.commands.text_printf }}"
            data:
              component: current_temp
              message: "{{ trigger.event.data.new_state.attributes.current_temperature | round(1)}}{{ weather_units.temperature }}"
          - service: "{{ nextion.commands.text_printf }}"
            data:
              component: heating_state
              message: "{{heating_state}}"
          - service: "{{ nextion.commands.printf }}"
            data:
              cmd: heating_bt_pic.pic={{ heating_bt_pic }}
          - if: "{{ trigger.event.data.new_state.state != 'off' }}" #### TODO AND->OR (not) not optimistic-mode
            then:
              - service: "{{ nextion.commands.thermostat_cycle }}"
                data:
                  value: "{{trigger.event.data.new_state.attributes.temperature | round(1)}}"
            else:
              - service: "{{ nextion.commands.thermostat_cycle }}"
                data:
                  value: "0"
              - service: "{{ nextion.commands.text_printf }}"
                data:
                  component: target_temp
                  message: " "

      ##### Sync Hotwater Charge button-symbol ##### -> kann wenn climate page fertig
      - alias: Hotwater - Sync
        conditions:
          - condition: trigger
            id: hotwatercharge_state
          - "{{ nextion.pages.current == nextion.pages.climate }}"
        sequence:
          - variables:
              hotw_bt_pic: "{{ nextion.pics.hvac.button[trigger.event.data.new_state.state] }}"
          - service: "{{ nextion.commands.printf }}"
            data:
              cmd: hotw_bt_pic.pic={{ hotw_bt_pic }}

      ##### Hotwater Temp ##### kann raus und wird durch neue value 01 und value 02 ersetzt wenn climate page fertig
      - alias: Hotwater - Temp
        conditions:
          - condition: trigger
            id: hotwatertemp_state
          - "{{ nextion.pages.current == nextion.pages.climate and trigger.event.data.new_state.state not in ['unavailable', 'unknown', None] }}"
        sequence:
          - *variables-weather
          - service: "{{ nextion.commands.text_printf }}"
            data:
              component: home.hotwater_temp
              message: "{{ trigger.event.data.new_state.state | round(1) }}{{ weather_units.temperature }}"
          - *delay-default
          - service: "{{ nextion.commands.text_printf }}"
            data:
              component: climate.hotwater_temp
              message: "{{ trigger.event.data.new_state.state | round(1) }}{{ weather_units.temperature }}"
          # - delay:
          #     milliseconds: "{{ delay_value }}"
          # - service: "{{ nextion.commands.printf }}"
          #   data:
          #     cmd: home.hotwater_pic.pic={{ hotwater_pic_on }}

      #### TFT Upload Automation #####
      - alias: TFT auto-upload
        conditions:
          - condition: trigger
            id: tft_upload
        sequence:
          - delay:
              seconds: 2
          - service: "{{ nextion.commands.tft_upload }}"
            data: {}


#############################################################
##### CLOSE - Action #####
#############################################################
