From 8699d4d13252a8d0639622c3c751028b751ec6a5 Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 22 Nov 2022 22:46:12 +0100 Subject: [PATCH] fix: update statusbar on init and home-page --- blueprint.yaml | 61 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 59 insertions(+), 2 deletions(-) diff --git a/blueprint.yaml b/blueprint.yaml index 73e8260..b8b6bba 100644 --- a/blueprint.yaml +++ b/blueprint.yaml @@ -1866,7 +1866,7 @@ action: data: cmd: home.right_bt_pic.pic={{ right_hardware_button_state }} - ###### SET Climate Symbol ###### + ###### StatusBar - Climate Symbol ###### - if: - condition: template value_template: '{{ climate |length > 0 }}' @@ -1881,6 +1881,27 @@ action: data: cmd: home.icon_top_03.pic={{ top_menu_climate }} + ###### StatusBar - Relay Symbols ###### + - variables: + relay01_pic: >- + {%- if states(relay01_entity) == 'on' -%} {{ relay01_pic_on }} + {%- else -%} {{ top_menu_blank }} + {%- endif -%} + relay02_pic: >- + {%- if states(relay02_entity) == 'on' -%} {{ relay02_pic_on }} + {%- else -%} {{ top_menu_blank }} + {%- endif -%} + - delay: + milliseconds: "{{ delay_value }}" + - service: "{{ command_printf }}" + data: + cmd: home.icon_top_01.pic={{ relay01_pic }} + - delay: + milliseconds: "{{ delay_value }}" + - service: "{{ command_printf }}" + data: + cmd: home.icon_top_02.pic={{ relay02_pic }} + ##### NSPanel boot init finished ##### - delay: milliseconds: "{{ delay_value }}" @@ -3159,7 +3180,43 @@ action: data: cmd: home.right_bt_pic.pic={{ right_hardware_button_state }} - ##### apply climate temperature if climate_optimistic ##### + ###### StatusBar - Climate Symbol ###### + - if: + - condition: template + value_template: '{{ climate |length > 0 }}' + then: + - variables: + top_menu_climate: >- + {%- if states(climate) == "heat" and state_attr(climate, "hvac_action") != None and state_attr(climate, "hvac_action") == "heating" -%} {{ heat_pic_on }} + {%- elif states(climate) == "heat" -%} {{ thermostat_pic_on }} + {%- else -%} {{ top_menu_blank }} + {%- endif -%} + - service: "{{ command_printf }}" + data: + cmd: home.icon_top_03.pic={{ top_menu_climate }} + + ###### StatusBar - Relay Symbols ###### + - variables: + relay01_pic: >- + {%- if states(relay01_entity) == 'on' -%} {{ relay01_pic_on }} + {%- else -%} {{ top_menu_blank }} + {%- endif -%} + relay02_pic: >- + {%- if states(relay02_entity) == 'on' -%} {{ relay02_pic_on }} + {%- else -%} {{ top_menu_blank }} + {%- endif -%} + - delay: + milliseconds: "{{ delay_value }}" + - service: "{{ command_printf }}" + data: + cmd: home.icon_top_01.pic={{ relay01_pic }} + - delay: + milliseconds: "{{ delay_value }}" + - service: "{{ command_printf }}" + data: + cmd: home.icon_top_02.pic={{ relay02_pic }} + + ##### climate-page left - apply climate temperature if climate_optimistic ##### - if: - condition: template value_template: '{{ trigger.event.data.old_state.state == page_climate }}'