upd: button-pages

This commit is contained in:
deejaybeam
2023-02-17 18:06:33 +01:00
parent 0b856cbb83
commit 6642a46a04

View File

@@ -7277,136 +7277,75 @@ action:
- condition: template - condition: template
value_template: '{{ repeat.item.entity|length > 0 }}' value_template: '{{ repeat.item.entity|length > 0 }}'
then: then:
- if:
- condition: template
value_template: '{{ states[repeat.item.entity].state == "unknown" or states[repeat.item.entity].state == "unavailable" }}'
then:
##### SET Buttons Background ####
#
##### SET Button PIC #####
- service: "{{ command_printf }}"
data:
cmd: "{{ repeat.item.button }}pic.pic={{ button_off }}"
##### SET ICON Background #####
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_background_color }}"
data:
component: "{{ repeat.item.button }}icon"
message: "{{ button_color_2 }}"
##### SET TEXT Background #####
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_background_color }}"
data:
component: "{{ repeat.item.button }}text"
message: "{{ button_color_2 }}"
##### SET BRIGHTNESS Background Color #####
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_background_color }}"
data:
component: "{{ repeat.item.button }}bri"
message: "{{ button_color_2 }}"
##### SET Buttons Font Color ####
#
##### SET ICON Font Color #####
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_font_color }}"
data:
component: "{{ repeat.item.button }}icon"
message: "{{ button_color_3 }}"
##### SET TEXT Font Color #####
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_font_color }}"
data:
component: "{{ repeat.item.button }}text"
message: "{{ button_color_1 }}"
##### SET Buttons Text Value ####
#
##### "ICON" Value #####
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}"
data:
component: "{{ repeat.item.button }}icon"
message: "{{ button_icon_unknown }}"
##### "LABEL" Value #####
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}"
data:
component: "{{ repeat.item.button }}text"
message: "{{ repeat.item.button_label }}"
##### SET Button #####
else:
- variables: - variables:
component_to_update: "{{ repeat.item.button }}" ### component_to_update: "{{ repeat.item.button }}"
current_entity_state: "{{ states[repeat.item.entity].state }}"
# Button PIC GRAY/WHITE # Button PIC GRAY/WHITE
btn_pic: >- btn_pic: >-
{%- if repeat.item.entity is match "light." and states[repeat.item.entity].state == 'on' -%} {{ button_on }} {%- if current_entity_state == 'unknown' or current_entity_state == 'unavailable' -%} {{ button_off }}
{%- elif repeat.item.entity is match "light." and states[repeat.item.entity].state == 'off' -%} {{ button_off }} {%- elif repeat.item.entity is match "light." and current_entity_state == 'on' -%} {{ button_on }}
{%- elif repeat.item.entity is match "switch." and states[repeat.item.entity].state == 'on' -%} {{ button_on }} {%- elif repeat.item.entity is match "light." and current_entity_state == 'off' -%} {{ button_off }}
{%- elif repeat.item.entity is match "switch." and states[repeat.item.entity].state == 'off' -%} {{ button_off }} {%- elif repeat.item.entity is match "switch." and current_entity_state == 'on' -%} {{ button_on }}
{%- elif repeat.item.entity is match "input_boolean." and states[repeat.item.entity].state == 'on' -%} {{ button_on }} {%- elif repeat.item.entity is match "switch." and current_entity_state == 'off' -%} {{ button_off }}
{%- elif repeat.item.entity is match "input_boolean." and states[repeat.item.entity].state == 'off' -%} {{ button_off }} {%- elif repeat.item.entity is match "input_boolean." and current_entity_state == 'on' -%} {{ button_on }}
{%- elif repeat.item.entity is match "cover." and states[repeat.item.entity].state == 'open' -%} {{ button_on }} {%- elif repeat.item.entity is match "input_boolean." and current_entity_state == 'off' -%} {{ button_off }}
{%- elif repeat.item.entity is match "cover." and states[repeat.item.entity].state == 'closed' -%} {{ button_off }} {%- elif repeat.item.entity is match "cover." and current_entity_state == 'open' -%} {{ button_on }}
{%- elif repeat.item.entity is match "automation." and states[repeat.item.entity].state == 'on' -%} {{ button_on }} {%- elif repeat.item.entity is match "cover." and current_entity_state == 'closed' -%} {{ button_off }}
{%- elif repeat.item.entity is match "automation." and states[repeat.item.entity].state == 'off' -%} {{ button_off }} {%- elif repeat.item.entity is match "automation." and current_entity_state == 'on' -%} {{ button_on }}
{%- elif repeat.item.entity is match "automation." and current_entity_state == 'off' -%} {{ button_off }}
{%- elif repeat.item.entity is match "button." -%} {{ button_off }} {%- elif repeat.item.entity is match "button." -%} {{ button_off }}
{%- elif repeat.item.entity is match "input_button." -%} {{ button_off }} {%- elif repeat.item.entity is match "input_button." -%} {{ button_off }}
{%- elif repeat.item.entity is match "scene." -%} {{ button_off }} {%- elif repeat.item.entity is match "scene." -%} {{ button_off }}
{%- elif repeat.item.entity is match "script." and states[repeat.item.entity].state == 'on' -%} {{ button_on }} {%- elif repeat.item.entity is match "script." and current_entity_state == 'on' -%} {{ button_on }}
{%- elif repeat.item.entity is match "script." and states[repeat.item.entity].state == 'off' -%} {{ button_off }} {%- elif repeat.item.entity is match "script." and current_entity_state == 'off' -%} {{ button_off }}
{%- elif repeat.item.entity is match "person." and states[repeat.item.entity].state == 'home' -%} {{ button_on }} {%- elif repeat.item.entity is match "person." and current_entity_state == 'home' -%} {{ button_on }}
{%- elif repeat.item.entity is match "person." and states[repeat.item.entity].state != 'home' -%} {{ button_off }} {%- elif repeat.item.entity is match "person." and current_entity_state != 'home' -%} {{ button_off }}
{%- elif repeat.item.entity is match "binary_sensor." and states[repeat.item.entity].state == 'on' -%} {{ button_on }} {%- elif repeat.item.entity is match "binary_sensor." and current_entity_state == 'on' -%} {{ button_on }}
{%- elif repeat.item.entity is match "binary_sensor." and states[repeat.item.entity].state == 'off' -%} {{ button_off }} {%- elif repeat.item.entity is match "binary_sensor." and current_entity_state == 'off' -%} {{ button_off }}
{%- elif repeat.item.entity is match "fan." and states[repeat.item.entity].state == 'on' -%} {{ button_on }} {%- elif repeat.item.entity is match "fan." and current_entity_state == 'on' -%} {{ button_on }}
{%- elif repeat.item.entity is match "fan." and states[repeat.item.entity].state == 'off' -%} {{ button_off }} {%- elif repeat.item.entity is match "fan." and current_entity_state == 'off' -%} {{ button_off }}
{%- elif repeat.item.entity is match "climate." and states[repeat.item.entity].state != 'off' -%} {{ button_on }} {%- elif repeat.item.entity is match "climate." and current_entity_state != 'off' -%} {{ button_on }}
{%- elif repeat.item.entity is match "climate." and states[repeat.item.entity].state == 'off' -%} {{ button_off }} {%- elif repeat.item.entity is match "climate." and current_entity_state == 'off' -%} {{ button_off }}
{%- endif -%} {%- endif -%}
# TEXT, BRIGHTNESS and ICON Background # TEXT, BRIGHTNESS and ICON Background
btn_bg: >- btn_bg: >-
{%- if repeat.item.entity is match "button." or repeat.item.entity is match "input_button." or repeat.item.entity is match "scene." -%} {{ button_color_2 }} {%- if current_entity_state == 'unknown' or current_entity_state == 'unavailable' -%} {{ button_color_2 }}
{%- elif states[repeat.item.entity].state == 'on' or states[repeat.item.entity].state == 'open' -%} {{ button_color_1 }} {%- elif repeat.item.entity is match "button." or repeat.item.entity is match "input_button." or repeat.item.entity is match "scene." -%} {{ button_color_2 }}
{%- elif states[repeat.item.entity].state == 'off' or states[repeat.item.entity].state == 'closed' -%} {{ button_color_2 }} {%- elif current_entity_state == 'on' or current_entity_state == 'open' -%} {{ button_color_1 }}
{%- elif repeat.item.entity is match "person." and states[repeat.item.entity].state == 'home' -%} {{ button_color_1 }} {%- elif current_entity_state == 'off' or current_entity_state == 'closed' -%} {{ button_color_2 }}
{%- elif repeat.item.entity is match "person." and states[repeat.item.entity].state != 'home' -%} {{ button_color_2 }} {%- elif repeat.item.entity is match "person." and current_entity_state == 'home' -%} {{ button_color_1 }}
{%- elif repeat.item.entity is match "climate." and states[repeat.item.entity].state != 'off' -%} {{ button_color_1 }} {%- elif repeat.item.entity is match "person." and current_entity_state != 'home' -%} {{ button_color_2 }}
{%- elif repeat.item.entity is match "climate." and states[repeat.item.entity].state == 'off' -%} {{ button_color_2 }} {%- elif repeat.item.entity is match "climate." and current_entity_state != 'off' -%} {{ button_color_1 }}
{%- elif repeat.item.entity is match "climate." and current_entity_state == 'off' -%} {{ button_color_2 }}
{%- endif -%} {%- endif -%}
# ICON Font Color # ICON Font Color
btn_icon_font: >- btn_icon_font: >-
{%- if repeat.item.entity is match "button." or repeat.item.entity is match "input_button." or repeat.item.entity is match "scene." -%} {{ button_icon_color_1 }} {%- if current_entity_state == 'unknown' or current_entity_state == 'unavailable' -%} {{ button_color_1 }}
{%- elif states[repeat.item.entity].state == 'on' or states[repeat.item.entity].state == 'open' -%} {{ button_icon_color_2 }} {%- elif repeat.item.entity is match "button." or repeat.item.entity is match "input_button." or repeat.item.entity is match "scene." -%} {{ button_icon_color_1 }}
{%- elif states[repeat.item.entity].state == 'off' or states[repeat.item.entity].state == 'closed' -%} {{ button_icon_color_1 }} {%- elif current_entity_state == 'on' or current_entity_state == 'open' -%} {{ button_icon_color_2 }}
{%- elif repeat.item.entity is match "person." and states[repeat.item.entity].state == 'home' -%} {{ button_icon_color_2 }} {%- elif current_entity_state == 'off' or current_entity_state == 'closed' -%} {{ button_icon_color_1 }}
{%- elif repeat.item.entity is match "person." and states[repeat.item.entity].state != 'home' -%} {{ button_icon_color_1 }} {%- elif repeat.item.entity is match "person." and current_entity_state == 'home' -%} {{ button_icon_color_2 }}
{%- elif repeat.item.entity is match "climate." and states[repeat.item.entity].state != 'off' -%} {{ button_icon_color_2 }} {%- elif repeat.item.entity is match "person." and current_entity_state != 'home' -%} {{ button_icon_color_1 }}
{%- elif repeat.item.entity is match "climate." and states[repeat.item.entity].state == 'off' -%} {{ button_icon_color_1 }} {%- elif repeat.item.entity is match "climate." and current_entity_state != 'off' -%} {{ button_icon_color_2 }}
{%- elif repeat.item.entity is match "climate." and current_entity_state == 'off' -%} {{ button_icon_color_1 }}
{%- endif -%} {%- endif -%}
# LABEL Font Color # LABEL Font Color
btn_txt_font: >- btn_txt_font: >-
{%- if repeat.item.entity is match "button." or repeat.item.entity is match "input_button." or repeat.item.entity is match "scene." -%} {{ button_color_1 }} {%- if current_entity_state == 'unknown' or current_entity_state == 'unavailable' -%} {{ button_color_1 }}
{%- elif states[repeat.item.entity].state == 'on' or states[repeat.item.entity].state == 'open' -%} {{ button_color_2 }} {%- elif repeat.item.entity is match "button." or repeat.item.entity is match "input_button." or repeat.item.entity is match "scene." -%} {{ button_color_1 }}
{%- elif states[repeat.item.entity].state == 'off' or states[repeat.item.entity].state == 'closed' -%} {{ button_color_1 }} {%- elif current_entity_state == 'on' or current_entity_state == 'open' -%} {{ button_color_2 }}
{%- elif repeat.item.entity is match "person." and states[repeat.item.entity].state == 'home' -%} {{ button_color_2 }} {%- elif current_entity_state == 'off' or current_entity_state == 'closed' -%} {{ button_color_1 }}
{%- elif repeat.item.entity is match "person." and states[repeat.item.entity].state != 'home' -%} {{ button_color_1 }} {%- elif repeat.item.entity is match "person." and current_entity_state == 'home' -%} {{ button_color_2 }}
{%- elif repeat.item.entity is match "climate." and states[repeat.item.entity].state != 'off' -%} {{ button_color_2 }} {%- elif repeat.item.entity is match "person." and current_entity_state != 'home' -%} {{ button_color_1 }}
{%- elif repeat.item.entity is match "climate." and states[repeat.item.entity].state == 'off' -%} {{ button_color_1 }} {%- elif repeat.item.entity is match "climate." and current_entity_state != 'off' -%} {{ button_color_2 }}
{%- elif repeat.item.entity is match "climate." and current_entity_state == 'off' -%} {{ button_color_1 }}
{%- endif -%} {%- endif -%}
# BRIGHTNESS Font Color # BRIGHTNESS Font Color
btn_bri_font: "{{ button_color_2 }}" btn_bri_font: "{{ button_color_2 }}"
# ICON Value # ICON Value
btn_icon: >- btn_icon: >-
{%- if repeat.item.button_icon |length > 0 -%} {{ repeat.item.button_icon }} {%- if current_entity_state == 'unknown' or current_entity_state == 'unavailable' -%} {{ button_icon_unknown }}
{%- elif repeat.item.button_icon |length > 0 -%} {{ repeat.item.button_icon }}
{%- elif repeat.item.entity is match "light." -%} {{ button_icon_light }} {%- elif repeat.item.entity is match "light." -%} {{ button_icon_light }}
{%- elif repeat.item.entity is match "switch." -%} {{ button_icon_switch }} {%- elif repeat.item.entity is match "switch." -%} {{ button_icon_switch }}
{%- elif repeat.item.entity is match "input_boolean." -%} {{ button_icon_input_boolan }} {%- elif repeat.item.entity is match "input_boolean." -%} {{ button_icon_input_boolan }}
@@ -7425,9 +7364,10 @@ action:
btn_label: "{{ repeat.item.button_label }}" btn_label: "{{ repeat.item.button_label }}"
# BRIGHTNESS Value # BRIGHTNESS Value
btn_bri_txt: >- btn_bri_txt: >-
{%- if repeat.item.entity is match "light." and states(repeat.item.entity) == 'on' and state_attr(repeat.item.entity, "brightness") != None -%} {{ (state_attr(repeat.item.entity, "brightness") | int * 100 /255) | round(0) }}% {%- if current_entity_state == 'unknown' or current_entity_state == 'unavailable' -%} 0
{%- elif repeat.item.entity is match "cover." and states(repeat.item.entity) == 'open' and state_attr(repeat.item.entity, "current_position") != None -%} {{ (state_attr(repeat.item.entity, "current_position") | int(100)) | round(0) }}% {%- elif repeat.item.entity is match "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 repeat.item.entity is match "climate." and states(repeat.item.entity) != 'off' and state_attr(repeat.item.entity, "current_temperature") != None -%} {{ (state_attr(repeat.item.entity, "current_temperature") | int) | round(0) }}° {%- elif repeat.item.entity is match "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 repeat.item.entity is match "climate." and current_entity_state != 'off' and state_attr(repeat.item.entity, "current_temperature") != None -%} {{ (state_attr(repeat.item.entity, "current_temperature") | int) | round(0) }}°
{%- else -%} 0 {%- else -%} 0
{%- endif -%} {%- endif -%}
@@ -7436,27 +7376,27 @@ action:
##### SET Button PIC ##### ##### SET Button PIC #####
- service: "{{ command_printf }}" - service: "{{ command_printf }}"
data: data:
cmd: "{{ component_to_update }}pic.pic={{ btn_pic }}" cmd: "{{ repeat.item.button }}pic.pic={{ btn_pic }}"
##### SET ICON Background ##### ##### SET ICON Background #####
- delay: - delay:
milliseconds: "{{ delay_value }}" milliseconds: "{{ delay_value }}"
- service: "{{ command_background_color }}" - service: "{{ command_background_color }}"
data: data:
component: "{{ component_to_update }}icon" component: "{{ repeat.item.button }}icon"
message: "{{ btn_bg }}" message: "{{ btn_bg }}"
##### SET TEXT Background ##### ##### SET TEXT Background #####
- delay: - delay:
milliseconds: "{{ delay_value }}" milliseconds: "{{ delay_value }}"
- service: "{{ command_background_color }}" - service: "{{ command_background_color }}"
data: data:
component: "{{ component_to_update }}text" component: "{{ repeat.item.button }}text"
message: "{{ btn_bg }}" message: "{{ btn_bg }}"
##### SET BRIGHTNESS Background Color ##### ##### SET BRIGHTNESS Background Color #####
- delay: - delay:
milliseconds: "{{ delay_value }}" milliseconds: "{{ delay_value }}"
- service: "{{ command_background_color }}" - service: "{{ command_background_color }}"
data: data:
component: "{{ component_to_update }}bri" component: "{{ repeat.item.button }}bri"
message: "{{ btn_bg }}" message: "{{ btn_bg }}"
##### SET Buttons Font Color #### ##### SET Buttons Font Color ####
@@ -7466,21 +7406,21 @@ action:
milliseconds: "{{ delay_value }}" milliseconds: "{{ delay_value }}"
- service: "{{ command_font_color }}" - service: "{{ command_font_color }}"
data: data:
component: "{{ component_to_update }}icon" component: "{{ repeat.item.button }}icon"
message: "{{ btn_icon_font }}" message: "{{ btn_icon_font }}"
##### SET TEXT Font Color ##### ##### SET TEXT Font Color #####
- delay: - delay:
milliseconds: "{{ delay_value }}" milliseconds: "{{ delay_value }}"
- service: "{{ command_font_color }}" - service: "{{ command_font_color }}"
data: data:
component: "{{ component_to_update }}text" component: "{{ repeat.item.button }}text"
message: "{{ btn_txt_font }}" message: "{{ btn_txt_font }}"
##### SET BRIGHTNESS Font Color ##### ##### SET BRIGHTNESS Font Color #####
- delay: - delay:
milliseconds: "{{ delay_value }}" milliseconds: "{{ delay_value }}"
- service: "{{ command_font_color }}" - service: "{{ command_font_color }}"
data: data:
component: "{{ component_to_update }}bri" component: "{{ repeat.item.button }}bri"
message: "{{ btn_bri_font }}" message: "{{ btn_bri_font }}"
##### SET Buttons Text Value #### ##### SET Buttons Text Value ####
@@ -7490,14 +7430,14 @@ action:
milliseconds: "{{ delay_value }}" milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}" - service: "{{ command_text_printf }}"
data: data:
component: "{{ component_to_update }}icon" component: "{{ repeat.item.button }}icon"
message: "{{ btn_icon }}" message: "{{ btn_icon }}"
##### "LABEL" Value ##### ##### "LABEL" Value #####
- delay: - delay:
milliseconds: "{{ delay_value }}" milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}" - service: "{{ command_text_printf }}"
data: data:
component: "{{ component_to_update }}text" component: "{{ repeat.item.button }}text"
message: "{{ btn_label }}" message: "{{ btn_label }}"
##### "BRIGHTNESS" Value ##### ##### "BRIGHTNESS" Value #####
@@ -7509,12 +7449,12 @@ action:
then: then:
- service: "{{ command_text_printf }}" - service: "{{ command_text_printf }}"
data: data:
component: "{{ component_to_update }}bri" component: "{{ repeat.item.button }}bri"
message: " " message: " "
else: else:
- service: "{{ command_text_printf }}" - service: "{{ command_text_printf }}"
data: data:
component: "{{ component_to_update }}bri" component: "{{ repeat.item.button }}bri"
message: "{{ btn_bri_txt }}" message: "{{ btn_bri_txt }}"
## PAGE BUTTONPAGE02 ## ## PAGE BUTTONPAGE02 ##
@@ -7573,73 +7513,77 @@ action:
sequence: sequence:
- if: - if:
- condition: template - condition: template
value_template: '{{ repeat.item.entity|length > 0 and states[repeat.item.entity].state != "unavailable" and states[repeat.item.entity].state != "unknown" }}' value_template: '{{ repeat.item.entity|length > 0 }}'
then: then:
- variables: - variables:
component_to_update: "{{ repeat.item.button }}" ### component_to_update: "{{ repeat.item.button }}"
current_entity_state: "{{ states[repeat.item.entity].state }}"
# Button PIC GRAY/WHITE # Button PIC GRAY/WHITE
btn_pic: >- btn_pic: >-
{%- if repeat.item.entity is match "light." and states[repeat.item.entity].state == 'on' -%} {{ button_on }} {%- if current_entity_state == 'unknown' or current_entity_state == 'unavailable' -%} {{ button_off }}
{%- elif repeat.item.entity is match "light." and states[repeat.item.entity].state == 'off' -%} {{ button_off }} {%- elif repeat.item.entity is match "light." and current_entity_state == 'on' -%} {{ button_on }}
{%- elif repeat.item.entity is match "switch." and states[repeat.item.entity].state == 'on' -%} {{ button_on }} {%- elif repeat.item.entity is match "light." and current_entity_state == 'off' -%} {{ button_off }}
{%- elif repeat.item.entity is match "switch." and states[repeat.item.entity].state == 'off' -%} {{ button_off }} {%- elif repeat.item.entity is match "switch." and current_entity_state == 'on' -%} {{ button_on }}
{%- elif repeat.item.entity is match "input_boolean." and states[repeat.item.entity].state == 'on' -%} {{ button_on }} {%- elif repeat.item.entity is match "switch." and current_entity_state == 'off' -%} {{ button_off }}
{%- elif repeat.item.entity is match "input_boolean." and states[repeat.item.entity].state == 'off' -%} {{ button_off }} {%- elif repeat.item.entity is match "input_boolean." and current_entity_state == 'on' -%} {{ button_on }}
{%- elif repeat.item.entity is match "cover." and states[repeat.item.entity].state == 'open' -%} {{ button_on }} {%- elif repeat.item.entity is match "input_boolean." and current_entity_state == 'off' -%} {{ button_off }}
{%- elif repeat.item.entity is match "cover." and states[repeat.item.entity].state == 'closed' -%} {{ button_off }} {%- elif repeat.item.entity is match "cover." and current_entity_state == 'open' -%} {{ button_on }}
{%- elif repeat.item.entity is match "automation." and states[repeat.item.entity].state == 'on' -%} {{ button_on }} {%- elif repeat.item.entity is match "cover." and current_entity_state == 'closed' -%} {{ button_off }}
{%- elif repeat.item.entity is match "automation." and states[repeat.item.entity].state == 'off' -%} {{ button_off }} {%- elif repeat.item.entity is match "automation." and current_entity_state == 'on' -%} {{ button_on }}
{%- elif repeat.item.entity is match "automation." and current_entity_state == 'off' -%} {{ button_off }}
{%- elif repeat.item.entity is match "button." -%} {{ button_off }} {%- elif repeat.item.entity is match "button." -%} {{ button_off }}
{%- elif repeat.item.entity is match "input_button." -%} {{ button_off }} {%- elif repeat.item.entity is match "input_button." -%} {{ button_off }}
{%- elif repeat.item.entity is match "scene." -%} {{ button_off }} {%- elif repeat.item.entity is match "scene." -%} {{ button_off }}
{%- elif repeat.item.entity is match "script." and states[repeat.item.entity].state == 'on' -%} {{ button_on }} {%- elif repeat.item.entity is match "script." and current_entity_state == 'on' -%} {{ button_on }}
{%- elif repeat.item.entity is match "script." and states[repeat.item.entity].state == 'off' -%} {{ button_off }} {%- elif repeat.item.entity is match "script." and current_entity_state == 'off' -%} {{ button_off }}
{%- elif repeat.item.entity is match "person." and states[repeat.item.entity].state == 'home' -%} {{ button_on }} {%- elif repeat.item.entity is match "person." and current_entity_state == 'home' -%} {{ button_on }}
{%- elif repeat.item.entity is match "person." and states[repeat.item.entity].state != 'home' -%} {{ button_off }} {%- elif repeat.item.entity is match "person." and current_entity_state != 'home' -%} {{ button_off }}
{%- elif repeat.item.entity is match "binary_sensor." and states[repeat.item.entity].state == 'on' -%} {{ button_on }} {%- elif repeat.item.entity is match "binary_sensor." and current_entity_state == 'on' -%} {{ button_on }}
{%- elif repeat.item.entity is match "binary_sensor." and states[repeat.item.entity].state == 'off' -%} {{ button_off }} {%- elif repeat.item.entity is match "binary_sensor." and current_entity_state == 'off' -%} {{ button_off }}
{%- elif repeat.item.entity is match "fan." and states[repeat.item.entity].state == 'on' -%} {{ button_on }} {%- elif repeat.item.entity is match "fan." and current_entity_state == 'on' -%} {{ button_on }}
{%- elif repeat.item.entity is match "fan." and states[repeat.item.entity].state == 'off' -%} {{ button_off }} {%- elif repeat.item.entity is match "fan." and current_entity_state == 'off' -%} {{ button_off }}
{%- elif repeat.item.entity is match "climate." and states[repeat.item.entity].state != 'off' -%} {{ button_on }} {%- elif repeat.item.entity is match "climate." and current_entity_state != 'off' -%} {{ button_on }}
{%- elif repeat.item.entity is match "climate." and states[repeat.item.entity].state == 'off' -%} {{ button_off }} {%- elif repeat.item.entity is match "climate." and current_entity_state == 'off' -%} {{ button_off }}
{%- elif states[repeat.item.entity].state == 'unknown' -%} {{ button_off }}
{%- endif -%} {%- endif -%}
# TEXT, BRIGHTNESS and ICON Background # TEXT, BRIGHTNESS and ICON Background
btn_bg: >- btn_bg: >-
{%- if repeat.item.entity is match "button." or repeat.item.entity is match "input_button." or repeat.item.entity is match "scene." -%} {{ button_color_2 }} {%- if current_entity_state == 'unknown' or current_entity_state == 'unavailable' -%} {{ button_color_2 }}
{%- elif states[repeat.item.entity].state == 'on' or states[repeat.item.entity].state == 'open' -%} {{ button_color_1 }} {%- elif repeat.item.entity is match "button." or repeat.item.entity is match "input_button." or repeat.item.entity is match "scene." -%} {{ button_color_2 }}
{%- elif states[repeat.item.entity].state == 'off' or states[repeat.item.entity].state == 'closed' -%} {{ button_color_2 }} {%- elif current_entity_state == 'on' or current_entity_state == 'open' -%} {{ button_color_1 }}
{%- elif repeat.item.entity is match "person." and states[repeat.item.entity].state == 'home' -%} {{ button_color_1 }} {%- elif current_entity_state == 'off' or current_entity_state == 'closed' -%} {{ button_color_2 }}
{%- elif repeat.item.entity is match "person." and states[repeat.item.entity].state != 'home' -%} {{ button_color_2 }} {%- elif repeat.item.entity is match "person." and current_entity_state == 'home' -%} {{ button_color_1 }}
{%- elif repeat.item.entity is match "climate." and states[repeat.item.entity].state != 'off' -%} {{ button_color_1 }} {%- elif repeat.item.entity is match "person." and current_entity_state != 'home' -%} {{ button_color_2 }}
{%- elif repeat.item.entity is match "climate." and states[repeat.item.entity].state == 'off' -%} {{ button_color_2 }} {%- elif repeat.item.entity is match "climate." and current_entity_state != 'off' -%} {{ button_color_1 }}
{%- elif repeat.item.entity is match "climate." and current_entity_state == 'off' -%} {{ button_color_2 }}
{%- endif -%} {%- endif -%}
# ICON Font Color # ICON Font Color
btn_icon_font: >- btn_icon_font: >-
{%- if repeat.item.entity is match "button." or repeat.item.entity is match "input_button." or repeat.item.entity is match "scene." -%} {{ button_icon_color_1 }} {%- if current_entity_state == 'unknown' or current_entity_state == 'unavailable' -%} {{ button_color_1 }}
{%- elif states[repeat.item.entity].state == 'on' or states[repeat.item.entity].state == 'open' -%} {{ button_icon_color_2 }} {%- elif repeat.item.entity is match "button." or repeat.item.entity is match "input_button." or repeat.item.entity is match "scene." -%} {{ button_icon_color_1 }}
{%- elif states[repeat.item.entity].state == 'off' or states[repeat.item.entity].state == 'closed' -%} {{ button_icon_color_1 }} {%- elif current_entity_state == 'on' or current_entity_state == 'open' -%} {{ button_icon_color_2 }}
{%- elif repeat.item.entity is match "person." and states[repeat.item.entity].state == 'home' -%} {{ button_icon_color_2 }} {%- elif current_entity_state == 'off' or current_entity_state == 'closed' -%} {{ button_icon_color_1 }}
{%- elif repeat.item.entity is match "person." and states[repeat.item.entity].state != 'home' -%} {{ button_icon_color_1 }} {%- elif repeat.item.entity is match "person." and current_entity_state == 'home' -%} {{ button_icon_color_2 }}
{%- elif repeat.item.entity is match "climate." and states[repeat.item.entity].state != 'off' -%} {{ button_icon_color_2 }} {%- elif repeat.item.entity is match "person." and current_entity_state != 'home' -%} {{ button_icon_color_1 }}
{%- elif repeat.item.entity is match "climate." and states[repeat.item.entity].state == 'off' -%} {{ button_icon_color_1 }} {%- elif repeat.item.entity is match "climate." and current_entity_state != 'off' -%} {{ button_icon_color_2 }}
{%- elif repeat.item.entity is match "climate." and current_entity_state == 'off' -%} {{ button_icon_color_1 }}
{%- endif -%} {%- endif -%}
# LABEL Font Color # LABEL Font Color
btn_txt_font: >- btn_txt_font: >-
{%- if repeat.item.entity is match "button." or repeat.item.entity is match "input_button." or repeat.item.entity is match "scene." -%} {{ button_color_1 }} {%- if current_entity_state == 'unknown' or current_entity_state == 'unavailable' -%} {{ button_color_1 }}
{%- elif states[repeat.item.entity].state == 'on' or states[repeat.item.entity].state == 'open' -%} {{ button_color_2 }} {%- elif repeat.item.entity is match "button." or repeat.item.entity is match "input_button." or repeat.item.entity is match "scene." -%} {{ button_color_1 }}
{%- elif states[repeat.item.entity].state == 'off' or states[repeat.item.entity].state == 'closed' -%} {{ button_color_1 }} {%- elif current_entity_state == 'on' or current_entity_state == 'open' -%} {{ button_color_2 }}
{%- elif repeat.item.entity is match "person." and states[repeat.item.entity].state == 'home' -%} {{ button_color_2 }} {%- elif current_entity_state == 'off' or current_entity_state == 'closed' -%} {{ button_color_1 }}
{%- elif repeat.item.entity is match "person." and states[repeat.item.entity].state != 'home' -%} {{ button_color_1 }} {%- elif repeat.item.entity is match "person." and current_entity_state == 'home' -%} {{ button_color_2 }}
{%- elif repeat.item.entity is match "climate." and states[repeat.item.entity].state != 'off' -%} {{ button_color_2 }} {%- elif repeat.item.entity is match "person." and current_entity_state != 'home' -%} {{ button_color_1 }}
{%- elif repeat.item.entity is match "climate." and states[repeat.item.entity].state == 'off' -%} {{ button_color_1 }} {%- elif repeat.item.entity is match "climate." and current_entity_state != 'off' -%} {{ button_color_2 }}
{%- elif repeat.item.entity is match "climate." and current_entity_state == 'off' -%} {{ button_color_1 }}
{%- endif -%} {%- endif -%}
# BRIGHTNESS Font Color # BRIGHTNESS Font Color
btn_bri_font: "{{ button_color_2 }}" btn_bri_font: "{{ button_color_2 }}"
# ICON Value # ICON Value
btn_icon: >- btn_icon: >-
{%- if repeat.item.button_icon |length > 0 -%} {{ repeat.item.button_icon }} {%- if current_entity_state == 'unknown' or current_entity_state == 'unavailable' -%} {{ button_icon_unknown }}
{%- elif states[repeat.item.entity].state == 'unknown' -%} {{ button_icon_unknown }} {%- elif repeat.item.button_icon |length > 0 -%} {{ repeat.item.button_icon }}
{%- elif repeat.item.entity is match "light." -%} {{ button_icon_light }} {%- elif repeat.item.entity is match "light." -%} {{ button_icon_light }}
{%- elif repeat.item.entity is match "switch." -%} {{ button_icon_switch }} {%- elif repeat.item.entity is match "switch." -%} {{ button_icon_switch }}
{%- elif repeat.item.entity is match "input_boolean." -%} {{ button_icon_input_boolan }} {%- elif repeat.item.entity is match "input_boolean." -%} {{ button_icon_input_boolan }}
@@ -7658,9 +7602,10 @@ action:
btn_label: "{{ repeat.item.button_label }}" btn_label: "{{ repeat.item.button_label }}"
# BRIGHTNESS Value # BRIGHTNESS Value
btn_bri_txt: >- btn_bri_txt: >-
{%- if repeat.item.entity is match "light." and states(repeat.item.entity) == 'on' and state_attr(repeat.item.entity, "brightness") != None -%} {{ (state_attr(repeat.item.entity, "brightness") | int * 100 /255) | round(0) }}% {%- if current_entity_state == 'unknown' or current_entity_state == 'unavailable' -%} 0
{%- elif repeat.item.entity is match "cover." and states(repeat.item.entity) == 'open' and state_attr(repeat.item.entity, "current_position") != None -%} {{ (state_attr(repeat.item.entity, "current_position") | int(100)) | round(0) }}% {%- elif repeat.item.entity is match "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 repeat.item.entity is match "climate." and states(repeat.item.entity) != 'off' and state_attr(repeat.item.entity, "current_temperature") != None -%} {{ (state_attr(repeat.item.entity, "current_temperature") | int) | round(0) }}° {%- elif repeat.item.entity is match "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 repeat.item.entity is match "climate." and current_entity_state != 'off' and state_attr(repeat.item.entity, "current_temperature") != None -%} {{ (state_attr(repeat.item.entity, "current_temperature") | int) | round(0) }}°
{%- else -%} 0 {%- else -%} 0
{%- endif -%} {%- endif -%}
@@ -7669,27 +7614,27 @@ action:
##### SET Button PIC ##### ##### SET Button PIC #####
- service: "{{ command_printf }}" - service: "{{ command_printf }}"
data: data:
cmd: "{{ component_to_update }}pic.pic={{ btn_pic }}" cmd: "{{ repeat.item.button }}pic.pic={{ btn_pic }}"
##### SET ICON Background ##### ##### SET ICON Background #####
- delay: - delay:
milliseconds: "{{ delay_value }}" milliseconds: "{{ delay_value }}"
- service: "{{ command_background_color }}" - service: "{{ command_background_color }}"
data: data:
component: "{{ component_to_update }}icon" component: "{{ repeat.item.button }}icon"
message: "{{ btn_bg }}" message: "{{ btn_bg }}"
##### SET TEXT Background ##### ##### SET TEXT Background #####
- delay: - delay:
milliseconds: "{{ delay_value }}" milliseconds: "{{ delay_value }}"
- service: "{{ command_background_color }}" - service: "{{ command_background_color }}"
data: data:
component: "{{ component_to_update }}text" component: "{{ repeat.item.button }}text"
message: "{{ btn_bg }}" message: "{{ btn_bg }}"
##### SET BRIGHTNESS Background Color ##### ##### SET BRIGHTNESS Background Color #####
- delay: - delay:
milliseconds: "{{ delay_value }}" milliseconds: "{{ delay_value }}"
- service: "{{ command_background_color }}" - service: "{{ command_background_color }}"
data: data:
component: "{{ component_to_update }}bri" component: "{{ repeat.item.button }}bri"
message: "{{ btn_bg }}" message: "{{ btn_bg }}"
##### SET Buttons Font Color #### ##### SET Buttons Font Color ####
@@ -7699,21 +7644,21 @@ action:
milliseconds: "{{ delay_value }}" milliseconds: "{{ delay_value }}"
- service: "{{ command_font_color }}" - service: "{{ command_font_color }}"
data: data:
component: "{{ component_to_update }}icon" component: "{{ repeat.item.button }}icon"
message: "{{ btn_icon_font }}" message: "{{ btn_icon_font }}"
##### SET TEXT Font Color ##### ##### SET TEXT Font Color #####
- delay: - delay:
milliseconds: "{{ delay_value }}" milliseconds: "{{ delay_value }}"
- service: "{{ command_font_color }}" - service: "{{ command_font_color }}"
data: data:
component: "{{ component_to_update }}text" component: "{{ repeat.item.button }}text"
message: "{{ btn_txt_font }}" message: "{{ btn_txt_font }}"
##### SET BRIGHTNESS Font Color ##### ##### SET BRIGHTNESS Font Color #####
- delay: - delay:
milliseconds: "{{ delay_value }}" milliseconds: "{{ delay_value }}"
- service: "{{ command_font_color }}" - service: "{{ command_font_color }}"
data: data:
component: "{{ component_to_update }}bri" component: "{{ repeat.item.button }}bri"
message: "{{ btn_bri_font }}" message: "{{ btn_bri_font }}"
##### SET Buttons Text Value #### ##### SET Buttons Text Value ####
@@ -7723,14 +7668,14 @@ action:
milliseconds: "{{ delay_value }}" milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}" - service: "{{ command_text_printf }}"
data: data:
component: "{{ component_to_update }}icon" component: "{{ repeat.item.button }}icon"
message: "{{ btn_icon }}" message: "{{ btn_icon }}"
##### "LABEL" Value ##### ##### "LABEL" Value #####
- delay: - delay:
milliseconds: "{{ delay_value }}" milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}" - service: "{{ command_text_printf }}"
data: data:
component: "{{ component_to_update }}text" component: "{{ repeat.item.button }}text"
message: "{{ btn_label }}" message: "{{ btn_label }}"
##### "BRIGHTNESS" Value ##### ##### "BRIGHTNESS" Value #####
@@ -7742,12 +7687,12 @@ action:
then: then:
- service: "{{ command_text_printf }}" - service: "{{ command_text_printf }}"
data: data:
component: "{{ component_to_update }}bri" component: "{{ repeat.item.button }}bri"
message: " " message: " "
else: else:
- service: "{{ command_text_printf }}" - service: "{{ command_text_printf }}"
data: data:
component: "{{ component_to_update }}bri" component: "{{ repeat.item.button }}bri"
message: "{{ btn_bri_txt }}" message: "{{ btn_bri_txt }}"
## PAGE BUTTONPAGE03 ## ## PAGE BUTTONPAGE03 ##
@@ -7806,73 +7751,77 @@ action:
sequence: sequence:
- if: - if:
- condition: template - condition: template
value_template: '{{ repeat.item.entity|length > 0 and states[repeat.item.entity].state != "unavailable" and states[repeat.item.entity].state != "unknown" }}' value_template: '{{ repeat.item.entity|length > 0 }}'
then: then:
- variables: - variables:
component_to_update: "{{ repeat.item.button }}" ### component_to_update: "{{ repeat.item.button }}"
current_entity_state: "{{ states[repeat.item.entity].state }}"
# Button PIC GRAY/WHITE # Button PIC GRAY/WHITE
btn_pic: >- btn_pic: >-
{%- if repeat.item.entity is match "light." and states[repeat.item.entity].state == 'on' -%} {{ button_on }} {%- if current_entity_state == 'unknown' or current_entity_state == 'unavailable' -%} {{ button_off }}
{%- elif repeat.item.entity is match "light." and states[repeat.item.entity].state == 'off' -%} {{ button_off }} {%- elif repeat.item.entity is match "light." and current_entity_state == 'on' -%} {{ button_on }}
{%- elif repeat.item.entity is match "switch." and states[repeat.item.entity].state == 'on' -%} {{ button_on }} {%- elif repeat.item.entity is match "light." and current_entity_state == 'off' -%} {{ button_off }}
{%- elif repeat.item.entity is match "switch." and states[repeat.item.entity].state == 'off' -%} {{ button_off }} {%- elif repeat.item.entity is match "switch." and current_entity_state == 'on' -%} {{ button_on }}
{%- elif repeat.item.entity is match "input_boolean." and states[repeat.item.entity].state == 'on' -%} {{ button_on }} {%- elif repeat.item.entity is match "switch." and current_entity_state == 'off' -%} {{ button_off }}
{%- elif repeat.item.entity is match "input_boolean." and states[repeat.item.entity].state == 'off' -%} {{ button_off }} {%- elif repeat.item.entity is match "input_boolean." and current_entity_state == 'on' -%} {{ button_on }}
{%- elif repeat.item.entity is match "cover." and states[repeat.item.entity].state == 'open' -%} {{ button_on }} {%- elif repeat.item.entity is match "input_boolean." and current_entity_state == 'off' -%} {{ button_off }}
{%- elif repeat.item.entity is match "cover." and states[repeat.item.entity].state == 'closed' -%} {{ button_off }} {%- elif repeat.item.entity is match "cover." and current_entity_state == 'open' -%} {{ button_on }}
{%- elif repeat.item.entity is match "automation." and states[repeat.item.entity].state == 'on' -%} {{ button_on }} {%- elif repeat.item.entity is match "cover." and current_entity_state == 'closed' -%} {{ button_off }}
{%- elif repeat.item.entity is match "automation." and states[repeat.item.entity].state == 'off' -%} {{ button_off }} {%- elif repeat.item.entity is match "automation." and current_entity_state == 'on' -%} {{ button_on }}
{%- elif repeat.item.entity is match "automation." and current_entity_state == 'off' -%} {{ button_off }}
{%- elif repeat.item.entity is match "button." -%} {{ button_off }} {%- elif repeat.item.entity is match "button." -%} {{ button_off }}
{%- elif repeat.item.entity is match "input_button." -%} {{ button_off }} {%- elif repeat.item.entity is match "input_button." -%} {{ button_off }}
{%- elif repeat.item.entity is match "scene." -%} {{ button_off }} {%- elif repeat.item.entity is match "scene." -%} {{ button_off }}
{%- elif repeat.item.entity is match "script." and states[repeat.item.entity].state == 'on' -%} {{ button_on }} {%- elif repeat.item.entity is match "script." and current_entity_state == 'on' -%} {{ button_on }}
{%- elif repeat.item.entity is match "script." and states[repeat.item.entity].state == 'off' -%} {{ button_off }} {%- elif repeat.item.entity is match "script." and current_entity_state == 'off' -%} {{ button_off }}
{%- elif repeat.item.entity is match "person." and states[repeat.item.entity].state == 'home' -%} {{ button_on }} {%- elif repeat.item.entity is match "person." and current_entity_state == 'home' -%} {{ button_on }}
{%- elif repeat.item.entity is match "person." and states[repeat.item.entity].state != 'home' -%} {{ button_off }} {%- elif repeat.item.entity is match "person." and current_entity_state != 'home' -%} {{ button_off }}
{%- elif repeat.item.entity is match "binary_sensor." and states[repeat.item.entity].state == 'on' -%} {{ button_on }} {%- elif repeat.item.entity is match "binary_sensor." and current_entity_state == 'on' -%} {{ button_on }}
{%- elif repeat.item.entity is match "binary_sensor." and states[repeat.item.entity].state == 'off' -%} {{ button_off }} {%- elif repeat.item.entity is match "binary_sensor." and current_entity_state == 'off' -%} {{ button_off }}
{%- elif repeat.item.entity is match "fan." and states[repeat.item.entity].state == 'on' -%} {{ button_on }} {%- elif repeat.item.entity is match "fan." and current_entity_state == 'on' -%} {{ button_on }}
{%- elif repeat.item.entity is match "fan." and states[repeat.item.entity].state == 'off' -%} {{ button_off }} {%- elif repeat.item.entity is match "fan." and current_entity_state == 'off' -%} {{ button_off }}
{%- elif repeat.item.entity is match "climate." and states[repeat.item.entity].state != 'off' -%} {{ button_on }} {%- elif repeat.item.entity is match "climate." and current_entity_state != 'off' -%} {{ button_on }}
{%- elif repeat.item.entity is match "climate." and states[repeat.item.entity].state == 'off' -%} {{ button_off }} {%- elif repeat.item.entity is match "climate." and current_entity_state == 'off' -%} {{ button_off }}
{%- elif states[repeat.item.entity].state == 'unknown' -%} {{ button_off }}
{%- endif -%} {%- endif -%}
# TEXT, BRIGHTNESS and ICON Background # TEXT, BRIGHTNESS and ICON Background
btn_bg: >- btn_bg: >-
{%- if repeat.item.entity is match "button." or repeat.item.entity is match "input_button." or repeat.item.entity is match "scene." -%} {{ button_color_2 }} {%- if current_entity_state == 'unknown' or current_entity_state == 'unavailable' -%} {{ button_color_2 }}
{%- elif states[repeat.item.entity].state == 'on' or states[repeat.item.entity].state == 'open' -%} {{ button_color_1 }} {%- elif repeat.item.entity is match "button." or repeat.item.entity is match "input_button." or repeat.item.entity is match "scene." -%} {{ button_color_2 }}
{%- elif states[repeat.item.entity].state == 'off' or states[repeat.item.entity].state == 'closed' -%} {{ button_color_2 }} {%- elif current_entity_state == 'on' or current_entity_state == 'open' -%} {{ button_color_1 }}
{%- elif repeat.item.entity is match "person." and states[repeat.item.entity].state == 'home' -%} {{ button_color_1 }} {%- elif current_entity_state == 'off' or current_entity_state == 'closed' -%} {{ button_color_2 }}
{%- elif repeat.item.entity is match "person." and states[repeat.item.entity].state != 'home' -%} {{ button_color_2 }} {%- elif repeat.item.entity is match "person." and current_entity_state == 'home' -%} {{ button_color_1 }}
{%- elif repeat.item.entity is match "climate." and states[repeat.item.entity].state != 'off' -%} {{ button_color_1 }} {%- elif repeat.item.entity is match "person." and current_entity_state != 'home' -%} {{ button_color_2 }}
{%- elif repeat.item.entity is match "climate." and states[repeat.item.entity].state == 'off' -%} {{ button_color_2 }} {%- elif repeat.item.entity is match "climate." and current_entity_state != 'off' -%} {{ button_color_1 }}
{%- elif repeat.item.entity is match "climate." and current_entity_state == 'off' -%} {{ button_color_2 }}
{%- endif -%} {%- endif -%}
# ICON Font Color # ICON Font Color
btn_icon_font: >- btn_icon_font: >-
{%- if repeat.item.entity is match "button." or repeat.item.entity is match "input_button." or repeat.item.entity is match "scene." -%} {{ button_icon_color_1 }} {%- if current_entity_state == 'unknown' or current_entity_state == 'unavailable' -%} {{ button_color_1 }}
{%- elif states[repeat.item.entity].state == 'on' or states[repeat.item.entity].state == 'open' -%} {{ button_icon_color_2 }} {%- elif repeat.item.entity is match "button." or repeat.item.entity is match "input_button." or repeat.item.entity is match "scene." -%} {{ button_icon_color_1 }}
{%- elif states[repeat.item.entity].state == 'off' or states[repeat.item.entity].state == 'closed' -%} {{ button_icon_color_1 }} {%- elif current_entity_state == 'on' or current_entity_state == 'open' -%} {{ button_icon_color_2 }}
{%- elif repeat.item.entity is match "person." and states[repeat.item.entity].state == 'home' -%} {{ button_icon_color_2 }} {%- elif current_entity_state == 'off' or current_entity_state == 'closed' -%} {{ button_icon_color_1 }}
{%- elif repeat.item.entity is match "person." and states[repeat.item.entity].state != 'home' -%} {{ button_icon_color_1 }} {%- elif repeat.item.entity is match "person." and current_entity_state == 'home' -%} {{ button_icon_color_2 }}
{%- elif repeat.item.entity is match "climate." and states[repeat.item.entity].state != 'off' -%} {{ button_icon_color_2 }} {%- elif repeat.item.entity is match "person." and current_entity_state != 'home' -%} {{ button_icon_color_1 }}
{%- elif repeat.item.entity is match "climate." and states[repeat.item.entity].state == 'off' -%} {{ button_icon_color_1 }} {%- elif repeat.item.entity is match "climate." and current_entity_state != 'off' -%} {{ button_icon_color_2 }}
{%- elif repeat.item.entity is match "climate." and current_entity_state == 'off' -%} {{ button_icon_color_1 }}
{%- endif -%} {%- endif -%}
# LABEL Font Color # LABEL Font Color
btn_txt_font: >- btn_txt_font: >-
{%- if repeat.item.entity is match "button." or repeat.item.entity is match "input_button." or repeat.item.entity is match "scene." -%} {{ button_color_1 }} {%- if current_entity_state == 'unknown' or current_entity_state == 'unavailable' -%} {{ button_color_1 }}
{%- elif states[repeat.item.entity].state == 'on' or states[repeat.item.entity].state == 'open' -%} {{ button_color_2 }} {%- elif repeat.item.entity is match "button." or repeat.item.entity is match "input_button." or repeat.item.entity is match "scene." -%} {{ button_color_1 }}
{%- elif states[repeat.item.entity].state == 'off' or states[repeat.item.entity].state == 'closed' -%} {{ button_color_1 }} {%- elif current_entity_state == 'on' or current_entity_state == 'open' -%} {{ button_color_2 }}
{%- elif repeat.item.entity is match "person." and states[repeat.item.entity].state == 'home' -%} {{ button_color_2 }} {%- elif current_entity_state == 'off' or current_entity_state == 'closed' -%} {{ button_color_1 }}
{%- elif repeat.item.entity is match "person." and states[repeat.item.entity].state != 'home' -%} {{ button_color_1 }} {%- elif repeat.item.entity is match "person." and current_entity_state == 'home' -%} {{ button_color_2 }}
{%- elif repeat.item.entity is match "climate." and states[repeat.item.entity].state != 'off' -%} {{ button_color_2 }} {%- elif repeat.item.entity is match "person." and current_entity_state != 'home' -%} {{ button_color_1 }}
{%- elif repeat.item.entity is match "climate." and states[repeat.item.entity].state == 'off' -%} {{ button_color_1 }} {%- elif repeat.item.entity is match "climate." and current_entity_state != 'off' -%} {{ button_color_2 }}
{%- elif repeat.item.entity is match "climate." and current_entity_state == 'off' -%} {{ button_color_1 }}
{%- endif -%} {%- endif -%}
# BRIGHTNESS Font Color # BRIGHTNESS Font Color
btn_bri_font: "{{ button_color_2 }}" btn_bri_font: "{{ button_color_2 }}"
# ICON Value # ICON Value
btn_icon: >- btn_icon: >-
{%- if repeat.item.button_icon |length > 0 -%} {{ repeat.item.button_icon }} {%- if current_entity_state == 'unknown' or current_entity_state == 'unavailable' -%} {{ button_icon_unknown }}
{%- elif states[repeat.item.entity].state == 'unknown' -%} {{ button_icon_unknown }} {%- elif repeat.item.button_icon |length > 0 -%} {{ repeat.item.button_icon }}
{%- elif repeat.item.entity is match "light." -%} {{ button_icon_light }} {%- elif repeat.item.entity is match "light." -%} {{ button_icon_light }}
{%- elif repeat.item.entity is match "switch." -%} {{ button_icon_switch }} {%- elif repeat.item.entity is match "switch." -%} {{ button_icon_switch }}
{%- elif repeat.item.entity is match "input_boolean." -%} {{ button_icon_input_boolan }} {%- elif repeat.item.entity is match "input_boolean." -%} {{ button_icon_input_boolan }}
@@ -7891,9 +7840,10 @@ action:
btn_label: "{{ repeat.item.button_label }}" btn_label: "{{ repeat.item.button_label }}"
# BRIGHTNESS Value # BRIGHTNESS Value
btn_bri_txt: >- btn_bri_txt: >-
{%- if repeat.item.entity is match "light." and states(repeat.item.entity) == 'on' and state_attr(repeat.item.entity, "brightness") != None -%} {{ (state_attr(repeat.item.entity, "brightness") | int * 100 /255) | round(0) }}% {%- if current_entity_state == 'unknown' or current_entity_state == 'unavailable' -%} 0
{%- elif repeat.item.entity is match "cover." and states(repeat.item.entity) == 'open' and state_attr(repeat.item.entity, "current_position") != None -%} {{ (state_attr(repeat.item.entity, "current_position") | int(100)) | round(0) }}% {%- elif repeat.item.entity is match "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 repeat.item.entity is match "climate." and states(repeat.item.entity) != 'off' and state_attr(repeat.item.entity, "current_temperature") != None -%} {{ (state_attr(repeat.item.entity, "current_temperature") | int) | round(0) }}° {%- elif repeat.item.entity is match "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 repeat.item.entity is match "climate." and current_entity_state != 'off' and state_attr(repeat.item.entity, "current_temperature") != None -%} {{ (state_attr(repeat.item.entity, "current_temperature") | int) | round(0) }}°
{%- else -%} 0 {%- else -%} 0
{%- endif -%} {%- endif -%}
@@ -7902,27 +7852,27 @@ action:
##### SET Button PIC ##### ##### SET Button PIC #####
- service: "{{ command_printf }}" - service: "{{ command_printf }}"
data: data:
cmd: "{{ component_to_update }}pic.pic={{ btn_pic }}" cmd: "{{ repeat.item.button }}pic.pic={{ btn_pic }}"
##### SET ICON Background ##### ##### SET ICON Background #####
- delay: - delay:
milliseconds: "{{ delay_value }}" milliseconds: "{{ delay_value }}"
- service: "{{ command_background_color }}" - service: "{{ command_background_color }}"
data: data:
component: "{{ component_to_update }}icon" component: "{{ repeat.item.button }}icon"
message: "{{ btn_bg }}" message: "{{ btn_bg }}"
##### SET TEXT Background ##### ##### SET TEXT Background #####
- delay: - delay:
milliseconds: "{{ delay_value }}" milliseconds: "{{ delay_value }}"
- service: "{{ command_background_color }}" - service: "{{ command_background_color }}"
data: data:
component: "{{ component_to_update }}text" component: "{{ repeat.item.button }}text"
message: "{{ btn_bg }}" message: "{{ btn_bg }}"
##### SET BRIGHTNESS Background Color ##### ##### SET BRIGHTNESS Background Color #####
- delay: - delay:
milliseconds: "{{ delay_value }}" milliseconds: "{{ delay_value }}"
- service: "{{ command_background_color }}" - service: "{{ command_background_color }}"
data: data:
component: "{{ component_to_update }}bri" component: "{{ repeat.item.button }}bri"
message: "{{ btn_bg }}" message: "{{ btn_bg }}"
##### SET Buttons Font Color #### ##### SET Buttons Font Color ####
@@ -7932,21 +7882,21 @@ action:
milliseconds: "{{ delay_value }}" milliseconds: "{{ delay_value }}"
- service: "{{ command_font_color }}" - service: "{{ command_font_color }}"
data: data:
component: "{{ component_to_update }}icon" component: "{{ repeat.item.button }}icon"
message: "{{ btn_icon_font }}" message: "{{ btn_icon_font }}"
##### SET TEXT Font Color ##### ##### SET TEXT Font Color #####
- delay: - delay:
milliseconds: "{{ delay_value }}" milliseconds: "{{ delay_value }}"
- service: "{{ command_font_color }}" - service: "{{ command_font_color }}"
data: data:
component: "{{ component_to_update }}text" component: "{{ repeat.item.button }}text"
message: "{{ btn_txt_font }}" message: "{{ btn_txt_font }}"
##### SET BRIGHTNESS Font Color ##### ##### SET BRIGHTNESS Font Color #####
- delay: - delay:
milliseconds: "{{ delay_value }}" milliseconds: "{{ delay_value }}"
- service: "{{ command_font_color }}" - service: "{{ command_font_color }}"
data: data:
component: "{{ component_to_update }}bri" component: "{{ repeat.item.button }}bri"
message: "{{ btn_bri_font }}" message: "{{ btn_bri_font }}"
##### SET Buttons Text Value #### ##### SET Buttons Text Value ####
@@ -7956,14 +7906,14 @@ action:
milliseconds: "{{ delay_value }}" milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}" - service: "{{ command_text_printf }}"
data: data:
component: "{{ component_to_update }}icon" component: "{{ repeat.item.button }}icon"
message: "{{ btn_icon }}" message: "{{ btn_icon }}"
##### "LABEL" Value ##### ##### "LABEL" Value #####
- delay: - delay:
milliseconds: "{{ delay_value }}" milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}" - service: "{{ command_text_printf }}"
data: data:
component: "{{ component_to_update }}text" component: "{{ repeat.item.button }}text"
message: "{{ btn_label }}" message: "{{ btn_label }}"
##### "BRIGHTNESS" Value ##### ##### "BRIGHTNESS" Value #####
@@ -7975,12 +7925,12 @@ action:
then: then:
- service: "{{ command_text_printf }}" - service: "{{ command_text_printf }}"
data: data:
component: "{{ component_to_update }}bri" component: "{{ repeat.item.button }}bri"
message: " " message: " "
else: else:
- service: "{{ command_text_printf }}" - service: "{{ command_text_printf }}"
data: data:
component: "{{ component_to_update }}bri" component: "{{ repeat.item.button }}bri"
message: "{{ btn_bri_txt }}" message: "{{ btn_bri_txt }}"
## PAGE BUTTONPAGE04 ## ## PAGE BUTTONPAGE04 ##
@@ -8039,73 +7989,77 @@ action:
sequence: sequence:
- if: - if:
- condition: template - condition: template
value_template: '{{ repeat.item.entity|length > 0 and states[repeat.item.entity].state != "unavailable" and states[repeat.item.entity].state != "unknown" }}' value_template: '{{ repeat.item.entity|length > 0 }}'
then: then:
- variables: - variables:
component_to_update: "{{ repeat.item.button }}" ### component_to_update: "{{ repeat.item.button }}"
current_entity_state: "{{ states[repeat.item.entity].state }}"
# Button PIC GRAY/WHITE # Button PIC GRAY/WHITE
btn_pic: >- btn_pic: >-
{%- if repeat.item.entity is match "light." and states[repeat.item.entity].state == 'on' -%} {{ button_on }} {%- if current_entity_state == 'unknown' or current_entity_state == 'unavailable' -%} {{ button_off }}
{%- elif repeat.item.entity is match "light." and states[repeat.item.entity].state == 'off' -%} {{ button_off }} {%- elif repeat.item.entity is match "light." and current_entity_state == 'on' -%} {{ button_on }}
{%- elif repeat.item.entity is match "switch." and states[repeat.item.entity].state == 'on' -%} {{ button_on }} {%- elif repeat.item.entity is match "light." and current_entity_state == 'off' -%} {{ button_off }}
{%- elif repeat.item.entity is match "switch." and states[repeat.item.entity].state == 'off' -%} {{ button_off }} {%- elif repeat.item.entity is match "switch." and current_entity_state == 'on' -%} {{ button_on }}
{%- elif repeat.item.entity is match "input_boolean." and states[repeat.item.entity].state == 'on' -%} {{ button_on }} {%- elif repeat.item.entity is match "switch." and current_entity_state == 'off' -%} {{ button_off }}
{%- elif repeat.item.entity is match "input_boolean." and states[repeat.item.entity].state == 'off' -%} {{ button_off }} {%- elif repeat.item.entity is match "input_boolean." and current_entity_state == 'on' -%} {{ button_on }}
{%- elif repeat.item.entity is match "cover." and states[repeat.item.entity].state == 'open' -%} {{ button_on }} {%- elif repeat.item.entity is match "input_boolean." and current_entity_state == 'off' -%} {{ button_off }}
{%- elif repeat.item.entity is match "cover." and states[repeat.item.entity].state == 'closed' -%} {{ button_off }} {%- elif repeat.item.entity is match "cover." and current_entity_state == 'open' -%} {{ button_on }}
{%- elif repeat.item.entity is match "automation." and states[repeat.item.entity].state == 'on' -%} {{ button_on }} {%- elif repeat.item.entity is match "cover." and current_entity_state == 'closed' -%} {{ button_off }}
{%- elif repeat.item.entity is match "automation." and states[repeat.item.entity].state == 'off' -%} {{ button_off }} {%- elif repeat.item.entity is match "automation." and current_entity_state == 'on' -%} {{ button_on }}
{%- elif repeat.item.entity is match "automation." and current_entity_state == 'off' -%} {{ button_off }}
{%- elif repeat.item.entity is match "button." -%} {{ button_off }} {%- elif repeat.item.entity is match "button." -%} {{ button_off }}
{%- elif repeat.item.entity is match "input_button." -%} {{ button_off }} {%- elif repeat.item.entity is match "input_button." -%} {{ button_off }}
{%- elif repeat.item.entity is match "scene." -%} {{ button_off }} {%- elif repeat.item.entity is match "scene." -%} {{ button_off }}
{%- elif repeat.item.entity is match "script." and states[repeat.item.entity].state == 'on' -%} {{ button_on }} {%- elif repeat.item.entity is match "script." and current_entity_state == 'on' -%} {{ button_on }}
{%- elif repeat.item.entity is match "script." and states[repeat.item.entity].state == 'off' -%} {{ button_off }} {%- elif repeat.item.entity is match "script." and current_entity_state == 'off' -%} {{ button_off }}
{%- elif repeat.item.entity is match "person." and states[repeat.item.entity].state == 'home' -%} {{ button_on }} {%- elif repeat.item.entity is match "person." and current_entity_state == 'home' -%} {{ button_on }}
{%- elif repeat.item.entity is match "person." and states[repeat.item.entity].state != 'home' -%} {{ button_off }} {%- elif repeat.item.entity is match "person." and current_entity_state != 'home' -%} {{ button_off }}
{%- elif repeat.item.entity is match "binary_sensor." and states[repeat.item.entity].state == 'on' -%} {{ button_on }} {%- elif repeat.item.entity is match "binary_sensor." and current_entity_state == 'on' -%} {{ button_on }}
{%- elif repeat.item.entity is match "binary_sensor." and states[repeat.item.entity].state == 'off' -%} {{ button_off }} {%- elif repeat.item.entity is match "binary_sensor." and current_entity_state == 'off' -%} {{ button_off }}
{%- elif repeat.item.entity is match "fan." and states[repeat.item.entity].state == 'on' -%} {{ button_on }} {%- elif repeat.item.entity is match "fan." and current_entity_state == 'on' -%} {{ button_on }}
{%- elif repeat.item.entity is match "fan." and states[repeat.item.entity].state == 'off' -%} {{ button_off }} {%- elif repeat.item.entity is match "fan." and current_entity_state == 'off' -%} {{ button_off }}
{%- elif repeat.item.entity is match "climate." and states[repeat.item.entity].state != 'off' -%} {{ button_on }} {%- elif repeat.item.entity is match "climate." and current_entity_state != 'off' -%} {{ button_on }}
{%- elif repeat.item.entity is match "climate." and states[repeat.item.entity].state == 'off' -%} {{ button_off }} {%- elif repeat.item.entity is match "climate." and current_entity_state == 'off' -%} {{ button_off }}
{%- elif states[repeat.item.entity].state == 'unknown' -%} {{ button_off }}
{%- endif -%} {%- endif -%}
# TEXT, BRIGHTNESS and ICON Background # TEXT, BRIGHTNESS and ICON Background
btn_bg: >- btn_bg: >-
{%- if repeat.item.entity is match "button." or repeat.item.entity is match "input_button." or repeat.item.entity is match "scene." -%} {{ button_color_2 }} {%- if current_entity_state == 'unknown' or current_entity_state == 'unavailable' -%} {{ button_color_2 }}
{%- elif states[repeat.item.entity].state == 'on' or states[repeat.item.entity].state == 'open' -%} {{ button_color_1 }} {%- elif repeat.item.entity is match "button." or repeat.item.entity is match "input_button." or repeat.item.entity is match "scene." -%} {{ button_color_2 }}
{%- elif states[repeat.item.entity].state == 'off' or states[repeat.item.entity].state == 'closed' -%} {{ button_color_2 }} {%- elif current_entity_state == 'on' or current_entity_state == 'open' -%} {{ button_color_1 }}
{%- elif repeat.item.entity is match "person." and states[repeat.item.entity].state == 'home' -%} {{ button_color_1 }} {%- elif current_entity_state == 'off' or current_entity_state == 'closed' -%} {{ button_color_2 }}
{%- elif repeat.item.entity is match "person." and states[repeat.item.entity].state != 'home' -%} {{ button_color_2 }} {%- elif repeat.item.entity is match "person." and current_entity_state == 'home' -%} {{ button_color_1 }}
{%- elif repeat.item.entity is match "climate." and states[repeat.item.entity].state != 'off' -%} {{ button_color_1 }} {%- elif repeat.item.entity is match "person." and current_entity_state != 'home' -%} {{ button_color_2 }}
{%- elif repeat.item.entity is match "climate." and states[repeat.item.entity].state == 'off' -%} {{ button_color_2 }} {%- elif repeat.item.entity is match "climate." and current_entity_state != 'off' -%} {{ button_color_1 }}
{%- elif repeat.item.entity is match "climate." and current_entity_state == 'off' -%} {{ button_color_2 }}
{%- endif -%} {%- endif -%}
# ICON Font Color # ICON Font Color
btn_icon_font: >- btn_icon_font: >-
{%- if repeat.item.entity is match "button." or repeat.item.entity is match "input_button." or repeat.item.entity is match "scene." -%} {{ button_icon_color_1 }} {%- if current_entity_state == 'unknown' or current_entity_state == 'unavailable' -%} {{ button_color_1 }}
{%- elif states[repeat.item.entity].state == 'on' or states[repeat.item.entity].state == 'open' -%} {{ button_icon_color_2 }} {%- elif repeat.item.entity is match "button." or repeat.item.entity is match "input_button." or repeat.item.entity is match "scene." -%} {{ button_icon_color_1 }}
{%- elif states[repeat.item.entity].state == 'off' or states[repeat.item.entity].state == 'closed' -%} {{ button_icon_color_1 }} {%- elif current_entity_state == 'on' or current_entity_state == 'open' -%} {{ button_icon_color_2 }}
{%- elif repeat.item.entity is match "person." and states[repeat.item.entity].state == 'home' -%} {{ button_icon_color_2 }} {%- elif current_entity_state == 'off' or current_entity_state == 'closed' -%} {{ button_icon_color_1 }}
{%- elif repeat.item.entity is match "person." and states[repeat.item.entity].state != 'home' -%} {{ button_icon_color_1 }} {%- elif repeat.item.entity is match "person." and current_entity_state == 'home' -%} {{ button_icon_color_2 }}
{%- elif repeat.item.entity is match "climate." and states[repeat.item.entity].state != 'off' -%} {{ button_icon_color_2 }} {%- elif repeat.item.entity is match "person." and current_entity_state != 'home' -%} {{ button_icon_color_1 }}
{%- elif repeat.item.entity is match "climate." and states[repeat.item.entity].state == 'off' -%} {{ button_icon_color_1 }} {%- elif repeat.item.entity is match "climate." and current_entity_state != 'off' -%} {{ button_icon_color_2 }}
{%- elif repeat.item.entity is match "climate." and current_entity_state == 'off' -%} {{ button_icon_color_1 }}
{%- endif -%} {%- endif -%}
# LABEL Font Color # LABEL Font Color
btn_txt_font: >- btn_txt_font: >-
{%- if repeat.item.entity is match "button." or repeat.item.entity is match "input_button." or repeat.item.entity is match "scene." -%} {{ button_color_1 }} {%- if current_entity_state == 'unknown' or current_entity_state == 'unavailable' -%} {{ button_color_1 }}
{%- elif states[repeat.item.entity].state == 'on' or states[repeat.item.entity].state == 'open' -%} {{ button_color_2 }} {%- elif repeat.item.entity is match "button." or repeat.item.entity is match "input_button." or repeat.item.entity is match "scene." -%} {{ button_color_1 }}
{%- elif states[repeat.item.entity].state == 'off' or states[repeat.item.entity].state == 'closed' -%} {{ button_color_1 }} {%- elif current_entity_state == 'on' or current_entity_state == 'open' -%} {{ button_color_2 }}
{%- elif repeat.item.entity is match "person." and states[repeat.item.entity].state == 'home' -%} {{ button_color_2 }} {%- elif current_entity_state == 'off' or current_entity_state == 'closed' -%} {{ button_color_1 }}
{%- elif repeat.item.entity is match "person." and states[repeat.item.entity].state != 'home' -%} {{ button_color_1 }} {%- elif repeat.item.entity is match "person." and current_entity_state == 'home' -%} {{ button_color_2 }}
{%- elif repeat.item.entity is match "climate." and states[repeat.item.entity].state != 'off' -%} {{ button_color_2 }} {%- elif repeat.item.entity is match "person." and current_entity_state != 'home' -%} {{ button_color_1 }}
{%- elif repeat.item.entity is match "climate." and states[repeat.item.entity].state == 'off' -%} {{ button_color_1 }} {%- elif repeat.item.entity is match "climate." and current_entity_state != 'off' -%} {{ button_color_2 }}
{%- elif repeat.item.entity is match "climate." and current_entity_state == 'off' -%} {{ button_color_1 }}
{%- endif -%} {%- endif -%}
# BRIGHTNESS Font Color # BRIGHTNESS Font Color
btn_bri_font: "{{ button_color_2 }}" btn_bri_font: "{{ button_color_2 }}"
# ICON Value # ICON Value
btn_icon: >- btn_icon: >-
{%- if repeat.item.button_icon |length > 0 -%} {{ repeat.item.button_icon }} {%- if current_entity_state == 'unknown' or current_entity_state == 'unavailable' -%} {{ button_icon_unknown }}
{%- elif states[repeat.item.entity].state == 'unknown' -%} {{ button_icon_unknown }} {%- elif repeat.item.button_icon |length > 0 -%} {{ repeat.item.button_icon }}
{%- elif repeat.item.entity is match "light." -%} {{ button_icon_light }} {%- elif repeat.item.entity is match "light." -%} {{ button_icon_light }}
{%- elif repeat.item.entity is match "switch." -%} {{ button_icon_switch }} {%- elif repeat.item.entity is match "switch." -%} {{ button_icon_switch }}
{%- elif repeat.item.entity is match "input_boolean." -%} {{ button_icon_input_boolan }} {%- elif repeat.item.entity is match "input_boolean." -%} {{ button_icon_input_boolan }}
@@ -8124,9 +8078,10 @@ action:
btn_label: "{{ repeat.item.button_label }}" btn_label: "{{ repeat.item.button_label }}"
# BRIGHTNESS Value # BRIGHTNESS Value
btn_bri_txt: >- btn_bri_txt: >-
{%- if repeat.item.entity is match "light." and states(repeat.item.entity) == 'on' and state_attr(repeat.item.entity, "brightness") != None -%} {{ (state_attr(repeat.item.entity, "brightness") | int * 100 /255) | round(0) }}% {%- if current_entity_state == 'unknown' or current_entity_state == 'unavailable' -%} 0
{%- elif repeat.item.entity is match "cover." and states(repeat.item.entity) == 'open' and state_attr(repeat.item.entity, "current_position") != None -%} {{ (state_attr(repeat.item.entity, "current_position") | int(100)) | round(0) }}% {%- elif repeat.item.entity is match "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 repeat.item.entity is match "climate." and states(repeat.item.entity) != 'off' and state_attr(repeat.item.entity, "current_temperature") != None -%} {{ (state_attr(repeat.item.entity, "current_temperature") | int) | round(0) }}° {%- elif repeat.item.entity is match "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 repeat.item.entity is match "climate." and current_entity_state != 'off' and state_attr(repeat.item.entity, "current_temperature") != None -%} {{ (state_attr(repeat.item.entity, "current_temperature") | int) | round(0) }}°
{%- else -%} 0 {%- else -%} 0
{%- endif -%} {%- endif -%}
@@ -8135,27 +8090,27 @@ action:
##### SET Button PIC ##### ##### SET Button PIC #####
- service: "{{ command_printf }}" - service: "{{ command_printf }}"
data: data:
cmd: "{{ component_to_update }}pic.pic={{ btn_pic }}" cmd: "{{ repeat.item.button }}pic.pic={{ btn_pic }}"
##### SET ICON Background ##### ##### SET ICON Background #####
- delay: - delay:
milliseconds: "{{ delay_value }}" milliseconds: "{{ delay_value }}"
- service: "{{ command_background_color }}" - service: "{{ command_background_color }}"
data: data:
component: "{{ component_to_update }}icon" component: "{{ repeat.item.button }}icon"
message: "{{ btn_bg }}" message: "{{ btn_bg }}"
##### SET TEXT Background ##### ##### SET TEXT Background #####
- delay: - delay:
milliseconds: "{{ delay_value }}" milliseconds: "{{ delay_value }}"
- service: "{{ command_background_color }}" - service: "{{ command_background_color }}"
data: data:
component: "{{ component_to_update }}text" component: "{{ repeat.item.button }}text"
message: "{{ btn_bg }}" message: "{{ btn_bg }}"
##### SET BRIGHTNESS Background Color ##### ##### SET BRIGHTNESS Background Color #####
- delay: - delay:
milliseconds: "{{ delay_value }}" milliseconds: "{{ delay_value }}"
- service: "{{ command_background_color }}" - service: "{{ command_background_color }}"
data: data:
component: "{{ component_to_update }}bri" component: "{{ repeat.item.button }}bri"
message: "{{ btn_bg }}" message: "{{ btn_bg }}"
##### SET Buttons Font Color #### ##### SET Buttons Font Color ####
@@ -8165,21 +8120,21 @@ action:
milliseconds: "{{ delay_value }}" milliseconds: "{{ delay_value }}"
- service: "{{ command_font_color }}" - service: "{{ command_font_color }}"
data: data:
component: "{{ component_to_update }}icon" component: "{{ repeat.item.button }}icon"
message: "{{ btn_icon_font }}" message: "{{ btn_icon_font }}"
##### SET TEXT Font Color ##### ##### SET TEXT Font Color #####
- delay: - delay:
milliseconds: "{{ delay_value }}" milliseconds: "{{ delay_value }}"
- service: "{{ command_font_color }}" - service: "{{ command_font_color }}"
data: data:
component: "{{ component_to_update }}text" component: "{{ repeat.item.button }}text"
message: "{{ btn_txt_font }}" message: "{{ btn_txt_font }}"
##### SET BRIGHTNESS Font Color ##### ##### SET BRIGHTNESS Font Color #####
- delay: - delay:
milliseconds: "{{ delay_value }}" milliseconds: "{{ delay_value }}"
- service: "{{ command_font_color }}" - service: "{{ command_font_color }}"
data: data:
component: "{{ component_to_update }}bri" component: "{{ repeat.item.button }}bri"
message: "{{ btn_bri_font }}" message: "{{ btn_bri_font }}"
##### SET Buttons Text Value #### ##### SET Buttons Text Value ####
@@ -8189,14 +8144,14 @@ action:
milliseconds: "{{ delay_value }}" milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}" - service: "{{ command_text_printf }}"
data: data:
component: "{{ component_to_update }}icon" component: "{{ repeat.item.button }}icon"
message: "{{ btn_icon }}" message: "{{ btn_icon }}"
##### "LABEL" Value ##### ##### "LABEL" Value #####
- delay: - delay:
milliseconds: "{{ delay_value }}" milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}" - service: "{{ command_text_printf }}"
data: data:
component: "{{ component_to_update }}text" component: "{{ repeat.item.button }}text"
message: "{{ btn_label }}" message: "{{ btn_label }}"
##### "BRIGHTNESS" Value ##### ##### "BRIGHTNESS" Value #####
@@ -8208,12 +8163,12 @@ action:
then: then:
- service: "{{ command_text_printf }}" - service: "{{ command_text_printf }}"
data: data:
component: "{{ component_to_update }}bri" component: "{{ repeat.item.button }}bri"
message: " " message: " "
else: else:
- service: "{{ command_text_printf }}" - service: "{{ command_text_printf }}"
data: data:
component: "{{ component_to_update }}bri" component: "{{ repeat.item.button }}bri"
message: "{{ btn_bri_txt }}" message: "{{ btn_bri_txt }}"
## PAGE NOTIFICATION ## ## PAGE NOTIFICATION ##