diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..2bb310a --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,13 @@ +# These are supported funding model platforms + +github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry +custom: https://www.paypal.com/donate/?hosted_button_id=S974SWQMB8PB2 diff --git a/README.md b/README.md index 70d8cac..53f75b8 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l 📕 Full documentation and installation is available here [NSPanel Configuration, Setup and HowTo](https://github.com/Blackymas/NSPanel_HA_Blueprint/wiki). -📌 Step by Step - [Setup Video](https://www.youtube.com/watch?v=3afPFg6kUdc) +📌 Step by Step - [Setup and Overview Video´s](https://github.com/Blackymas/NSPanel_HA_Blueprint/wiki) 🚀 How to create "Issues" when I have a problem [WIKI HowTo](https://github.com/Blackymas/NSPanel_HA_Blueprint/wiki) diff --git a/nspanel.HMI b/custom_configuration/OLD NSPanel version/nspanel_old.HMI similarity index 52% rename from nspanel.HMI rename to custom_configuration/OLD NSPanel version/nspanel_old.HMI index 2f2ae59..5557ba2 100644 Binary files a/nspanel.HMI and b/custom_configuration/OLD NSPanel version/nspanel_old.HMI differ diff --git a/nspanel.tft b/custom_configuration/OLD NSPanel version/nspanel_old.tft similarity index 84% rename from nspanel.tft rename to custom_configuration/OLD NSPanel version/nspanel_old.tft index f8155c1..0dbca55 100644 Binary files a/nspanel.tft and b/custom_configuration/OLD NSPanel version/nspanel_old.tft differ diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index 52bebcc..a59509c 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -32,7 +32,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l 🎉 Roadmap Roadmap can be found here [Roadmap](https://github.com/Blackymas/NSPanel_HA_Blueprint/labels/roadmap) -ℹ️ Version: v.3.0.0 +ℹ️ Version: v.3.1.0 ' @@ -121,7 +121,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l delay: name: Delay to avoid synchronization problem description: '* *Synchronization Problems may occur due to the **NETWORK / WLAN**. To avoid this problem enter your value for the delay (milliseconds)*' - default: '10' + default: '1' selector: number: min: 0 @@ -233,7 +233,28 @@ The goal was to create a version that allows everyone to use the NSpanel fully l description: '* *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: - + + qrcode_state: + name: Activate QR Code (Optional) + default: false + description: '* *activate the QR code page and QR Code Button on the home page* ' + selector: + boolean: + + qrcode_label: + name: Name "QR Code Page" (Optional) + description: '* *Displayed on top of **"QR Code"***' + default: [] + selector: + text: {} + + qrcode_value: + name: QR Code content (Optional) + description: '* *Value you want to display as QR code*' + default: [] + selector: + text: {} + ##### HARDWARE BUTTONS ##### left_button_entity: name: Left Button (Optional) @@ -258,6 +279,12 @@ The goal was to create a version that allows everyone to use the NSpanel fully l default: [] selector: text: {} + relay_1_local_fallback: + name: Activate Relay 1 local Fallback (Optional) + default: false + description: '* *activate this to use left button to toggle relay 1 if display is offline* ' + selector: + boolean: right_button_entity: name: Right Button (Optional) description: '* *Right Hardware Button - Select the entity that should be switched*' @@ -281,31 +308,37 @@ The goal was to create a version that allows everyone to use the NSpanel fully l default: [] selector: text: {} + relay_2_local_fallback: + name: Activate Relay 2 local Fallback (Optional) + default: false + description: '* *activate this to use right button to toggle relay 2 if display is offline* ' + selector: + boolean: ##### BUTTON Page Labels ##### button_page01_label: - name: Name **"Button Page 1"** (Optional) + name: Name "Button Page 1" (Optional) description: '* *Displayed on top of **"Button Page 1"***' default: [] selector: text: {} button_page02_label: - name: Name **"Button Page 2"** (Optional) + name: Name "Button Page 2" (Optional) description: '* *Displayed on top of **"Button Page 2"***' default: [] selector: text: {} button_page03_label: - name: Name **"Button Page 3"** (Optional) + name: Name "Button Page 3" (Optional) description: '* *Displayed on top of **"Button Page 3"***' default: [] selector: text: {} button_page04_label: - name: Name **"Button Page 4"** (Optional) + name: Name "Button Page 4" (Optional) description: '* *Displayed on top of **"Button Page 4"***' default: [] selector: @@ -1304,6 +1337,654 @@ The goal was to create a version that allows everyone to use the NSpanel fully l description: '* *Ask for confirmation to execute **"Button32"** action*' selector: boolean: + + ##### ENTITY Pages Config ##### + entitypages_enabled: + name: Activate Entity Pages (Optional) + default: false + description: '* *activate the entity pages and Entity Button on the home page* ' + selector: + boolean: + + ##### ENTITY Page Labels ##### + entity_page01_label: + name: Name "Entity Page 1" (Optional) + description: '* *Displayed on top of **"Entity Page 1"***' + default: [] + selector: + text: {} + + entity_page02_label: + name: Name "Entity Page 2" (Optional) + description: '* *Displayed on top of **"Entity Page 2"***' + default: [] + selector: + text: {} + + entity_page03_label: + name: Name "Entity Page 3" (Optional) + description: '* *Displayed on top of **"Entity Page 3"***' + default: [] + selector: + text: {} + + entity_page04_label: + name: Name "Entity Page 4" (Optional) + description: '* *Displayed on top of **"Entity Page 4"***' + default: [] + selector: + text: {} + + ##### ENTITIES ##### + entities_entity01: + name: Entity 01 (Optional) + description: '* *Displayed on **"Entity Page 1"***' + default: [] + selector: + entity: + entities_entity01_name: + name: Name "Entity 01" (Optional) + description: '* *Entity label - replaces the **"friendly_name"** of the entity*' + default: [] + selector: + text: {} + entities_entity01_icon: + name: Icon "Entity 01" (Optional) + description: '* *Entity icon - sets an icon for the entity (e.g.: ) - if not set, no icon is shown*' + default: [] + selector: + text: {} + + entities_entity02: + name: Entity 02 (Optional) + description: '* *Displayed on **"Entity Page 1"***' + default: [] + selector: + entity: + entities_entity02_name: + name: Name "Entity 02" (Optional) + description: '* *Entity label - replaces the **"friendly_name"** of the entity*' + default: [] + selector: + text: {} + entities_entity02_icon: + name: Icon "Entity 02" (Optional) + description: '* *Entity icon - sets an icon for the entity (e.g.: ) - if not set, no icon is shown*' + default: [] + selector: + text: {} + + entities_entity03: + name: Entity 03 (Optional) + description: '* *Displayed on **"Entity Page 1"***' + default: [] + selector: + entity: + entities_entity03_name: + name: Name "Entity 03" (Optional) + description: '* *Entity label - replaces the **"friendly_name"** of the entity*' + default: [] + selector: + text: {} + entities_entity03_icon: + name: Icon "Entity 03" (Optional) + description: '* *Entity icon - sets an icon for the entity (e.g.: ) - if not set, no icon is shown*' + default: [] + selector: + text: {} + + entities_entity04: + name: Entity 04 (Optional) + description: '* *Displayed on **"Entity Page 1"***' + default: [] + selector: + entity: + entities_entity04_name: + name: Name "Entity 04" (Optional) + description: '* *Entity label - replaces the **"friendly_name"** of the entity*' + default: [] + selector: + text: {} + entities_entity04_icon: + name: Icon "Entity 04" (Optional) + description: '* *Entity icon - sets an icon for the entity (e.g.: ) - if not set, no icon is shown*' + default: [] + selector: + text: {} + + entities_entity05: + name: Entity 05 (Optional) + description: '* *Displayed on **"Entity Page 1"***' + default: [] + selector: + entity: + entities_entity05_name: + name: Name "Entity 05" (Optional) + description: '* *Entity label - replaces the **"friendly_name"** of the entity*' + default: [] + selector: + text: {} + entities_entity05_icon: + name: Icon "Entity 05" (Optional) + description: '* *Entity icon - sets an icon for the entity (e.g.: ) - if not set, no icon is shown*' + default: [] + selector: + text: {} + + entities_entity06: + name: Entity 06 (Optional) + description: '* *Displayed on **"Entity Page 1"***' + default: [] + selector: + entity: + entities_entity06_name: + name: Name "Entity 06" (Optional) + description: '* *Entity label - replaces the **"friendly_name"** of the entity*' + default: [] + selector: + text: {} + entities_entity06_icon: + name: Icon "Entity 06" (Optional) + description: '* *Entity icon - sets an icon for the entity (e.g.: ) - if not set, no icon is shown*' + default: [] + selector: + text: {} + + entities_entity07: + name: Entity 07 (Optional) + description: '* *Displayed on **"Entity Page 1"***' + default: [] + selector: + entity: + entities_entity07_name: + name: Name "Entity 07" (Optional) + description: '* *Entity label - replaces the **"friendly_name"** of the entity*' + default: [] + selector: + text: {} + entities_entity07_icon: + name: Icon "Entity 07" (Optional) + description: '* *Entity icon - sets an icon for the entity (e.g.: ) - if not set, no icon is shown*' + default: [] + selector: + text: {} + + entities_entity08: + name: Entity 08 (Optional) + description: '* *Displayed on **"Entity Page 1"***' + default: [] + selector: + entity: + entities_entity08_name: + name: Name "Entity 08" (Optional) + description: '* *Entity label - replaces the **"friendly_name"** of the entity*' + default: [] + selector: + text: {} + entities_entity08_icon: + name: Icon "Entity 08" (Optional) + description: '* *Entity icon - sets an icon for the entity (e.g.: ) - if not set, no icon is shown*' + default: [] + selector: + text: {} + + entities_entity09: + name: Entity 09 (Optional) + description: '* *Displayed on **"Entity Page 2"***' + default: [] + selector: + entity: + entities_entity09_name: + name: Name "Entity 09" (Optional) + description: '* *Entity label - replaces the **"friendly_name"** of the entity*' + default: [] + selector: + text: {} + entities_entity09_icon: + name: Icon "Entity 09" (Optional) + description: '* *Entity icon - sets an icon for the entity (e.g.: ) - if not set, no icon is shown*' + default: [] + selector: + text: {} + + entities_entity10: + name: Entity 10 (Optional) + description: '* *Displayed on **"Entity Page 2"***' + default: [] + selector: + entity: + entities_entity10_name: + name: Name "Entity 10" (Optional) + description: '* *Entity label - replaces the **"friendly_name"** of the entity*' + default: [] + selector: + text: {} + entities_entity10_icon: + name: Icon "Entity 10" (Optional) + description: '* *Entity icon - sets an icon for the entity (e.g.: ) - if not set, no icon is shown*' + default: [] + selector: + text: {} + + entities_entity11: + name: Entity 11 (Optional) + description: '* *Displayed on **"Entity Page 2"***' + default: [] + selector: + entity: + entities_entity11_name: + name: Name "Entity 11" (Optional) + description: '* *Entity label - replaces the **"friendly_name"** of the entity*' + default: [] + selector: + text: {} + entities_entity11_icon: + name: Icon "Entity 11" (Optional) + description: '* *Entity icon - sets an icon for the entity (e.g.: ) - if not set, no icon is shown*' + default: [] + selector: + text: {} + + entities_entity12: + name: Entity 12 (Optional) + description: '* *Displayed on **"Entity Page 2"***' + default: [] + selector: + entity: + entities_entity12_name: + name: Name "Entity 12" (Optional) + description: '* *Entity label - replaces the **"friendly_name"** of the entity*' + default: [] + selector: + text: {} + entities_entity12_icon: + name: Icon "Entity 12" (Optional) + description: '* *Entity icon - sets an icon for the entity (e.g.: ) - if not set, no icon is shown*' + default: [] + selector: + text: {} + + entities_entity13: + name: Entity 13 (Optional) + description: '* *Displayed on **"Entity Page 2"***' + default: [] + selector: + entity: + entities_entity13_name: + name: Name "Entity 13" (Optional) + description: '* *Entity label - replaces the **"friendly_name"** of the entity*' + default: [] + selector: + text: {} + entities_entity13_icon: + name: Icon "Entity 13" (Optional) + description: '* *Entity icon - sets an icon for the entity (e.g.: ) - if not set, no icon is shown*' + default: [] + selector: + text: {} + + entities_entity14: + name: Entity 14 (Optional) + description: '* *Displayed on **"Entity Page 2"***' + default: [] + selector: + entity: + entities_entity14_name: + name: Name "Entity 14" (Optional) + description: '* *Entity label - replaces the **"friendly_name"** of the entity*' + default: [] + selector: + text: {} + entities_entity14_icon: + name: Icon "Entity 14" (Optional) + description: '* *Entity icon - sets an icon for the entity (e.g.: ) - if not set, no icon is shown*' + default: [] + selector: + text: {} + + entities_entity15: + name: Entity 15 (Optional) + description: '* *Displayed on **"Entity Page 2"***' + default: [] + selector: + entity: + entities_entity15_name: + name: Name "Entity 15" (Optional) + description: '* *Entity label - replaces the **"friendly_name"** of the entity*' + default: [] + selector: + text: {} + entities_entity15_icon: + name: Icon "Entity 15" (Optional) + description: '* *Entity icon - sets an icon for the entity (e.g.: ) - if not set, no icon is shown*' + default: [] + selector: + text: {} + + entities_entity16: + name: Entity 16 (Optional) + description: '* *Displayed on **"Entity Page 2"***' + default: [] + selector: + entity: + entities_entity16_name: + name: Name "Entity 16" (Optional) + description: '* *Entity label - replaces the **"friendly_name"** of the entity*' + default: [] + selector: + text: {} + entities_entity16_icon: + name: Icon "Entity 16" (Optional) + description: '* *Entity icon - sets an icon for the entity (e.g.: ) - if not set, no icon is shown*' + default: [] + selector: + text: {} + + entities_entity17: + name: Entity 17 (Optional) + description: '* *Displayed on **"Entity Page 3"***' + default: [] + selector: + entity: + entities_entity17_name: + name: Name "Entity 17" (Optional) + description: '* *Entity label - replaces the **"friendly_name"** of the entity*' + default: [] + selector: + text: {} + entities_entity17_icon: + name: Icon "Entity 17" (Optional) + description: '* *Entity icon - sets an icon for the entity (e.g.: ) - if not set, no icon is shown*' + default: [] + selector: + text: {} + + entities_entity18: + name: Entity 18 (Optional) + description: '* *Displayed on **"Entity Page 3"***' + default: [] + selector: + entity: + entities_entity18_name: + name: Name "Entity 18" (Optional) + description: '* *Entity label - replaces the **"friendly_name"** of the entity*' + default: [] + selector: + text: {} + entities_entity18_icon: + name: Icon "Entity 18" (Optional) + description: '* *Entity icon - sets an icon for the entity (e.g.: ) - if not set, no icon is shown*' + default: [] + selector: + text: {} + + entities_entity19: + name: Entity 19 (Optional) + description: '* *Displayed on **"Entity Page 3"***' + default: [] + selector: + entity: + entities_entity19_name: + name: Name "Entity 19" (Optional) + description: '* *Entity label - replaces the **"friendly_name"** of the entity*' + default: [] + selector: + text: {} + entities_entity19_icon: + name: Icon "Entity 19" (Optional) + description: '* *Entity icon - sets an icon for the entity (e.g.: ) - if not set, no icon is shown*' + default: [] + selector: + text: {} + + entities_entity20: + name: Entity 20 (Optional) + description: '* *Displayed on **"Entity Page 3"***' + default: [] + selector: + entity: + entities_entity20_name: + name: Name "Entity 20" (Optional) + description: '* *Entity label - replaces the **"friendly_name"** of the entity*' + default: [] + selector: + text: {} + entities_entity20_icon: + name: Icon "Entity 20" (Optional) + description: '* *Entity icon - sets an icon for the entity (e.g.: ) - if not set, no icon is shown*' + default: [] + selector: + text: {} + + entities_entity21: + name: Entity 21 (Optional) + description: '* *Displayed on **"Entity Page 3"***' + default: [] + selector: + entity: + entities_entity21_name: + name: Name "Entity 21" (Optional) + description: '* *Entity label - replaces the **"friendly_name"** of the entity*' + default: [] + selector: + text: {} + entities_entity21_icon: + name: Icon "Entity 21" (Optional) + description: '* *Entity icon - sets an icon for the entity (e.g.: ) - if not set, no icon is shown*' + default: [] + selector: + text: {} + + entities_entity22: + name: Entity 22 (Optional) + description: '* *Displayed on **"Entity Page 3"***' + default: [] + selector: + entity: + entities_entity22_name: + name: Name "Entity 22" (Optional) + description: '* *Entity label - replaces the **"friendly_name"** of the entity*' + default: [] + selector: + text: {} + entities_entity22_icon: + name: Icon "Entity 22" (Optional) + description: '* *Entity icon - sets an icon for the entity (e.g.: ) - if not set, no icon is shown*' + default: [] + selector: + text: {} + + entities_entity23: + name: Entity 23 (Optional) + description: '* *Displayed on **"Entity Page 3"***' + default: [] + selector: + entity: + entities_entity23_name: + name: Name "Entity 23" (Optional) + description: '* *Entity label - replaces the **"friendly_name"** of the entity*' + default: [] + selector: + text: {} + entities_entity23_icon: + name: Icon "Entity 23" (Optional) + description: '* *Entity icon - sets an icon for the entity (e.g.: ) - if not set, no icon is shown*' + default: [] + selector: + text: {} + + entities_entity24: + name: Entity 24 (Optional) + description: '* *Displayed on **"Entity Page 3"***' + default: [] + selector: + entity: + entities_entity24_name: + name: Name "Entity 24" (Optional) + description: '* *Entity label - replaces the **"friendly_name"** of the entity*' + default: [] + selector: + text: {} + entities_entity24_icon: + name: Icon "Entity 24" (Optional) + description: '* *Entity icon - sets an icon for the entity (e.g.: ) - if not set, no icon is shown*' + default: [] + selector: + text: {} + + entities_entity25: + name: Entity 25 (Optional) + description: '* *Displayed on **"Entity Page 4"***' + default: [] + selector: + entity: + entities_entity25_name: + name: Name "Entity 25" (Optional) + description: '* *Entity label - replaces the **"friendly_name"** of the entity*' + default: [] + selector: + text: {} + entities_entity25_icon: + name: Icon "Entity 25" (Optional) + description: '* *Entity icon - sets an icon for the entity (e.g.: ) - if not set, no icon is shown*' + default: [] + selector: + text: {} + + entities_entity26: + name: Entity 26 (Optional) + description: '* *Displayed on **"Entity Page 4"***' + default: [] + selector: + entity: + entities_entity26_name: + name: Name "Entity 26" (Optional) + description: '* *Entity label - replaces the **"friendly_name"** of the entity*' + default: [] + selector: + text: {} + entities_entity26_icon: + name: Icon "Entity 26" (Optional) + description: '* *Entity icon - sets an icon for the entity (e.g.: ) - if not set, no icon is shown*' + default: [] + selector: + text: {} + + entities_entity27: + name: Entity 27 (Optional) + description: '* *Displayed on **"Entity Page 4"***' + default: [] + selector: + entity: + entities_entity27_name: + name: Name "Entity 27" (Optional) + description: '* *Entity label - replaces the **"friendly_name"** of the entity*' + default: [] + selector: + text: {} + entities_entity27_icon: + name: Icon "Entity 27" (Optional) + description: '* *Entity icon - sets an icon for the entity (e.g.: ) - if not set, no icon is shown*' + default: [] + selector: + text: {} + + entities_entity28: + name: Entity 28 (Optional) + description: '* *Displayed on **"Entity Page 4"***' + default: [] + selector: + entity: + entities_entity28_name: + name: Name "Entity 28" (Optional) + description: '* *Entity label - replaces the **"friendly_name"** of the entity*' + default: [] + selector: + text: {} + entities_entity28_icon: + name: Icon "Entity 28" (Optional) + description: '* *Entity icon - sets an icon for the entity (e.g.: ) - if not set, no icon is shown*' + default: [] + selector: + text: {} + + entities_entity29: + name: Entity 29 (Optional) + description: '* *Displayed on **"Entity Page 4"***' + default: [] + selector: + entity: + entities_entity29_name: + name: Name "Entity 29" (Optional) + description: '* *Entity label - replaces the **"friendly_name"** of the entity*' + default: [] + selector: + text: {} + entities_entity29_icon: + name: Icon "Entity 29" (Optional) + description: '* *Entity icon - sets an icon for the entity (e.g.: ) - if not set, no icon is shown*' + default: [] + selector: + text: {} + + entities_entity30: + name: Entity 30 (Optional) + description: '* *Displayed on **"Entity Page 4"***' + default: [] + selector: + entity: + entities_entity30_name: + name: Name "Entity 30" (Optional) + description: '* *Entity label - replaces the **"friendly_name"** of the entity*' + default: [] + selector: + text: {} + entities_entity30_icon: + name: Icon "Entity 30" (Optional) + description: '* *Entity icon - sets an icon for the entity (e.g.: ) - if not set, no icon is shown*' + default: [] + selector: + text: {} + + entities_entity31: + name: Entity 31 (Optional) + description: '* *Displayed on **"Entity Page 4"***' + default: [] + selector: + entity: + entities_entity31_name: + name: Name "Entity 31" (Optional) + description: '* *Entity label - replaces the **"friendly_name"** of the entity*' + default: [] + selector: + text: {} + entities_entity31_icon: + name: Icon "Entity 31" (Optional) + description: '* *Entity icon - sets an icon for the entity (e.g.: ) - if not set, no icon is shown*' + default: [] + selector: + text: {} + + entities_entity32: + name: Entity 32 (Optional) + description: '* *Displayed on **"Entity Page 4"***' + default: [] + selector: + entity: + entities_entity32_name: + name: Name "Entity 32" (Optional) + description: '* *Entity label - replaces the **"friendly_name"** of the entity*' + default: [] + selector: + text: {} + entities_entity32_icon: + name: Icon "Entity 32" (Optional) + description: '* *Entity icon - sets an icon for the entity (e.g.: ) - if not set, no icon is shown*' + default: [] + selector: + text: {} + + mode: parallel max: 5000 @@ -1350,6 +2031,7 @@ trigger_variables: variables: ##### GENERAL ##### + blueprint_version: "3.1.0" nspanel_name: !input "nspanel_name" time: "{{ (as_timestamp(now()) | timestamp_custom('%H:%M')) }}" language: !input "language" @@ -1386,6 +2068,11 @@ variables: outdoortemp: !input "outdoortemp" indoortemp: !input "indoortemp" climate: !input "climate" + qrcode_label: !input "qrcode_label" + qrcode_value: !input "qrcode_value" + qrcode_state: !input "qrcode_state" + relay_1_local_fallback: !input "relay_1_local_fallback" + relay_2_local_fallback: !input "relay_2_local_fallback" #### HARDWARE BUTTONS ##### left_button_entity: !input "left_button_entity" @@ -1476,6 +2163,8 @@ variables: home_button_blank: "116" home_button_notify_white: "117" home_button_notify_red: "118" + home_button_qrcode: "123" + home_button_entities: "124" ###### NEXTION COLOR MAPPING ##### button_color_1: "65535" @@ -1499,6 +2188,11 @@ variables: page_buttonpage03: "buttonpage03" page_buttonpage04: "buttonpage04" page_notification: "notification" + page_qrcode: "qrcode" + page_entitypage01: "entitypage01" + page_entitypage02: "entitypage02" + page_entitypage03: "entitypage03" + page_entitypage04: "entitypage04" ##### MUI Multilingual User Interface (DE/EN) ##### @@ -1721,7 +2415,7 @@ variables: {%- elif language == "ESP" -%} en 2 días {%- elif language == "CZE" -%} za 2 dny {%- elif language == "TUR" -%} 2 Gün İçinde - {%- elif language == "UKR" -%} наступні 2 дні + {%- elif language == "UKR" -%} через 2 дні {%- elif language == "HUN" -%} 2 nap múlva {%- elif language == "NOR" -%} om 2 dager {%- elif language == "RUS" -%} на 2 дня @@ -1749,7 +2443,7 @@ variables: {%- elif language == "ESP" -%} en 3 Días {%- elif language == "CZE" -%} za 3 dny {%- elif language == "TUR" -%} 3 Gün İçinde - {%- elif language == "UKR" -%} наступні 3 дні + {%- elif language == "UKR" -%} через 3 дні {%- elif language == "HUN" -%} 3 nap múlva {%- elif language == "NOR" -%} om 3 dager {%- elif language == "RUS" -%} на 3 дня @@ -1777,7 +2471,7 @@ variables: {%- elif language == "ESP" -%} en 4 Días {%- elif language == "CZE" -%} za 4 dny {%- elif language == "TUR" -%} 4 Gün İçinde - {%- elif language == "UKR" -%} наступні 4 дні + {%- elif language == "UKR" -%} через 2 дні {%- elif language == "HUN" -%} 4 nap múlva {%- elif language == "NOR" -%} om 4 dager {%- elif language == "RUS" -%} на 4 дня @@ -1805,7 +2499,7 @@ variables: {%- elif language == "ESP" -%} on {%- elif language == "CZE" -%} zapnuto {%- elif language == "TUR" -%} üzerinde - {%- elif language == "UKR" -%} увімкнено + {%- elif language == "UKR" -%} увімк {%- elif language == "HUN" -%} a oldalon {%- elif language == "NOR" -%} på {%- elif language == "RUS" -%} включено @@ -1833,7 +2527,7 @@ variables: {%- elif language == "ESP" -%} off {%- elif language == "CZE" -%} vypnuto {%- elif language == "TUR" -%} kapalı - {%- elif language == "UKR" -%} вимкнено + {%- elif language == "UKR" -%} вимк {%- elif language == "HUN" -%} off {%- elif language == "NOR" -%} av {%- elif language == "RUS" -%} выключено @@ -1861,7 +2555,7 @@ variables: {%- elif language == "ESP" -%} calor {%- elif language == "CZE" -%} topení {%- elif language == "TUR" -%} ısı - {%- elif language == "UKR" -%} нагрівання + {%- elif language == "UKR" -%} нагрів {%- elif language == "HUN" -%} hő {%- elif language == "NOR" -%} varme {%- elif language == "RUS" -%} нагрев @@ -2047,6 +2741,126 @@ variables: entity31_confirm: !input "entity31_confirm" entity32_confirm: !input "entity32_confirm" + + ##### ENTITIES ##### + entitypages_enabled: !input "entitypages_enabled" + + ##### ENTITY Page Labels ##### + entity_page01_label: !input "entity_page01_label" + entity_page02_label: !input "entity_page02_label" + entity_page03_label: !input "entity_page03_label" + entity_page04_label: !input "entity_page04_label" + + ##### ENTITIES 1- 32 ##### + ## page 01 + entities_entity01: !input "entities_entity01" + entities_entity02: !input "entities_entity02" + entities_entity03: !input "entities_entity03" + entities_entity04: !input "entities_entity04" + entities_entity05: !input "entities_entity05" + entities_entity06: !input "entities_entity06" + entities_entity07: !input "entities_entity07" + entities_entity08: !input "entities_entity08" + ## page 02 + entities_entity09: !input "entities_entity09" + entities_entity10: !input "entities_entity10" + entities_entity11: !input "entities_entity11" + entities_entity12: !input "entities_entity12" + entities_entity13: !input "entities_entity13" + entities_entity14: !input "entities_entity14" + entities_entity15: !input "entities_entity15" + entities_entity16: !input "entities_entity16" + ## page 03 + entities_entity17: !input "entities_entity17" + entities_entity18: !input "entities_entity18" + entities_entity19: !input "entities_entity19" + entities_entity20: !input "entities_entity20" + entities_entity21: !input "entities_entity21" + entities_entity22: !input "entities_entity22" + entities_entity23: !input "entities_entity23" + entities_entity24: !input "entities_entity24" + ## page 04 + entities_entity25: !input "entities_entity25" + entities_entity26: !input "entities_entity26" + entities_entity27: !input "entities_entity27" + entities_entity28: !input "entities_entity28" + entities_entity29: !input "entities_entity29" + entities_entity30: !input "entities_entity30" + entities_entity31: !input "entities_entity31" + entities_entity32: !input "entities_entity32" + ## page 01 - name + entities_entity01_name: !input "entities_entity01_name" + entities_entity02_name: !input "entities_entity02_name" + entities_entity03_name: !input "entities_entity03_name" + entities_entity04_name: !input "entities_entity04_name" + entities_entity05_name: !input "entities_entity05_name" + entities_entity06_name: !input "entities_entity06_name" + entities_entity07_name: !input "entities_entity07_name" + entities_entity08_name: !input "entities_entity08_name" + ## page 02 - name + entities_entity09_name: !input "entities_entity09_name" + entities_entity10_name: !input "entities_entity10_name" + entities_entity11_name: !input "entities_entity11_name" + entities_entity12_name: !input "entities_entity12_name" + entities_entity13_name: !input "entities_entity13_name" + entities_entity14_name: !input "entities_entity14_name" + entities_entity15_name: !input "entities_entity15_name" + entities_entity16_name: !input "entities_entity16_name" + ## page 03 - name + entities_entity17_name: !input "entities_entity17_name" + entities_entity18_name: !input "entities_entity18_name" + entities_entity19_name: !input "entities_entity19_name" + entities_entity20_name: !input "entities_entity20_name" + entities_entity21_name: !input "entities_entity21_name" + entities_entity22_name: !input "entities_entity22_name" + entities_entity23_name: !input "entities_entity23_name" + entities_entity24_name: !input "entities_entity24_name" + ## page 04 - name + entities_entity25_name: !input "entities_entity25_name" + entities_entity26_name: !input "entities_entity26_name" + entities_entity27_name: !input "entities_entity27_name" + entities_entity28_name: !input "entities_entity28_name" + entities_entity29_name: !input "entities_entity29_name" + entities_entity30_name: !input "entities_entity30_name" + entities_entity31_name: !input "entities_entity31_name" + entities_entity32_name: !input "entities_entity32_name" + ## page 01 - icon + entities_entity01_icon: !input "entities_entity01_icon" + entities_entity02_icon: !input "entities_entity02_icon" + entities_entity03_icon: !input "entities_entity03_icon" + entities_entity04_icon: !input "entities_entity04_icon" + entities_entity05_icon: !input "entities_entity05_icon" + entities_entity06_icon: !input "entities_entity06_icon" + entities_entity07_icon: !input "entities_entity07_icon" + entities_entity08_icon: !input "entities_entity08_icon" + ## page 02 - icon + entities_entity09_icon: !input "entities_entity09_icon" + entities_entity10_icon: !input "entities_entity10_icon" + entities_entity11_icon: !input "entities_entity11_icon" + entities_entity12_icon: !input "entities_entity12_icon" + entities_entity13_icon: !input "entities_entity13_icon" + entities_entity14_icon: !input "entities_entity14_icon" + entities_entity15_icon: !input "entities_entity15_icon" + entities_entity16_icon: !input "entities_entity16_icon" + ## page 03 - icon + entities_entity17_icon: !input "entities_entity17_icon" + entities_entity18_icon: !input "entities_entity18_icon" + entities_entity19_icon: !input "entities_entity19_icon" + entities_entity20_icon: !input "entities_entity20_icon" + entities_entity21_icon: !input "entities_entity21_icon" + entities_entity22_icon: !input "entities_entity22_icon" + entities_entity23_icon: !input "entities_entity23_icon" + entities_entity24_icon: !input "entities_entity24_icon" + ## page 04 - icon + entities_entity25_icon: !input "entities_entity25_icon" + entities_entity26_icon: !input "entities_entity26_icon" + entities_entity27_icon: !input "entities_entity27_icon" + entities_entity28_icon: !input "entities_entity28_icon" + entities_entity29_icon: !input "entities_entity29_icon" + entities_entity30_icon: !input "entities_entity30_icon" + entities_entity31_icon: !input "entities_entity31_icon" + entities_entity32_icon: !input "entities_entity32_icon" + ############################################################# ##### CLOSE - Variables ##### ############################################################# @@ -2071,6 +2885,11 @@ trigger: value_template: '{{ states(nextion_inited_trigger) is match "on" }}' id: nspanel_boot_init + ##### Automation reload + - platform: event + event_type: automation_reloaded + id: automation_reloaded + ##### TFT Upload - Trigger "tft_upload" ##### - platform: event event_type: folder_watcher @@ -2221,6 +3040,17 @@ trigger: value_template: '{{ states(last_click) is match "notificationacceptrelease" }}' id: btn_notificationacceptrelease + #### Show QR code - Trigger #### + - platform: template + value_template: '{{ states(last_click) is match "homebutton05release" }}' + id: open_qrcode_page + + #### Show ENTITIES - Trigger #### + - platform: template + value_template: '{{ states(last_click) is match "homebutton06release" }}' + id: open_entity_page + + ##### Trigger - Button General ################################################################################################################# ##### Page Button - Trigger "short_press" - SHORT Press via "last_click" ##### @@ -2478,6 +3308,8 @@ action: {%- elif states(last_click) == "pressbuttonpage04button06" -%} {{ entity30 }} {%- elif states(last_click) == "pressbuttonpage04button07" -%} {{ entity31 }} {%- elif states(last_click) == "pressbuttonpage04button08" -%} {{ entity32 }} + {%- elif states(last_click) == "pressbuttonleft" -%} {{ left_button_entity }} + {%- elif states(last_click) == "pressbuttonright" -%} {{ right_button_entity }} {%- endif -%} ##### Entity Name - Page Lightsettings ##### @@ -2510,10 +3342,12 @@ action: {%- elif states(last_click) == "pressbuttonpage04button02" -%} {{ entity26_name }} {%- elif states(last_click) == "pressbuttonpage04button03" -%} {{ entity27_name }} {%- elif states(last_click) == "pressbuttonpage04button04" -%} {{ entity28_name }} - {%- elif states(last_click) == "pressbuttonpage04button05" -%} {{ entity29_name}} + {%- elif states(last_click) == "pressbuttonpage04button05" -%} {{ entity29_name }} {%- elif states(last_click) == "pressbuttonpage04button06" -%} {{ entity30_name }} {%- elif states(last_click) == "pressbuttonpage04button07" -%} {{ entity31_name }} {%- elif states(last_click) == "pressbuttonpage04button08" -%} {{ entity32_name }} + {%- elif states(last_click) == "pressbuttonleft" -%} {{ left_button_name }} + {%- elif states(last_click) == "pressbuttonright" -%} {{ right_button_name }} {%- endif -%} ##### Entity - Page Lightsettings - Skip Back ##### @@ -2550,6 +3384,8 @@ action: {%- elif states(last_click) == "pressbuttonpage04button06" -%} {{ "page buttonpage04" }} {%- elif states(last_click) == "pressbuttonpage04button07" -%} {{ "page buttonpage04" }} {%- elif states(last_click) == "pressbuttonpage04button08" -%} {{ "page buttonpage04" }} + {%- elif states(last_click) == "pressbuttonleft" -%} {{ "page home" }} + {%- elif states(last_click) == "pressbuttonright" -%} {{ "page home" }} {%- endif -%} ######################################################################################################################## @@ -2560,13 +3396,25 @@ action: ##### NSPanel boot init ##### - conditions: - condition: trigger - id: nspanel_boot_init + id: + - nspanel_boot_init + - automation_reloaded sequence: - - ##### NSPanel boot init start ##### - delay: milliseconds: 100 + ##### NSPanel boot init only ##### + - if: + - condition: template + value_template: '{{ trigger.id == "nspanel_boot_init" }}' + then: + ##### NSPanel boot init start ##### + + - service: "{{ command_text_printf }}" + data: + component: boot.bluep_version + message: "{{ blueprint_version }}" + ##### NSPanel boot init buttons ##### - delay: milliseconds: "{{ delay_value }}" @@ -2783,28 +3631,95 @@ action: component: "{{ component_to_update }}bri" message: "{{ btn_bri_txt }}" - ###### INIT Notify ###### - - service: "{{ command_notification_clear }}" - data: {} - - ###### NSPanel beep ###### - - delay: - milliseconds: 100 + ###### Set local fallback ###### - if: - condition: template - value_template: '{{ is_state(notification_sound, "on") }}' + value_template: '{{ relay_1_local_fallback }}' then: - - service: "{{ command_play_rtttl }}" + - service: switch.turn_on data: - song_str: "two short:d=4,o=5,b=100:16e6,16e6" - - ##### NSPanel boot init finished and jump to Home Page##### - - delay: - milliseconds: "{{ delay_value }}" - - service: "{{ command_printf }}" - data: - cmd: page home + entity_id: 'switch.{{ nspanel_name }}_relay_1_local_fallback' + else: + - service: switch.turn_off + data: + entity_id: 'switch.{{ nspanel_name }}_relay_1_local_fallback' + - if: + - condition: template + value_template: '{{ relay_2_local_fallback }}' + then: + - service: switch.turn_on + data: + entity_id: 'switch.{{ nspanel_name }}_relay_2_local_fallback' + else: + - service: switch.turn_off + data: + entity_id: 'switch.{{ nspanel_name }}_relay_2_local_fallback' + ##### Update home-buttons on automation-reload only ##### + - if: + - condition: template + value_template: '{{ states(current_page) == page_home }}' + then: + ###### QR Code - Icon ###### + - if: + - condition: template + value_template: '{{ qrcode_state == true }}' + then: + - delay: + milliseconds: "{{ delay_value }}" + - service: "{{ command_printf }}" + data: + cmd: "homebt05_pic.pic={{ home_button_qrcode }}" + else: + - delay: + milliseconds: "{{ delay_value }}" + - service: "{{ command_printf }}" + data: + cmd: "homebt05_pic.pic={{ home_button_blank }}" + + ###### ENTITIES - Icon ###### + - if: + - condition: template + value_template: '{{ entitypages_enabled }}' + then: + - delay: + milliseconds: "{{ delay_value }}" + - service: "{{ command_printf }}" + data: + cmd: "homebt06_pic.pic={{ home_button_entities }}" + else: + - delay: + milliseconds: "{{ delay_value }}" + - service: "{{ command_printf }}" + data: + cmd: "homebt06_pic.pic={{ home_button_blank }}" + + ##### NSPanel boot init only ##### + - if: + - condition: template + value_template: '{{ trigger.id == "nspanel_boot_init" }}' + then: + ###### INIT Notify ###### + - service: "{{ command_notification_clear }}" + data: {} + + ###### NSPanel beep ###### + - delay: + milliseconds: 2000 + - if: + - condition: template + value_template: '{{ is_state(notification_sound, "on") }}' + then: + - service: "{{ command_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: + milliseconds: "{{ delay_value }}" + - service: "{{ command_printf }}" + data: + cmd: page home #### Notification Symbol #### - conditions: @@ -2847,6 +3762,44 @@ action: component: notification.notifi_label message: "{{ states(notification_label) }}" + ##### Show QR Code Page ##### + - conditions: + - condition: trigger + id: open_qrcode_page + - condition: template + value_template: '{{ qrcode_state == true }}' + - condition: template + value_template: '{{ qrcode_value |length > 0 }}' + sequence: + - service: "{{ command_printf }}" + data: + cmd: "page {{ page_qrcode }}" + - if: + - condition: template + value_template: '{{ qrcode_label |length > 0 }}' + then: + - service: "{{ command_text_printf }}" + data: + component: "qrcode_label" + message: "{{ qrcode_label }}" + - delay: + milliseconds: "{{ delay_value }}" + - service: "{{ command_text_printf }}" + data: + component: "qrcode_value" + message: "{{ qrcode_value }}" + + ##### Show ENTITY Page ##### + - conditions: + - condition: trigger + id: open_entity_page + - condition: template + value_template: '{{ entitypages_enabled }}' + sequence: + - service: "{{ command_printf }}" + data: + cmd: "page {{ page_entitypage01 }}" + ##### Button Notification clear ##### - conditions: - condition: trigger @@ -3464,7 +4417,7 @@ action: {%- elif states(last_click) == "releasebuttonpage04button08" -%} {{ entity32_confirm }} {%- endif -%} - condition: template - value_template: '{{ entity_short is not match "person." and entity_short is not match "binary_sensor." }}' + value_template: '{{ entity_short |length > 0 and entity_short is not match "person." and entity_short is not match "binary_sensor." }}' - if: - condition: template value_template: "{{ entity_confirm }}" @@ -4529,6 +5482,28 @@ action: data: cmd: "homebt04_pic.pic={{ notify_pic }}" + ###### QR Code - Icon ###### + - if: + - condition: template + value_template: '{{ qrcode_state == true }}' + then: + - delay: + milliseconds: "{{ delay_value }}" + - service: "{{ command_printf }}" + data: + cmd: "homebt05_pic.pic={{ home_button_qrcode }}" + + ###### ENTITIES - Icon ###### + - if: + - condition: template + value_template: '{{ entitypages_enabled }}' + then: + - delay: + milliseconds: "{{ delay_value }}" + - service: "{{ command_printf }}" + data: + cmd: "homebt06_pic.pic={{ home_button_entities }}" + ###### StatusBar - Icon 04 ###### - if: - condition: template @@ -5883,7 +6858,332 @@ action: ## PAGE NOTIFICATION ## - conditions: '{{ trigger.event.data.new_state.state == page_notification }}' sequence: + + ## PAGE QR Code ## + - conditions: '{{ trigger.event.data.new_state.state == page_qrcode }}' + sequence: + ## ENTITY PAGE 01 ## + - conditions: '{{ trigger.event.data.new_state.state == page_entitypage01 }}' + sequence: + ##### ENTITY Page Label ##### + - if: + - condition: template + value_template: '{{ entity_page01_label |length > 0 }}' + then: + - service: "{{ command_text_printf }}" + data: + component: "entity01_label" + message: "{{ entity_page01_label }}" + ##### Entities ##### + - repeat: + for_each: + - row: entitypage01.value01 + entity: "{{ entities_entity01 }}" + entity_name: "{{ entities_entity01_name }}" + entity_icon: "{{ entities_entity01_icon }}" + - row: entitypage01.value02 + entity: "{{ entities_entity02 }}" + entity_name: "{{ entities_entity02_name }}" + entity_icon: "{{ entities_entity02_icon }}" + - row: entitypage01.value03 + entity: "{{ entities_entity03 }}" + entity_name: "{{ entities_entity03_name }}" + entity_icon: "{{ entities_entity03_icon }}" + - row: entitypage01.value04 + entity: "{{ entities_entity04 }}" + entity_name: "{{ entities_entity04_name }}" + entity_icon: "{{ entities_entity04_icon }}" + - row: entitypage01.value05 + entity: "{{ entities_entity05 }}" + entity_name: "{{ entities_entity05_name }}" + entity_icon: "{{ entities_entity05_icon }}" + - row: entitypage01.value06 + entity: "{{ entities_entity06 }}" + entity_name: "{{ entities_entity06_name }}" + entity_icon: "{{ entities_entity06_icon }}" + - row: entitypage01.value07 + entity: "{{ entities_entity07 }}" + entity_name: "{{ entities_entity07_name }}" + entity_icon: "{{ entities_entity07_icon }}" + - row: entitypage01.value08 + entity: "{{ entities_entity08 }}" + entity_name: "{{ entities_entity08_name }}" + entity_icon: "{{ entities_entity08_icon }}" + + sequence: + - if: + - condition: template + value_template: '{{ repeat.item.entity|length > 0 }}' + then: + - if: + - condition: template + value_template: '{{ repeat.item.entity_icon |length > 0 }}' + then: + - service: "{{ command_text_printf }}" + data: + component: "{{ repeat.item.row }}_pic" + message: "{{ repeat.item.entity_icon }}" + - service: "{{ command_text_printf }}" + data: + component: "{{ repeat.item.row }}_label" + message: >- + {%- if repeat.item.entity_name |length > 0 -%} {{ repeat.item.entity_name }} + {%- elif states(repeat.item.entity) == 'unavailable' -%} {{ repeat.item.entity }} + {%- else -%} {{ state_attr(repeat.item.entity, "friendly_name")| default('no name') }} + {%- endif -%} + - service: "{{ command_text_printf }}" + data: + component: "{{ repeat.item.row }}" + #message: '{{ states(repeat.item.entity) }} {{ state_attr(repeat.item.entity, "unit_of_measurement")| default("") }}' + message: >- + {%- if state_attr(repeat.item.entity, "unit_of_measurement") == None -%} + {{ states(repeat.item.entity) }} + {%- else -%} + {{ states(repeat.item.entity) }} {{ state_attr(repeat.item.entity, "unit_of_measurement") }} + {%- endif -%} + + ## ENTITY PAGE 02 ## + - conditions: '{{ trigger.event.data.new_state.state == page_entitypage02 }}' + sequence: + ##### ENTITY Page Label ##### + - if: + - condition: template + value_template: '{{ entity_page02_label |length > 0 }}' + then: + - service: "{{ command_text_printf }}" + data: + component: "entity02_label" + message: "{{ entity_page02_label }}" + ##### Entities ##### + - repeat: + for_each: + - row: entitypage02.value01 + entity: "{{ entities_entity09 }}" + entity_name: "{{ entities_entity09_name }}" + entity_icon: "{{ entities_entity09_icon }}" + - row: entitypage02.value02 + entity: "{{ entities_entity10 }}" + entity_name: "{{ entities_entity10_name }}" + entity_icon: "{{ entities_entity10_icon }}" + - row: entitypage02.value03 + entity: "{{ entities_entity11 }}" + entity_name: "{{ entities_entity11_name }}" + entity_icon: "{{ entities_entity11_icon }}" + - row: entitypage02.value04 + entity: "{{ entities_entity12 }}" + entity_name: "{{ entities_entity12_name }}" + entity_icon: "{{ entities_entity12_icon }}" + - row: entitypage02.value05 + entity: "{{ entities_entity13 }}" + entity_name: "{{ entities_entity13_name }}" + entity_icon: "{{ entities_entity13_icon }}" + - row: entitypage02.value06 + entity: "{{ entities_entity14 }}" + entity_name: "{{ entities_entity14_name }}" + entity_icon: "{{ entities_entity14_icon }}" + - row: entitypage02.value07 + entity: "{{ entities_entity15 }}" + entity_name: "{{ entities_entity15_name }}" + entity_icon: "{{ entities_entity15_icon }}" + - row: entitypage02.value08 + entity: "{{ entities_entity16 }}" + entity_name: "{{ entities_entity16_name }}" + entity_icon: "{{ entities_entity16_icon }}" + + sequence: + - if: + - condition: template + value_template: '{{ repeat.item.entity|length > 0 }}' + then: + - if: + - condition: template + value_template: '{{ repeat.item.entity_icon |length > 0 }}' + then: + - service: "{{ command_text_printf }}" + data: + component: "{{ repeat.item.row }}_pic" + message: "{{ repeat.item.entity_icon }}" + - service: "{{ command_text_printf }}" + data: + component: "{{ repeat.item.row }}_label" + message: >- + {%- if repeat.item.entity_name |length > 0 -%} {{ repeat.item.entity_name }} + {%- elif states(repeat.item.entity) == 'unavailable' -%} {{ repeat.item.entity }} + {%- else -%} {{ state_attr(repeat.item.entity, "friendly_name")| default('no name') }} + {%- endif -%} + - service: "{{ command_text_printf }}" + data: + component: "{{ repeat.item.row }}" + #message: '{{ states(repeat.item.entity) }} {{ state_attr(repeat.item.entity, "unit_of_measurement")| default("") }}' + message: >- + {%- if state_attr(repeat.item.entity, "unit_of_measurement") == None -%} + {{ states(repeat.item.entity) }} + {%- else -%} + {{ states(repeat.item.entity) }} {{ state_attr(repeat.item.entity, "unit_of_measurement") }} + {%- endif -%} + + ## ENTITY PAGE 03 ## + - conditions: '{{ trigger.event.data.new_state.state == page_entitypage03 }}' + sequence: + ##### ENTITY Page Label ##### + - if: + - condition: template + value_template: '{{ entity_page03_label |length > 0 }}' + then: + - service: "{{ command_text_printf }}" + data: + component: "entity03_label" + message: "{{ entity_page03_label }}" + ##### Entities ##### + - repeat: + for_each: + - row: entitypage03.value01 + entity: "{{ entities_entity17 }}" + entity_name: "{{ entities_entity17_name }}" + entity_icon: "{{ entities_entity17_icon }}" + - row: entitypage03.value02 + entity: "{{ entities_entity18 }}" + entity_name: "{{ entities_entity18_name }}" + entity_icon: "{{ entities_entity18_icon }}" + - row: entitypage03.value03 + entity: "{{ entities_entity19 }}" + entity_name: "{{ entities_entity19_name }}" + entity_icon: "{{ entities_entity19_icon }}" + - row: entitypage03.value04 + entity: "{{ entities_entity20 }}" + entity_name: "{{ entities_entity20_name }}" + entity_icon: "{{ entities_entity20_icon }}" + - row: entitypage03.value05 + entity: "{{ entities_entity21 }}" + entity_name: "{{ entities_entity21_name }}" + entity_icon: "{{ entities_entity21_icon }}" + - row: entitypage03.value06 + entity: "{{ entities_entity22 }}" + entity_name: "{{ entities_entity22_name }}" + entity_icon: "{{ entities_entity22_icon }}" + - row: entitypage03.value07 + entity: "{{ entities_entity23 }}" + entity_name: "{{ entities_entity23_name }}" + entity_icon: "{{ entities_entity23_icon }}" + - row: entitypage03.value08 + entity: "{{ entities_entity24 }}" + entity_name: "{{ entities_entity24_name }}" + entity_icon: "{{ entities_entity24_icon }}" + + sequence: + - if: + - condition: template + value_template: '{{ repeat.item.entity|length > 0 }}' + then: + - if: + - condition: template + value_template: '{{ repeat.item.entity_icon |length > 0 }}' + then: + - service: "{{ command_text_printf }}" + data: + component: "{{ repeat.item.row }}_pic" + message: "{{ repeat.item.entity_icon }}" + - service: "{{ command_text_printf }}" + data: + component: "{{ repeat.item.row }}_label" + message: >- + {%- if repeat.item.entity_name |length > 0 -%} {{ repeat.item.entity_name }} + {%- elif states(repeat.item.entity) == 'unavailable' -%} {{ repeat.item.entity }} + {%- else -%} {{ state_attr(repeat.item.entity, "friendly_name")| default('no name') }} + {%- endif -%} + - service: "{{ command_text_printf }}" + data: + component: "{{ repeat.item.row }}" + #message: '{{ states(repeat.item.entity) }} {{ state_attr(repeat.item.entity, "unit_of_measurement")| default("") }}' + message: >- + {%- if state_attr(repeat.item.entity, "unit_of_measurement") == None -%} + {{ states(repeat.item.entity) }} + {%- else -%} + {{ states(repeat.item.entity) }} {{ state_attr(repeat.item.entity, "unit_of_measurement") }} + {%- endif -%} + + ## ENTITY PAGE 04 ## + - conditions: '{{ trigger.event.data.new_state.state == page_entitypage04 }}' + sequence: + ##### ENTITY Page Label ##### + - if: + - condition: template + value_template: '{{ entity_page04_label |length > 0 }}' + then: + - service: "{{ command_text_printf }}" + data: + component: "entity04_label" + message: "{{ entity_page04_label }}" + ##### Entities ##### + - repeat: + for_each: + - row: entitypage04.value01 + entity: "{{ entities_entity25 }}" + entity_name: "{{ entities_entity25_name }}" + entity_icon: "{{ entities_entity25_icon }}" + - row: entitypage04.value02 + entity: "{{ entities_entity26 }}" + entity_name: "{{ entities_entity26_name }}" + entity_icon: "{{ entities_entity26_icon }}" + - row: entitypage04.value03 + entity: "{{ entities_entity27 }}" + entity_name: "{{ entities_entity27_name }}" + entity_icon: "{{ entities_entity27_icon }}" + - row: entitypage04.value04 + entity: "{{ entities_entity28 }}" + entity_name: "{{ entities_entity28_name }}" + entity_icon: "{{ entities_entity28_icon }}" + - row: entitypage04.value05 + entity: "{{ entities_entity29 }}" + entity_name: "{{ entities_entity29_name }}" + entity_icon: "{{ entities_entity29_icon }}" + - row: entitypage04.value06 + entity: "{{ entities_entity30 }}" + entity_name: "{{ entities_entity30_name }}" + entity_icon: "{{ entities_entity30_icon }}" + - row: entitypage04.value07 + entity: "{{ entities_entity31 }}" + entity_name: "{{ entities_entity31_name }}" + entity_icon: "{{ entities_entity31_icon }}" + - row: entitypage04.value08 + entity: "{{ entities_entity32 }}" + entity_name: "{{ entities_entity32_name }}" + entity_icon: "{{ entities_entity32_icon }}" + + sequence: + - if: + - condition: template + value_template: '{{ repeat.item.entity|length > 0 }}' + then: + - if: + - condition: template + value_template: '{{ repeat.item.entity_icon |length > 0 }}' + then: + - service: "{{ command_text_printf }}" + data: + component: "{{ repeat.item.row }}_pic" + message: "{{ repeat.item.entity_icon }}" + - service: "{{ command_text_printf }}" + data: + component: "{{ repeat.item.row }}_label" + message: >- + {%- if repeat.item.entity_name |length > 0 -%} {{ repeat.item.entity_name }} + {%- elif states(repeat.item.entity) == 'unavailable' -%} {{ repeat.item.entity }} + {%- else -%} {{ state_attr(repeat.item.entity, "friendly_name")| default('no name') }} + {%- endif -%} + - service: "{{ command_text_printf }}" + data: + component: "{{ repeat.item.row }}" + #message: '{{ states(repeat.item.entity) }} {{ state_attr(repeat.item.entity, "unit_of_measurement")| default("") }}' + message: >- + {%- if state_attr(repeat.item.entity, "unit_of_measurement") == None -%} + {{ states(repeat.item.entity) }} + {%- else -%} + {{ states(repeat.item.entity) }} {{ state_attr(repeat.item.entity, "unit_of_measurement") }} + {%- endif -%} + + ##### Open Climate Settings ##### - conditions: - condition: trigger diff --git a/nspanel_esphome.yaml b/nspanel_esphome.yaml index 762c45c..6cda307 100644 --- a/nspanel_esphome.yaml +++ b/nspanel_esphome.yaml @@ -238,6 +238,17 @@ api: - rtttl.play: rtttl: !lambda 'return song_str;' + # Service to show a QR code on the display (ex. for WiFi password) + - service: qr_code + variables: + qrdata: string + then: + - wait_until: + switch.is_on: nextion_init + - lambda: |- + id(disp1).send_command_printf("page qrcode"); + id(disp1).set_component_text_printf("qrcode.qrcode_value", "%s", qrdata.c_str()); + #### Service to send thermostat cycle state #### - service: send_thermostat_cycle_state variables: @@ -247,126 +258,12 @@ api: switch.is_on: nextion_init - lambda: |- //ESP_LOGD("nextion", "thermostat sendig value %f", value); - int left=16; // 16 is empty left. - int mid=17; // 17 is empty mid. - int right=18; // 18 is empty right. - if (value < 13.5) { - left=16; - mid=17; - right=18; - } else if (value >= 13.5 and value < 14) { - left=19; - mid=17; - right=18; - } else if (value >= 14 and value < 14.5) { - left=20; - mid=17; - right=18; - } else if (value >= 14.5 and value < 15) { - left=21; - mid=17; - right=18; - } else if (value >= 15 and value < 15.5) { - left=22; - mid=17; - right=18; - } else if (value >= 15.5 and value < 16) { - left=23; - mid=17; - right=18; - } else if (value >= 16 and value < 16.5) { - left=24; - mid=17; - right=18; - } else if (value >= 16.5 and value < 17) { - left=25; - mid=17; - right=18; - } else if (value >= 17 and value < 17.5) { - left=26; - mid=17; - right=18; - } else if (value >= 17.5 and value < 18) { - left=27; - mid=17; - right=18; - } else if (value >= 18 and value < 18.5) { - left=28; - mid=17; - right=18; - } else if (value >= 18.5 and value < 19) { - left=29; - mid=30; - right=18; - } else if (value >= 19 and value < 19.5) { - left=29; - mid=31; - right=18; - } else if (value >= 19.5 and value < 20) { - left=29; - mid=32; - right=18; - } else if (value >= 20 and value < 20.5) { - left=29; - mid=33; - right=18; - } else if (value >= 20.5 and value < 21) { - left=29; - mid=34; - right=18; - } else if (value >= 21 and value < 21.5) { - left=29; - mid=35; - right=18; - } else if (value >= 21.5 and value < 22) { - left=29; - mid=36; - right=18; - } else if (value >= 22 and value < 22.5) { - left=29; - mid=37; - right=38; - } else if (value >= 22.5 and value < 23) { - left=29; - mid=37; - right=39; - } else if (value >= 23 and value < 23.5) { - left=29; - mid=37; - right=40; - } else if (value >= 23.5 and value < 24) { - left=29; - mid=37; - right=41; - } else if (value >= 24 and value < 24.5) { - left=29; - mid=37; - right=42; - } else if (value >= 24.5 and value < 25) { - left=29; - mid=37; - right=43; - } else if (value >= 25 and value < 25.5) { - left=29; - mid=37; - right=44; - } else if (value >= 25.5 and value < 26) { - left=29; - mid=37; - right=45; - } else if (value >= 26 and value < 26.5) { - left=29; - mid=37; - right=46; - } else if (value >= 26.5 and value < 27) { - left=29; - mid=37; - right=47; - } else if (value >= 27) { - left=29; - mid=37; - right=48; - } + int v = int(2 * std::min(std::max(value - 13.5, 0.0), 5.0)); + int left = v + (v ? 19 : 16); // 16 is empty left. + v = int(2 * std::min(std::max(value - 18.0, 0.0), 4.0)); + int mid = v + (v ? 29 : 17); // 17 is empty mid. + v = int(2 * std::min(std::max(value - 21.5, 0.0), 5.5)); + int right = v + (v ? 37 : 18); // 18 is empty right. // sends the 3 images to the display //ESP_LOGD("nextion", "thermostat left %i", left); //ESP_LOGD("nextion", "thermostat mid %i", mid); @@ -430,7 +327,7 @@ globals: restore_value: no initial_value: '' - ##### lastclick_ccurrentpage State ##### + ##### lastclick_currentpage State ##### - id: currentpage_global type: std::string restore_value: no @@ -441,23 +338,126 @@ binary_sensor: ###### LEFT BUTTON BELOW DISPLAY TO TOGGLE RELAY##### - platform: gpio - name: ${device_name} Left Button + # name: ${device_name} Left Button + id: left_button pin: number: 14 inverted: true + on_click: + - min_length: 50ms + max_length: 1000ms + then: + - binary_sensor.template.publish: + id: left_button_short + state: ON + - if: + condition: + and: + - switch.is_on: relay1_fallback + - not: + api.connected: + then: + - switch.toggle: relay_1 + - lambda: id(disp1).send_command_printf("home.icon_top_01.pic=51"); + - lambda: id(disp1).send_command_printf("home.left_bt_pic.pic=98"); + - if: + condition: + switch.is_on: relay_1 + then: + - lambda: id(disp1).send_command_printf("home.icon_top_01.pic=105"); + - delay: 500ms + - binary_sensor.template.publish: + id: left_button_short + state: OFF + on_press: + then: + - lambda: |- + if (id(disp1_currentpage).state == "lightsettings" or id(disp1_currentpage).state == "coversettings") { + ESP_LOGD("nspanel", "settingspage -> no press"); + } else { + // ESP_LOGD("nspanel", "release button"); + id(disp1_lastclick_general).set_state("pressbuttonleft",true,true); + } + on_release: + then: + - lambda: |- + if (id(disp1_currentpage).state == "lightsettings" or id(disp1_currentpage).state == "coversettings") { + ESP_LOGD("nspanel", "settingspage -> no release"); + } else { + // ESP_LOGD("nspanel", "release button"); + id(disp1_lastclick_general).set_state("releasebuttonleft",true,true); + } + + - platform: template + name: ${device_name} Left Button + id: left_button_short + lambda: |- + return {}; + ##### RIGHT BUTTON BELOW DISPLAY TO TOGGLE RELAY ##### - platform: gpio - name: ${device_name} Right Button + # name: ${device_name} Right Button + id: right_button pin: number: 27 inverted: true + on_click: + - min_length: 50ms + max_length: 1000ms + then: + - binary_sensor.template.publish: + id: right_button_short + state: ON + - if: + condition: + and: + - switch.is_on: relay2_fallback + - not: + api.connected: + then: + - switch.toggle: relay_2 + - lambda: id(disp1).send_command_printf("home.icon_top_02.pic=51"); + - lambda: id(disp1).send_command_printf("home.right_bt_pic.pic=98"); + - if: + condition: + switch.is_on: relay_2 + then: + - lambda: id(disp1).send_command_printf("home.icon_top_02.pic=106"); + - delay: 500ms + - binary_sensor.template.publish: + id: right_button_short + state: OFF + on_press: + then: + - lambda: |- + if (id(disp1_currentpage).state == "lightsettings" or id(disp1_currentpage).state == "coversettings") { + ESP_LOGD("nspanel", "settingspage -> no press"); + } else { + // ESP_LOGD("nspanel", "release button"); + id(disp1_lastclick_general).set_state("pressbuttonright",true,true); + } + on_release: + then: + - lambda: |- + if (id(disp1_currentpage).state == "lightsettings" or id(disp1_currentpage).state == "coversettings") { + ESP_LOGD("nspanel", "settingspage -> no release"); + } else { + // ESP_LOGD("nspanel", "release button"); + id(disp1_lastclick_general).set_state("releasebuttonright",true,true); + } + + - platform: template + name: ${device_name} Right Button + id: right_button_short + lambda: |- + return {}; ##### Restart NSPanel Button - Setting Page ##### - platform: nextion name: ${device_name} Restart page_id: 7 - component_id: 9 + component_id: 8 internal: true on_click: - button.press: restart_nspanel @@ -475,7 +475,7 @@ binary_sensor: - platform: nextion name: ${device_name} Sleep Modus page_id: 7 - component_id: 4 + component_id: 3 internal: true on_click: - switch.toggle: sleep_modus @@ -505,21 +505,21 @@ sensor: name: ${device_name} RSSI update_interval: 60s - ##### INTERNAL TEMPERATUE SENSOR, ADC VALUE ##### + ##### INTERNAL TEMPERATURE SENSOR, ADC VALUE ##### - platform: adc id: ntc_source pin: 38 - update_interval: 10s + update_interval: 60s attenuation: 11db - ##### INTERNAL TEMPERATUE SENSOR, adc reading converted to resistance (calculation)##### + ##### INTERNAL TEMPERATURE SENSOR, adc reading converted to resistance (calculation)##### - platform: resistance id: resistance_sensor sensor: ntc_source configuration: DOWNSTREAM resistor: 11.2kOhm - ##### INTERNAL TEMPERATUE SENSOR, resistance to temperature (calculation) ##### + ##### INTERNAL TEMPERATURE SENSOR, resistance to temperature (calculation) ##### - platform: ntc name: ${device_name} Temperature id: temp_nspanel @@ -600,6 +600,7 @@ text_sensor: ip_address: name: ${device_name} IP disabled_by_default: true + id: ip_address ssid: name: ${device_name} SSID disabled_by_default: true @@ -635,6 +636,8 @@ text_sensor: - globals.set: id: lastclick_general_global value: !lambda return x; + - lambda: |- + id(page_timer)->execute(int(id(page_timeout).state)); ##### last click lightsettings page, the main action variable - push to HA ##### - platform: nextion @@ -656,6 +659,8 @@ text_sensor: - globals.set: id: lastclick_lightsettings_global value: !lambda return x; + - lambda: |- + id(page_timer)->execute(int(id(page_timeout).state)); ##### last click coversettings page, the main action variable - push to HA ##### - platform: nextion @@ -677,6 +682,8 @@ text_sensor: - globals.set: id: lastclick_coversettings_global value: !lambda return x; + - lambda: |- + id(page_timer)->execute(int(id(page_timeout).state)); ##### last click climate page, the main action variable - push to HA ##### - platform: nextion @@ -698,6 +705,8 @@ text_sensor: - globals.set: id: lastclick_climatesettings_global value: !lambda return x; + - lambda: |- + id(page_timer)->execute(int(id(page_timeout).state)); ##### currentpage sensor, the main action variable - push to HA ##### - platform: nextion @@ -719,6 +728,32 @@ text_sensor: - globals.set: id: currentpage_global value: !lambda return x; + - lambda: |- + id(page_timer)->execute(int(id(page_timeout).state)); + + + ##### touchevent sensor, Reset the page timeout ##### + - platform: nextion + nextion_id: disp1 + #name: ${device_name} touchevent + id: disp1_touchevent + update_interval: 50ms + component_name: touchevent + internal: true + filters: + - lambda: |- + static std::string touchevent_history = ""; + if (strcmp(x.c_str(), touchevent_history.c_str()) != 0) { + touchevent_history = x; + return x; + // touchevent_history = ""; + } else { + return {}; + } + on_value: + then: + - lambda: |- + id(page_timer)->execute(int(id(page_timeout).state)); ##### START - SWITCH CONFIGURATION ##### @@ -822,6 +857,20 @@ switch: value: '1' - lambda: id(disp1).set_component_value("settings.a02",1); + ##### Relay Local control Fallback ##### + - platform: template + name: ${device_name} Relay 1 Local Fallback + id: relay1_fallback + entity_category: config + restore_state: true + optimistic: true + + - platform: template + name: ${device_name} Relay 2 Local Fallback + id: relay2_fallback + entity_category: config + restore_state: true + optimistic: true ##### START - NUMBER CONFIGURATION ##### number: @@ -880,6 +929,17 @@ number: id: temperature_correction_global value: !lambda 'return x;' +##### page-timeout ##### + - platform: template + name: ${device_name} Page Timeout + id: page_timeout + entity_category: config + min_value: 0 + max_value: 60 + initial_value: 10 + step: 1 + restore_value: true + optimistic: true ##### START - DISPLAY START CONFIGURATION ##### display: @@ -890,8 +950,10 @@ display: on_setup: then: - lambda: id(disp1).send_command_printf("page 8"); + - lambda: id(disp1).set_component_text_printf("boot.esph_version", "%s", "3.1.0"); ### esphome-version ### - wait_until: api.connected + - lambda: id(disp1).set_component_text_printf("boot.ip_addr", "%s", id(ip_address).state.c_str()); - delay: 0.5s - number.set: id: display_brightness @@ -904,13 +966,26 @@ display: - lambda: id(disp1).send_command_printf("settings.brightslider.val=%i", id(display_brightness_global)); - lambda: id(disp1).send_command_printf("settings.dimslider.val=%i", id(display_dim_brightness_global)); - lambda: id(disp1).send_command_printf("home.sleepmodus.val=%i", id(sleep_modus_global)); - - lambda: |- - id(disp1).set_component_value("settings.a02",0); - if (id(sleep_modus_global) == 1) - { - id(disp1).set_component_value("settings.a02",1); - } + - lambda: id(disp1).set_component_value("settings.a02", id(sleep_modus_global) == 1); - delay: 0.5s - switch.template.publish: id: nextion_init state: on + +### Script for page_timer +script: + - id: page_timer + mode: restart + parameters: + delay: int + then: + - lambda: ESP_LOGD("nspanel", "start page-timer delay %i", int(id(page_timeout).state)); + - delay: !lambda return delay *1000; + - lambda: |- + if (id(disp1_currentpage).state == "home" or id(disp1_currentpage).state == "screensaver" or id(disp1_currentpage).state == "boot" or int(id(page_timeout).state) == 0) { + ESP_LOGD("nspanel", "no page-jump"); + } else { + ESP_LOGD("nspanel", "timer->home"); + id(disp1).send_command_printf("page 0"); + } + diff --git a/nspanel_eu.HMI b/nspanel_eu.HMI new file mode 100644 index 0000000..72702ee Binary files /dev/null and b/nspanel_eu.HMI differ diff --git a/nspanel_eu.tft b/nspanel_eu.tft new file mode 100644 index 0000000..0dbca55 Binary files /dev/null and b/nspanel_eu.tft differ diff --git a/nspanel_us.HMI b/nspanel_us.HMI new file mode 100644 index 0000000..4a0afaa Binary files /dev/null and b/nspanel_us.HMI differ diff --git a/nspanel_us.tft b/nspanel_us.tft new file mode 100644 index 0000000..03c8e88 Binary files /dev/null and b/nspanel_us.tft differ