diff --git a/Home_Assistant/blueprints/hasp_Activate_Page_on_Idle.yaml b/Home_Assistant/blueprints/hasp_Activate_Page_on_Idle.yaml
index 9166c1a..e0d1bd6 100644
--- a/Home_Assistant/blueprints/hasp_Activate_Page_on_Idle.yaml
+++ b/Home_Assistant/blueprints/hasp_Activate_Page_on_Idle.yaml
@@ -2,7 +2,7 @@ blueprint:
name: "HASPone activates a selected page after a specified period of inactivity"
description: |
- ## Blueprint Version: `1.05.00`
+ ## Blueprint Version: `1.06.00`
# Description
@@ -122,7 +122,7 @@ condition:
action:
- delay:
- seconds: "{{idletime|int}}"
+ seconds: "{{idletime|int(default=30)}}"
- condition: template
value_template: >-
@@ -142,4 +142,4 @@ action:
data:
topic: "{{pagecommandtopic}}"
payload: "{{targetpage}}"
- retain: true
\ No newline at end of file
+ retain: true
diff --git a/Home_Assistant/blueprints/hasp_Apply_Theme_Multiple_Buttons.yaml b/Home_Assistant/blueprints/hasp_Apply_Theme_Multiple_Buttons.yaml
new file mode 100644
index 0000000..646fb9d
--- /dev/null
+++ b/Home_Assistant/blueprints/hasp_Apply_Theme_Multiple_Buttons.yaml
@@ -0,0 +1,326 @@
+blueprint:
+ name: "HASPone buttons have theme colors applied"
+ description: |
+
+ ## Blueprint Version: `1.06.00`
+
+ ## Description
+
+ Several buttons on the HASPone will have the current device theme or custom colors applied.
+
+ ## HASPone Page and Button Reference
+
+
+
+ The images below show each available HASPone page along with the layout of available button objects.
+
+ | Page 0 | Pages 1-3 | Pages 4-5 |
+ |--------|-----------|-----------|
+ |  |  |  |
+
+ | Page 6 | Page 7 | Page 8 |
+ |--------|--------|--------|
+ |  |  |  |
+
+ | Page 9 | Page 10 | Page 11 |
+ |--------|---------|---------|
+ |  |  | 
+
+
+
+ ## Nextion color codes
+
+
+
+ The Nextion environment utilizes RGB 565 encoding. [Use this handy convertor](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to select your colors and convert to the RGB 565 format.
+
+ Here are some example colors:
+
+ | Color | Code |
+ |--------|-------|
+ | White | 65535 |
+ | Black | 0 |
+ | Grey | 25388 |
+ | Red | 63488 |
+ | Green | 2016 |
+ | Blue | 31 |
+ | Yellow | 65504 |
+ | Orange | 64512 |
+ | Brown | 48192 |
+
+
+
+ domain: automation
+ input:
+ haspdevice:
+ name: "HASPone Device"
+ description: "Select the HASPone device"
+ selector:
+ device:
+ integration: mqtt
+ manufacturer: "HASwitchPlate"
+ model: "HASPone v1.0.0"
+ objects:
+ name: "HASPone buttons"
+ description: "Apply the current theme or colors defined below to all of the objects in this list"
+ default:
+ - p[1].b[4]
+ - p[1].b[5]
+ - p[1].b[6]
+ - p[1].b[7]
+ selector:
+ object:
+ selected_fgcolor:
+ name: "Selected foreground color"
+ description: 'Selected foreground color in Nextion RGB565 format (see "Nextion color codes" above for reference). -1 = Current theme selected foreground color.'
+ default: -1
+ selector:
+ number:
+ min: -1
+ max: 65535
+ mode: slider
+ selected_bgcolor:
+ name: "Selected background color"
+ description: 'Selected background color in Nextion RGB565 format (see "Nextion color codes" above for reference). -1 = Current theme selected background color.'
+ default: -1
+ selector:
+ number:
+ min: -1
+ max: 65535
+ mode: slider
+ unselected_fgcolor:
+ name: "Unselected foreground color"
+ description: 'Unselected foreground color in Nextion RGB565 format (see "Nextion color codes" above for reference). -1 = Current theme unselected foreground color.'
+ default: -1
+ selector:
+ number:
+ min: -1
+ max: 65535
+ mode: slider
+ unselected_bgcolor:
+ name: "Unselected background color"
+ description: 'Unselected background color in Nextion RGB565 format (see "Nextion color codes" above for reference). -1 = Current theme unselected background color.'
+ default: -1
+ selector:
+ number:
+ min: -1
+ max: 65535
+ mode: slider
+
+mode: parallel
+max_exceeded: silent
+
+variables:
+ haspdevice: !input haspdevice
+ haspname: >-
+ {%- for entity in device_entities(haspdevice) -%}
+ {%- if entity|regex_search("^sensor\..+_sensor(?:_\d+|)$") -%}
+ {{- entity|regex_replace(find="^sensor\.", replace="", ignorecase=true)|regex_replace(find="_sensor(?:_\d+|)$", replace="", ignorecase=true) -}}
+ {%- endif -%}
+ {%- endfor -%}
+ objects: !input objects
+ selected_fgcolor: !input selected_fgcolor
+ selected_bgcolor: !input selected_bgcolor
+ unselected_fgcolor: !input unselected_fgcolor
+ unselected_bgcolor: !input unselected_bgcolor
+ # haspobject: '{{ "p[" ~ hasppage ~ "].b[" ~ haspbutton ~ "]" }}'
+ # commandtopic: '{{ "hasp/" ~ haspname ~ "/command/" ~ haspobject }}'
+ jsoncommandtopic: '{{ "hasp/" ~ haspname ~ "/command/json" }}'
+ selectedfgtopic: '{{ "hasp/" ~ haspname ~ "/light/selectedforegroundcolor/rgb" }}'
+ selectedbgtopic: '{{ "hasp/" ~ haspname ~ "/light/selectedbackgroundcolor/rgb" }}'
+ unselectedfgtopic: '{{ "hasp/" ~ haspname ~ "/light/unselectedforegroundcolor/rgb" }}'
+ unselectedbgtopic: '{{ "hasp/" ~ haspname ~ "/light/unselectedbackgroundcolor/rgb" }}'
+ selectedfg: >-
+ {%- if (selected_fgcolor|int) >= 0 -%}
+ {{ selected_fgcolor }}
+ {%- else -%}
+ {%- set color = namespace() -%}
+ {%- for entity in device_entities(haspdevice) -%}
+ {%- if entity|regex_search("^light\..*_selected_foreground_color(?:_\d+|)$") -%}
+ {%- set color.source=entity -%}
+ {%- endif -%}
+ {%- endfor -%}
+ {%- set brightness = state_attr(color.source, "brightness")|int(default=255) / 255 -%}
+ {%- set red=(state_attr(color.source, "rgb_color")[0] * brightness)|int(default=0) -%}
+ {%- set green=(state_attr(color.source, "rgb_color")[1] * brightness)|int(default=0) -%}
+ {%- set blue=(state_attr(color.source, "rgb_color")[2] * brightness)|int(default=0) -%}
+ {{ (red|bitwise_and(248)*256) + (green|bitwise_and(252)*8) + (blue|bitwise_and(248)/8)|int }}
+ {%- endif -%}
+ selectedbg: >-
+ {%- if (selected_bgcolor|int) >= 0 -%}
+ {{ selected_bgcolor }}
+ {%- else -%}
+ {%- set color = namespace() -%}
+ {%- for entity in device_entities(haspdevice) -%}
+ {%- if entity|regex_search("^light\..*_selected_background_color(?:_\d+|)$") -%}
+ {%- set color.source=entity -%}
+ {%- endif -%}
+ {%- endfor -%}
+ {%- set brightness = state_attr(color.source, "brightness")|int(default=255) / 255 -%}
+ {%- set red=(state_attr(color.source, "rgb_color")[0] * brightness)|int(default=0) -%}
+ {%- set green=(state_attr(color.source, "rgb_color")[1] * brightness)|int(default=0) -%}
+ {%- set blue=(state_attr(color.source, "rgb_color")[2] * brightness)|int(default=0) -%}
+ {{ (red|bitwise_and(248)*256) + (green|bitwise_and(252)*8) + (blue|bitwise_and(248)/8)|int }}
+ {%- endif -%}
+ unselectedfg: >-
+ {%- if (unselected_fgcolor|int) >= 0 -%}
+ {{ unselected_fgcolor }}
+ {%- else -%}
+ {%- set color = namespace() -%}
+ {%- for entity in device_entities(haspdevice) -%}
+ {%- if entity|regex_search("^light\..*_unselected_foreground_color(?:_\d+|)$") -%}
+ {%- set color.source=entity -%}
+ {%- endif -%}
+ {%- endfor -%}
+ {%- set brightness = state_attr(color.source, "brightness")|int(default=255) / 255 -%}
+ {%- set red=(state_attr(color.source, "rgb_color")[0] * brightness)|int(default=0) -%}
+ {%- set green=(state_attr(color.source, "rgb_color")[1] * brightness)|int(default=0) -%}
+ {%- set blue=(state_attr(color.source, "rgb_color")[2] * brightness)|int(default=0) -%}
+ {{ (red|bitwise_and(248)*256) + (green|bitwise_and(252)*8) + (blue|bitwise_and(248)/8)|int }}
+ {%- endif -%}
+ unselectedbg: >-
+ {%- if (unselected_bgcolor|int) >= 0 -%}
+ {{ unselected_bgcolor }}
+ {%- else -%}
+ {%- set color = namespace() -%}
+ {%- for entity in device_entities(haspdevice) -%}
+ {%- if entity|regex_search("^light\..*_unselected_background_color(?:_\d+|)$") -%}
+ {%- set color.source=entity -%}
+ {%- endif -%}
+ {%- endfor -%}
+ {%- set brightness = state_attr(color.source, "brightness")|int(default=255) / 255 -%}
+ {%- set red=(state_attr(color.source, "rgb_color")[0] * brightness)|int(default=0) -%}
+ {%- set green=(state_attr(color.source, "rgb_color")[1] * brightness)|int(default=0) -%}
+ {%- set blue=(state_attr(color.source, "rgb_color")[2] * brightness)|int(default=0) -%}
+ {{ (red|bitwise_and(248)*256) + (green|bitwise_and(252)*8) + (blue|bitwise_and(248)/8)|int }}
+ {%- endif -%}
+
+trigger_variables:
+ haspdevice: !input haspdevice
+ haspname: >-
+ {%- for entity in device_entities(haspdevice) -%}
+ {%- if entity|regex_search("^sensor\..+_sensor(?:_\d+|)$") -%}
+ {{- entity|regex_replace(find="^sensor\.", replace="", ignorecase=true)|regex_replace(find="_sensor(?:_\d+|)$", replace="", ignorecase=true) -}}
+ {%- endif -%}
+ {%- endfor -%}
+ haspsensor: >-
+ {%- for entity in device_entities(haspdevice) -%}
+ {%- if entity|regex_search("^sensor\..+_sensor(?:_\d+|)$") -%}
+ {{ entity }}
+ {%- endif -%}
+ {%- endfor -%}
+ jsontopic: '{{ "hasp/" ~ haspname ~ "/state/json" }}'
+ selectedfgtopic: '{{ "hasp/" ~ haspname ~ "/light/selectedforegroundcolor/rgb" }}'
+ selectedbgtopic: '{{ "hasp/" ~ haspname ~ "/light/selectedbackgroundcolor/rgb" }}'
+ unselectedfgtopic: '{{ "hasp/" ~ haspname ~ "/light/unselectedforegroundcolor/rgb" }}'
+ unselectedbgtopic: '{{ "hasp/" ~ haspname ~ "/light/unselectedbackgroundcolor/rgb" }}'
+
+trigger:
+ - platform: homeassistant
+ event: start
+ - platform: template
+ value_template: "{{ is_state(haspsensor, 'ON') }}"
+ - platform: mqtt
+ topic: "{{selectedfgtopic}}"
+ - platform: mqtt
+ topic: "{{selectedbgtopic}}"
+ - platform: mqtt
+ topic: "{{unselectedfgtopic}}"
+ - platform: mqtt
+ topic: "{{unselectedbgtopic}}"
+
+condition:
+ - condition: template
+ value_template: "{{ is_state(haspsensor, 'ON') }}"
+
+action:
+ - choose:
+ #########################################################################
+ # RUN ACTIONS or Home Assistant Startup or HASPone Connect
+ # Apply text style
+ - conditions:
+ - condition: template
+ value_template: >-
+ {{-
+ (trigger is not defined)
+ or
+ (trigger.platform is none)
+ or
+ ((trigger.platform == 'homeassistant') and (trigger.event == 'start'))
+ or
+ ((trigger.platform == 'template') and (trigger.entity_id == haspsensor) and (trigger.to_state.state == 'ON'))
+ -}}
+ sequence:
+ - repeat:
+ count: "{{objects|length}}"
+ sequence:
+ - service: mqtt.publish
+ data:
+ topic: "{{jsoncommandtopic}}"
+ payload: >-
+ [
+ "{{objects[repeat.index-1]}}.pco={{selectedfg}}",
+ "{{objects[repeat.index-1]}}.bco={{selectedbg}}",
+ "{{objects[repeat.index-1]}}.pco2={{unselectedfg}}",
+ "{{objects[repeat.index-1]}}.bco2={{unselectedbg}}"
+ ]
+
+ #########################################################################
+ # Catch triggers fired by incoming MQTT messages
+ - conditions:
+ - condition: template
+ value_template: '{{ trigger.platform == "mqtt" }}'
+ sequence:
+ - choose:
+ #########################################################################
+ # Theme: Apply selected foreground color on change
+ - conditions:
+ - condition: template
+ value_template: "{{ (trigger.topic == selectedfgtopic) and ((selected_fgcolor|int) == -1) }}"
+ sequence:
+ - repeat:
+ count: "{{objects|length}}"
+ sequence:
+ - service: mqtt.publish
+ data:
+ topic: '{{ "hasp/" ~ haspname ~ "/command/" ~ objects[repeat.index-1] ~ ".pco" }}'
+ payload: "{{trigger.payload}}"
+ #########################################################################
+ # Theme: Apply selected background color on change
+ - conditions:
+ - condition: template
+ value_template: "{{ (trigger.topic == selectedbgtopic) and ((selected_bgcolor|int) == -1) }}"
+ sequence:
+ - repeat:
+ count: "{{objects|length}}"
+ sequence:
+ - service: mqtt.publish
+ data:
+ topic: '{{ "hasp/" ~ haspname ~ "/command/" ~ objects[repeat.index-1] ~ ".bco" }}'
+ payload: "{{trigger.payload}}"
+ #########################################################################
+ # Theme: Apply unselected foreground color on change
+ - conditions:
+ - condition: template
+ value_template: "{{ (trigger.topic == unselectedfgtopic) and ((unselected_fgcolor|int) == -1) }}"
+ sequence:
+ - repeat:
+ count: "{{objects|length}}"
+ sequence:
+ - service: mqtt.publish
+ data:
+ topic: '{{ "hasp/" ~ haspname ~ "/command/" ~ objects[repeat.index-1] ~ ".pco2" }}'
+ payload: "{{trigger.payload}}"
+ #########################################################################
+ # Theme: Apply unselected background color on change
+ - conditions:
+ - condition: template
+ value_template: "{{ (trigger.topic == unselectedbgtopic) and ((unselected_bgcolor|int) == -1) }}"
+ sequence:
+ - repeat:
+ count: "{{objects|length}}"
+ sequence:
+ - service: mqtt.publish
+ data:
+ topic: '{{ "hasp/" ~ haspname ~ "/command/" ~ objects[repeat.index-1] ~ ".bco2" }}'
+ payload: "{{trigger.payload}}"
diff --git a/Home_Assistant/blueprints/hasp_Display_Clock.yaml b/Home_Assistant/blueprints/hasp_Display_Clock.yaml
index 587ca8a..b1ae774 100644
--- a/Home_Assistant/blueprints/hasp_Display_Clock.yaml
+++ b/Home_Assistant/blueprints/hasp_Display_Clock.yaml
@@ -2,7 +2,7 @@ blueprint:
name: "HASPone p[x].b[y] displays a clock"
description: |
- ## Blueprint Version: `1.05.00`
+ ## Blueprint Version: `1.06.00`
# Description
@@ -165,11 +165,11 @@ variables:
hasppage: !input hasppage
haspbutton: !input haspbutton
font_select: !input font_select
- font: '{{ font_select.split(" - ")[0] | int }}'
+ font: '{{ font_select.split(" - ")[0] | int(default=8) }}'
xcen_select: !input xcen_select
- xcen: '{{ xcen_select.split(" - ")[0] | int }}'
+ xcen: '{{ xcen_select.split(" - ")[0] | int(default=1) }}'
ycen_select: !input ycen_select
- ycen: '{{ ycen_select.split(" - ")[0] | int }}'
+ ycen: '{{ ycen_select.split(" - ")[0] | int(default=1) }}'
hour24: !input hour24
ampm: !input ampm
wrap: !input wrap
diff --git a/Home_Assistant/blueprints/hasp_Display_Color_Swatches.yaml b/Home_Assistant/blueprints/hasp_Display_Color_Swatches.yaml
new file mode 100644
index 0000000..80aa862
--- /dev/null
+++ b/Home_Assistant/blueprints/hasp_Display_Color_Swatches.yaml
@@ -0,0 +1,1216 @@
+blueprint:
+ name: "HASP p[x].b[y] displays color swatches"
+ description: |
+
+ ## Blueprint Version: `1.06.00`
+
+ ## Description
+
+ Display color select swatches and dimmer for RGB light control
+
+ 
+
+ Creates a labeled button somewhere on pages 1 through 10. When pressed, user is shown a set of 12 color swatches along with dimmer controls. When complete, user selects "return" to navigate back to the previous page.
+
+ ---
+
+ # ⚠️ WARNING ⚠️
+
+ ## All HASPone blueprints must be updated to version 1.05 or later before deploying this blueprint!
+
+ ---
+
+ ## HASP Page and Button Reference
+
+ The images below show each available HASP page along with the layout of available button objects.
+
+
+
+ | Page 0 | Pages 1-3 | Pages 4-5 |
+ |--------|-----------|-----------|
+ |  |  |  |
+
+ | Page 6 | Page 7 | Page 8 |
+ |--------|--------|--------|
+ |  |  |  |
+
+ | Page 9 | Page 10 | Page 11 |
+ |--------|---------|---------|
+ |  |  | 
+
+
+
+ ## HASP Font Reference
+
+
+
+ The Nextion display supports monospaced and proportional fonts. For monospace fonts, the HASP project includes [Consolas](https://docs.microsoft.com/en-us/typography/font-list/consolas) monospace in 4 sizes, [Webdings](https://en.wikipedia.org/wiki/Webdings#Character_set) in 1 size, and [Google's "Noto Sans"](https://github.com/googlefonts/noto-fonts) proportional in 5 sizes
+
+ | Font | Name | Characters per line | Lines per button |
+ | :--- | :---------------- | :-------------------| :--------------- |
+ | 0 | Consolas 24 | 20 characters | 2 lines |
+ | 1 | Consolas 32 | 15 characters | 2 lines |
+ | 2 | Consolas 48 | 10 characters | 1 line |
+ | 3 | Consolas 80 | 6 characters | 1 line |
+ | 4 | Webdings 56 | 8 characters | 1 line |
+ | 5 | Noto Sans 24 | Proportional | 2 lines |
+ | 6 | Noto Sans 32 | Proportional | 2 lines |
+ | 7 | Noto Sans 48 | Proportional | 1 line |
+ | 8 | Noto Sans 64 | Proportional | 1 line |
+ | 9 | Noto Sans 80 | Proportional | 1 line |
+ | 10 | Noto Sans Bold 80 | Proportional | 1 line |
+
+ ### Icons
+
+ Fonts 5-10 also include [1400+ icons which you can copy and paste from here](https://htmlpreview.github.io/?https://github.com/HASwitchPlate/HASPone/blob/main/images/hasp-fontawesome5.html)
+
+ ### Font examples
+
+   
+
+
+
+ ## Nextion color codes
+
+
+
+ The Nextion environment utilizes RGB 565 encoding. [Use this handy convertor](https://nodtem66.github.io/nextion-hmi-color-convert/index.html) to select your colors and convert to the RGB 565 format.
+
+ Here are some example colors:
+
+ | Color | Code |
+ |--------|-------|
+ | White | 65535 |
+ | Black | 0 |
+ | Grey | 25388 |
+ | Red | 63488 |
+ | Green | 2016 |
+ | Blue | 31 |
+ | Yellow | 65504 |
+ | Orange | 64512 |
+ | Brown | 48192 |
+
+
+
+ domain: automation
+ input:
+ haspdevice:
+ name: "HASP Device"
+ description: "Select the HASP device"
+ selector:
+ device:
+ integration: mqtt
+ manufacturer: "HASwitchPlate"
+ model: "HASPone v1.0.0"
+ hasppage:
+ name: "HASP Page"
+ description: "Select the HASP page (1-11) for this button. Refer to the HASP Page and Button reference above."
+ default: 1
+ selector:
+ number:
+ min: 1
+ max: 11
+ mode: slider
+ unit_of_measurement: page
+ haspbutton:
+ name: "HASP Button"
+ description: "Select the HASP button. Refer to the HASP Page and Button reference above."
+ default: 4
+ selector:
+ number:
+ min: 4
+ max: 15
+ mode: slider
+ unit_of_measurement: button
+ text:
+ name: "Button text"
+ description: "Enter text to be displayed on the button."
+ default: "Color Light"
+ selector:
+ text:
+ colorlight:
+ name: "Color-capable Light to control"
+ description: "Select a light device which supports color"
+ selector:
+ entity:
+ domain: light
+ colors:
+ name: "Colors"
+ description: "Define the color shown on the display and the value sent to the controlled light for each of the 12 available buttons. `nextion_color` defines the Nextion Color Code sent to the HASPone device. `color_mode` defines the light.turn_on color mode parameter used. `color_value` is the color information sent to the light"
+ default:
+ button01:
+ nextion_color: 65098
+ color_mode: rgb_color
+ color_value:
+ - 255
+ - 202
+ - 85
+ button02:
+ nextion_color: 53021
+ color_mode: rgb_color
+ color_value:
+ - 206
+ - 228
+ - 239
+ button03:
+ nextion_color: 12953
+ color_mode: rgb_color
+ color_value:
+ - 50
+ - 80
+ - 206
+ button04:
+ nextion_color: 51655
+ color_mode: rgb_color
+ color_value:
+ - 204
+ - 58
+ - 58
+ button05:
+ nextion_color: 65400
+ color_mode: rgb_color
+ color_value:
+ - 255
+ - 238
+ - 199
+ button06:
+ nextion_color: 59294
+ color_mode: rgb_color
+ color_value:
+ - 230
+ - 240
+ - 244
+ button07:
+ nextion_color: 35965
+ color_mode: rgb_color
+ color_value:
+ - 137
+ - 142
+ - 239
+ button08:
+ nextion_color: 41561
+ color_mode: rgb_color
+ color_value:
+ - 164
+ - 73
+ - 206
+ button09:
+ nextion_color: 65501
+ color_mode: rgb_color
+ color_value:
+ - 255
+ - 250
+ - 238
+ button10:
+ nextion_color: 65535
+ color_mode: rgb_color
+ color_value:
+ - 255
+ - 255
+ - 251
+ button11:
+ nextion_color: 3372
+ color_mode: rgb_color
+ color_value:
+ - 15
+ - 165
+ - 104
+ button12:
+ nextion_color: 41065
+ color_mode: rgb_color
+ color_value:
+ - 165
+ - 15
+ - 76
+ selector:
+ object:
+ font_select:
+ name: "Font"
+ description: "Select the font for the displayed text. Refer to the HASP Font Reference above."
+ default: "8 - Noto Sans 64"
+ selector:
+ select:
+ options:
+ - "0 - Consolas 24"
+ - "1 - Consolas 32"
+ - "2 - Consolas 48"
+ - "3 - Consolas 80"
+ - "4 - Webdings 56"
+ - "5 - Noto Sans 24"
+ - "6 - Noto Sans 32"
+ - "7 - Noto Sans 48"
+ - "8 - Noto Sans 64"
+ - "9 - Noto Sans 80"
+ - "10 - Noto Sans Bold 80"
+ xcen_select:
+ name: "Text horizontal alignment"
+ description: "Horizontal text alignment: 0=Left 1=Center 2=Right"
+ default: "1 - Centered"
+ selector:
+ select:
+ options:
+ - "0 - Left aligned"
+ - "1 - Centered"
+ - "2 - Right aligned"
+ ycen_select:
+ name: "Text vertical alignment"
+ description: "Vertical text alignment: 0=Top 1=Center 2=Bottom"
+ default: "1 - Centered"
+ selector:
+ select:
+ options:
+ - "0 - Top aligned"
+ - "1 - Centered"
+ - "2 - Bottom aligned"
+ wrap:
+ name: "Text wrap"
+ description: "Enable line-wrapping text if too long to fit in the button."
+ default: false
+ selector:
+ boolean:
+ text_enable:
+ name: "Text enabled"
+ description: "Enable text and styling on selected button. Disable this if using some other blueprint to label this button."
+ default: true
+ selector:
+ boolean:
+ icon_on:
+ name: '"On" state icon'
+ description: 'Enter the icon to be shown when the selected entity is "on"'
+ default: ""
+ selector:
+ text:
+ icon_off:
+ name: '"Off" state icon'
+ description: 'Enter the icon to be shown when the selected entity is "off"'
+ default: ""
+ selector:
+ text:
+ selected_fgcolor:
+ name: "Button selected foreground color"
+ description: 'Selected foreground color in Nextion RGB565 format for the control and return buttons (see "Nextion color codes" above for reference). -1 = Current theme selected foreground color.'
+ default: -1
+ selector:
+ number:
+ min: -1
+ max: 65535
+ mode: slider
+ selected_bgcolor:
+ name: "Button selected background color"
+ description: 'Selected background color in Nextion RGB565 format for the control and return buttons (see "Nextion color codes" above for reference). -1 = Current theme selected background color.'
+ default: -1
+ selector:
+ number:
+ min: -1
+ max: 65535
+ mode: slider
+ unselected_fgcolor:
+ name: "Button unselected foreground color"
+ description: 'Unselected foreground color in Nextion RGB565 format for the control and return buttons (see "Nextion color codes" above for reference). -1 = Current theme unselected foreground color.'
+ default: -1
+ selector:
+ number:
+ min: -1
+ max: 65535
+ mode: slider
+ unselected_bgcolor:
+ name: "Button unselected background color"
+ description: 'Unselected background color in Nextion RGB565 format for the control and return buttons (see "Nextion color codes" above for reference). -1 = Current theme unselected background color.'
+ default: -1
+ selector:
+ number:
+ min: -1
+ max: 65535
+ mode: slider
+ discoveryprefix:
+ name: "Home Assistant MQTT discovery prefix"
+ description: 'In nearly all cases this should be "homeassistant"'
+ default: "homeassistant"
+ selector:
+ text:
+
+mode: parallel
+max_exceeded: silent
+
+variables:
+ haspdevice: !input haspdevice
+ hasppage: !input hasppage
+ haspbutton: !input haspbutton
+ text: !input text
+ font_select: !input font_select
+ font: '{{ font_select.split(" - ")[0] | int }}'
+ xcen_select: !input xcen_select
+ xcen: '{{ xcen_select.split(" - ")[0] | int }}'
+ ycen_select: !input ycen_select
+ ycen: '{{ ycen_select.split(" - ")[0] | int }}'
+ wrap: !input wrap
+ isbr: "{% if wrap == true %}1{% else %}0{% endif %}"
+ text_enable: !input text_enable
+ colorlight: !input colorlight
+ colors: !input colors
+ icon_on: !input icon_on
+ icon_off: !input icon_off
+ icon: '{% if states(colorlight) == "on" %}{{icon_on}}{% else %}{{icon_off}}{% endif %}'
+ selected_fgcolor: !input selected_fgcolor
+ selected_bgcolor: !input selected_bgcolor
+ unselected_fgcolor: !input unselected_fgcolor
+ unselected_bgcolor: !input unselected_bgcolor
+ discoveryprefix: !input discoveryprefix
+ haspname: >-
+ {%- for entity in device_entities(haspdevice) -%}
+ {%- if entity|regex_search("^sensor\..+_sensor(?:_\d+|)$") -%}
+ {{- entity|regex_replace(find="^sensor\.", replace="", ignorecase=true)|regex_replace(find="_sensor(?:_\d+|)$", replace="", ignorecase=true) -}}
+ {%- endif -%}
+ {%- endfor -%}
+ haspobject: '{{ "p[" ~ hasppage ~ "].b[" ~ haspbutton ~ "]" }}'
+ commandtopic: '{{ "hasp/" ~ haspname ~ "/command/" ~ haspobject }}'
+ jsontopic: '{{ "hasp/" ~ haspname ~ "/state/json" }}'
+ jsoncommandtopic: '{{ "hasp/" ~ haspname ~ "/command/json" }}'
+ activepage: >-
+ {%- set activepage = namespace() -%}
+ {%- for entity in device_entities(haspdevice) -%}
+ {%- if entity|regex_search("^number\..*_active_page(?:_\d+|)$") -%}
+ {%- set activepage.entity=entity -%}
+ {%- endif -%}
+ {%- endfor -%}
+ {{ states(activepage.entity) | int(default=-1) }}
+ haspsensor: >-
+ {%- for entity in device_entities(haspdevice) -%}
+ {%- if entity|regex_search("^sensor\..+_sensor(?:_\d+|)$") -%}
+ {{ entity }}
+ {%- endif -%}
+ {%- endfor -%}
+ haspClientId: '{{state_attr(haspsensor, "haspClientID")}}'
+ haspMac: '{{state_attr(haspsensor, "haspMac")}}'
+ haspManufacturer: '{{state_attr(haspsensor, "haspManufacturer")}}'
+ haspModel: '{{state_attr(haspsensor, "haspModel")}}'
+ sw_version: '{{state_attr(haspsensor, "espVersion")}}'
+ helper: >-
+ {%- for entity in device_entities(haspdevice) -%}
+ {%- if entity|regex_search("^sensor\..+_returnpage_helper(?:_\d+|)$") -%}
+ {{ entity }}
+ {%- endif -%}
+ {%- endfor -%}
+ helperActiveColorLight: '{{state_attr(helper, "activeEntity")}}'
+ helperSourceAutomation: '{{state_attr(helper, "sourceAutomation")}}'
+ selectedfgtopic: '{{ "hasp/" ~ haspname ~ "/light/selectedforegroundcolor/rgb" }}'
+ selectedbgtopic: '{{ "hasp/" ~ haspname ~ "/light/selectedbackgroundcolor/rgb" }}'
+ unselectedfgtopic: '{{ "hasp/" ~ haspname ~ "/light/unselectedforegroundcolor/rgb" }}'
+ unselectedbgtopic: '{{ "hasp/" ~ haspname ~ "/light/unselectedbackgroundcolor/rgb" }}'
+ selectedfg: >-
+ {%- if (selected_fgcolor|int) >= 0 -%}
+ {{ selected_fgcolor }}
+ {%- else -%}
+ {%- set color = namespace() -%}
+ {%- for entity in device_entities(haspdevice) -%}
+ {%- if entity|regex_search("^light\..*_selected_foreground_color(?:_\d+|)$") -%}
+ {%- set color.source=entity -%}
+ {%- endif -%}
+ {%- endfor -%}
+ {%- set brightness = state_attr(color.source, "brightness")|int(default=255) / 255 -%}
+ {%- set red=(state_attr(color.source, "rgb_color")[0] * brightness)|int(default=0) -%}
+ {%- set green=(state_attr(color.source, "rgb_color")[1] * brightness)|int(default=0) -%}
+ {%- set blue=(state_attr(color.source, "rgb_color")[2] * brightness)|int(default=0) -%}
+ {{ (red|bitwise_and(248)*256) + (green|bitwise_and(252)*8) + (blue|bitwise_and(248)/8)|int }}
+ {%- endif -%}
+ selectedbg: >-
+ {%- if (selected_bgcolor|int) >= 0 -%}
+ {{ selected_bgcolor }}
+ {%- else -%}
+ {%- set color = namespace() -%}
+ {%- for entity in device_entities(haspdevice) -%}
+ {%- if entity|regex_search("^light\..*_selected_background_color(?:_\d+|)$") -%}
+ {%- set color.source=entity -%}
+ {%- endif -%}
+ {%- endfor -%}
+ {%- set brightness = state_attr(color.source, "brightness")|int(default=255) / 255 -%}
+ {%- set red=(state_attr(color.source, "rgb_color")[0] * brightness)|int(default=0) -%}
+ {%- set green=(state_attr(color.source, "rgb_color")[1] * brightness)|int(default=0) -%}
+ {%- set blue=(state_attr(color.source, "rgb_color")[2] * brightness)|int(default=0) -%}
+ {{ (red|bitwise_and(248)*256) + (green|bitwise_and(252)*8) + (blue|bitwise_and(248)/8)|int }}
+ {%- endif -%}
+ unselectedfg: >-
+ {%- if (unselected_fgcolor|int) >= 0 -%}
+ {{ unselected_fgcolor }}
+ {%- else -%}
+ {%- set color = namespace() -%}
+ {%- for entity in device_entities(haspdevice) -%}
+ {%- if entity|regex_search("^light\..*_unselected_foreground_color(?:_\d+|)$") -%}
+ {%- set color.source=entity -%}
+ {%- endif -%}
+ {%- endfor -%}
+ {%- set brightness = state_attr(color.source, "brightness")|int(default=255) / 255 -%}
+ {%- set red=(state_attr(color.source, "rgb_color")[0] * brightness)|int(default=0) -%}
+ {%- set green=(state_attr(color.source, "rgb_color")[1] * brightness)|int(default=0) -%}
+ {%- set blue=(state_attr(color.source, "rgb_color")[2] * brightness)|int(default=0) -%}
+ {{ (red|bitwise_and(248)*256) + (green|bitwise_and(252)*8) + (blue|bitwise_and(248)/8)|int }}
+ {%- endif -%}
+ unselectedbg: >-
+ {%- if (unselected_bgcolor|int) >= 0 -%}
+ {{ unselected_bgcolor }}
+ {%- else -%}
+ {%- set color = namespace() -%}
+ {%- for entity in device_entities(haspdevice) -%}
+ {%- if entity|regex_search("^light\..*_unselected_background_color(?:_\d+|)$") -%}
+ {%- set color.source=entity -%}
+ {%- endif -%}
+ {%- endfor -%}
+ {%- set brightness = state_attr(color.source, "brightness")|int(default=255) / 255 -%}
+ {%- set red=(state_attr(color.source, "rgb_color")[0] * brightness)|int(default=0) -%}
+ {%- set green=(state_attr(color.source, "rgb_color")[1] * brightness)|int(default=0) -%}
+ {%- set blue=(state_attr(color.source, "rgb_color")[2] * brightness)|int(default=0) -%}
+ {{ (red|bitwise_and(248)*256) + (green|bitwise_and(252)*8) + (blue|bitwise_and(248)/8)|int }}
+ {%- endif -%}
+ brightness: '{% if state_attr(colorlight,"brightness") is none %}0{% else %}{{state_attr(colorlight,"brightness")}}{% endif %}'
+
+trigger_variables:
+ haspdevice: !input haspdevice
+ haspname: >-
+ {%- for entity in device_entities(haspdevice) -%}
+ {%- if entity|regex_search("^sensor\..+_sensor(?:_\d+|)$") -%}
+ {{- entity|regex_replace(find="^sensor\.", replace="", ignorecase=true)|regex_replace(find="_sensor(?:_\d+|)$", replace="", ignorecase=true) -}}
+ {%- endif -%}
+ {%- endfor -%}
+ haspsensor: >-
+ {%- for entity in device_entities(haspdevice) -%}
+ {%- if entity|regex_search("^sensor\..+_sensor(?:_\d+|)$") -%}
+ {{ entity }}
+ {%- endif -%}
+ {%- endfor -%}
+ jsontopic: '{{ "hasp/" ~ haspname ~ "/state/json" }}'
+ selectedfgtopic: '{{ "hasp/" ~ haspname ~ "/light/selectedforegroundcolor/rgb" }}'
+ selectedbgtopic: '{{ "hasp/" ~ haspname ~ "/light/selectedbackgroundcolor/rgb" }}'
+ unselectedfgtopic: '{{ "hasp/" ~ haspname ~ "/light/unselectedforegroundcolor/rgb" }}'
+ unselectedbgtopic: '{{ "hasp/" ~ haspname ~ "/light/unselectedbackgroundcolor/rgb" }}'
+
+trigger:
+ - platform: homeassistant
+ event: start
+ - platform: template
+ value_template: "{{ is_state(haspsensor, 'ON') }}"
+ - platform: mqtt
+ topic: "{{jsontopic}}"
+ - platform: mqtt
+ topic: "{{selectedfgtopic}}"
+ - platform: mqtt
+ topic: "{{selectedbgtopic}}"
+ - platform: mqtt
+ topic: "{{unselectedfgtopic}}"
+ - platform: mqtt
+ topic: "{{unselectedbgtopic}}"
+ - platform: state
+ entity_id: !input colorlight
+
+condition:
+ - condition: template
+ value_template: "{{ is_state(haspsensor, 'ON') }}"
+
+action:
+ - choose:
+ #########################################################################
+ # RUN ACTIONS or Home Assistant Startup or HASP Connect
+ - conditions:
+ - condition: template
+ value_template: >-
+ {{
+ (trigger is not defined)
+ or
+ (trigger.platform is none)
+ or
+ ((trigger.platform == 'homeassistant') and (trigger.event == 'start'))
+ or
+ ((trigger.platform == 'template') and (trigger.entity_id == haspsensor) and (trigger.to_state.state == 'ON'))
+ }}
+ sequence:
+ # Create returnpage helper
+ - service: mqtt.publish
+ data:
+ topic: "{{discoveryprefix}}/sensor/{{haspname}}/returnpage/config"
+ payload: >-
+ {"name":"{{haspname}} returnpage helper",
+ "json_attributes_topic":"hasp/{{haspname}}/returnpage/command",
+ "state_topic":"hasp/{{haspname}}/status",
+ "availability":{"topic":"hasp/{{haspname}}/alwayson","payload_available":"ON"},
+ "retain":true,
+ "optimistic":true,
+ "min":1,
+ "max":10,
+ "icon":"mdi:palette",
+ "unique_id":"{{haspClientId}}-returnpage",
+ "device":{
+ "identifiers":["{{haspClientId}}"],
+ "name":"{{haspname}}",
+ "manufacturer":"{{haspManufacturer}}",
+ "model":"{{haspModel}}",
+ "sw_version":{{sw_version}}
+ }}
+ retain: true
+ # Make sure returnpage is available
+ - service: mqtt.publish
+ data:
+ topic: "hasp/{{haspname}}/alwayson"
+ payload: "ON"
+ retain: true
+ - choose:
+ #########################################################################
+ # Display text and apply text style on source button
+ - conditions:
+ - condition: template
+ value_template: "{{ text_enable }}"
+ sequence:
+ - service: mqtt.publish
+ data:
+ topic: "{{jsoncommandtopic}}"
+ payload: >-
+ [
+ "{{haspobject}}.font={{font}}",
+ "{{haspobject}}.xcen={{xcen}}",
+ "{{haspobject}}.ycen={{ycen}}",
+ "{{haspobject}}.isbr={{isbr}}",
+ "{{haspobject}}.pco={{selectedfg}}",
+ "{{haspobject}}.bco={{selectedbg}}",
+ "{{haspobject}}.pco2={{unselectedfg}}",
+ "{{haspobject}}.bco2={{unselectedbg}}",
+ "{{haspobject}}.txt=\"{{text}}\""
+ ]
+ #########################################################################
+ # Colorlight brightness has changed
+ - conditions:
+ - condition: template
+ value_template: >-
+ {{
+ (trigger.platform == 'state')
+ and
+ (trigger.entity_id == colorlight)
+ and
+ (trigger.from_state.attributes.brightness is defined)
+ and
+ (trigger.to_state.attributes.brightness is defined)
+ and
+ (trigger.from_state.attributes.brightness != trigger.to_state.attributes.brightness)
+ and
+ (activepage == 11)
+ and
+ (helperSourceAutomation == this.entity_id)
+ }}
+ sequence:
+ # Update slider
+ - service: mqtt.publish
+ data:
+ topic: "{{jsoncommandtopic}}"
+ payload: '["p[11].b[5].val={{state_attr(colorlight,"brightness")}}"]'
+ #########################################################################
+ # Colorlight state has changed
+ - conditions:
+ - condition: template
+ value_template: >-
+ {{
+ (trigger.platform == 'state')
+ and
+ (trigger.entity_id == colorlight)
+ and
+ (trigger.from_state.state is defined)
+ and
+ (trigger.to_state.state is defined)
+ and
+ (trigger.from_state.state != trigger.to_state.state)
+ and
+ (activepage == 11)
+ and
+ (helperSourceAutomation == this.entity_id)
+ }}
+ sequence:
+ # Update button and slider
+ - service: mqtt.publish
+ data:
+ topic: "{{jsoncommandtopic}}"
+ payload: >-
+ [
+ "p[11].b[4].txt=\"{{icon}}\"",
+ {% if is_state(colorlight,'on') %}
+ "p[11].b[4].pco={{selectedfg}}",
+ "p[11].b[4].bco={{selectedbg}}",
+ "p[11].b[4].pco2={{unselectedfg}}",
+ "p[11].b[4].bco2={{unselectedbg}}",
+ {% else %}
+ "p[11].b[4].pco={{unselectedfg}}",
+ "p[11].b[4].bco={{unselectedbg}}",
+ "p[11].b[4].pco2={{selectedfg}}",
+ "p[11].b[4].bco2={{selectedbg}}",
+ {% endif %}
+ "p[11].b[5].val={{brightness}}"
+ ]
+ #########################################################################
+ # Catch MQTT events
+ - conditions:
+ - condition: template
+ value_template: '{{ trigger.platform == "mqtt" }}'
+ sequence:
+ - choose:
+ #########################################################################
+ # Catch incoming JSON messages
+ - conditions:
+ - condition: template
+ value_template: "{{ (trigger.topic == jsontopic) and trigger.payload_json is defined }}"
+ sequence:
+ - choose:
+ #########################################################################
+ # Source button was pressed, record returnpage helper info and change to page 11
+ - conditions:
+ - condition: template
+ value_template: >-
+ {{
+ (trigger.payload_json.event_type == "button_short_release")
+ and
+ (trigger.payload_json.event == haspobject)
+ and
+ (trigger.payload_json.value == "OFF")
+ }}
+ sequence:
+ - service: mqtt.publish
+ data:
+ topic: "{{jsoncommandtopic}}"
+ payload: >-
+ [
+ "p[11].b[4].txt=\"{{icon}}\"",
+ {% if is_state(colorlight,'on') %}
+ "p[11].b[4].pco={{selectedfg}}",
+ "p[11].b[4].bco={{selectedbg}}",
+ "p[11].b[4].pco2={{unselectedfg}}",
+ "p[11].b[4].bco2={{unselectedbg}}",
+ {% else %}
+ "p[11].b[4].pco={{unselectedfg}}",
+ "p[11].b[4].bco={{unselectedbg}}",
+ "p[11].b[4].pco2={{selectedfg}}",
+ "p[11].b[4].bco2={{selectedbg}}",
+ {% endif %}
+ "p[11].b[5].val={{brightness}}",
+ "p[11].b[5].pco={{selectedbg}}",
+ "p[11].b[5].bco={{unselectedbg}}",
+ "p[11].b[5].bco1={{unselectedbg}}",
+ "page 11"
+ ]
+ # push current automation instance and entity to returnpage sensor
+ - service: mqtt.publish
+ data:
+ topic: "hasp/{{haspname}}/returnpage/command"
+ payload: >-
+ {
+ "activeEntity":"{{colorlight}}",
+ "sourceAutomation":"{{this.entity_id}}"
+ }
+ #########################################################################
+ # Page changed to our page, so place the color swatches on the screen.
+ - conditions:
+ - condition: template
+ value_template: >-
+ {{
+ (trigger.payload_json.event == "page")
+ and
+ (trigger.payload_json.value == 11)
+ and
+ (helperSourceAutomation == this.entity_id)
+ }}
+ sequence:
+ - service: mqtt.publish
+ data:
+ topic: "{{jsoncommandtopic}}"
+ payload: >-
+ [
+ "sendxy=1",
+ "fill 0,63,59,51,{{colors['button01']['nextion_color']}}",
+ "fill 60,63,59,51,{{colors['button02']['nextion_color']}}",
+ "fill 120,63,59,51,{{colors['button03']['nextion_color']}}",
+ "fill 180,63,60,51,{{colors['button04']['nextion_color']}}",
+ "fill 0,115,59,51,{{colors['button05']['nextion_color']}}",
+ "fill 60,115,59,51,{{colors['button06']['nextion_color']}}",
+ "fill 120,115,59,51,{{colors['button07']['nextion_color']}}",
+ "fill 180,115,60,51,{{colors['button08']['nextion_color']}}",
+ "fill 0,167,59,51,{{colors['button09']['nextion_color']}}",
+ "fill 60,167,59,51,{{colors['button10']['nextion_color']}}",
+ "fill 120,167,59,51,{{colors['button11']['nextion_color']}}",
+ "fill 180,167,60,51,{{colors['button12']['nextion_color']}}",
+ "fill 0,219,240,51,{{selectedbg}}"
+ ]
+ - service: mqtt.publish
+ data:
+ topic: "{{jsoncommandtopic}}"
+ payload: >-
+ [
+ "xstr 10,215,90,60,8,{{selectedfg}},0,0,0,3,\"\"",
+ "xstr 75,210,230,60,8,{{selectedfg}},0,0,0,3,\"Return\""
+ ]
+ #########################################################################
+ # Page changed to some other page, clean up after ourselves
+ - conditions:
+ - condition: template
+ value_template: >-
+ {{
+ (trigger.payload_json.event == "page")
+ and
+ (trigger.payload_json.value != 11)
+ and
+ (helperSourceAutomation == this.entity_id)
+ }}
+ sequence:
+ - service: mqtt.publish
+ data:
+ topic: "hasp/{{haspname}}/returnpage/command"
+ payload: "{}"
+ #########################################################################
+ # Power button button was pressed, toggle power on colorlight
+ - conditions:
+ - condition: template
+ value_template: >-
+ {{
+ (activepage == 11)
+ and
+ (helperSourceAutomation == this.entity_id)
+ and
+ (trigger.payload_json.event_type == "button_short_release")
+ and
+ (trigger.payload_json.event == "p[11].b[4]")
+ and
+ (trigger.payload_json.value == "OFF")
+ }}
+ sequence:
+ - service: light.toggle
+ target:
+ entity_id: "{{colorlight}}"
+ #########################################################################
+ # Dimmer slider was moved, send brightness value to colorlight
+ - conditions:
+ - condition: template
+ value_template: >-
+ {{
+ (activepage == 11)
+ and
+ (helperSourceAutomation == this.entity_id)
+ and
+ (trigger.payload_json.event == "p[11].b[5].val")
+ and
+ (trigger.payload_json.value is defined)
+ }}
+ sequence:
+ - service: light.turn_on
+ target:
+ entity_id: "{{colorlight}}"
+ data:
+ brightness: "{{trigger.payload_json.value|int(default=0)}}"
+
+ #########################################################################
+ # Return button was pressed, return user to original page and disable touch events
+ - conditions:
+ - condition: template
+ value_template: >-
+ {{
+ (activepage == 11)
+ and
+ (helperSourceAutomation == this.entity_id)
+ and
+ (trigger.payload_json.event_type == "button_short_press")
+ and
+ (trigger.payload_json.event == "touchxy")
+ and
+ (trigger.payload_json.touch_event == "OFF")
+ and
+ (trigger.payload_json.touchy|int(default=-1) >= 219)
+ and
+ (trigger.payload_json.touchy|int(default=-1) <= 270)
+ }}
+ sequence:
+ - service: mqtt.publish
+ data:
+ topic: "{{jsoncommandtopic}}"
+ payload: '["page {{hasppage}}","sendxy=0"]'
+ #########################################################################
+ # button01 was pressed, send color command
+ - conditions:
+ - condition: template
+ value_template: >-
+ {{
+ (activepage == 11)
+ and
+ (helperSourceAutomation == this.entity_id)
+ and
+ (trigger.payload_json.event_type == "button_short_press")
+ and
+ (trigger.payload_json.event == "touchxy")
+ and
+ (trigger.payload_json.touch_event == "ON")
+ and
+ (trigger.payload_json.touchy|int(default=-1) >= 63)
+ and
+ (trigger.payload_json.touchy|int(default=-1) <= 114)
+ and
+ (trigger.payload_json.touchx|int(default=-1) >= 0)
+ and
+ (trigger.payload_json.touchx|int(default=-1) <= 59)
+ }}
+ sequence:
+ - service: light.turn_on
+ target:
+ entity_id: "{{colorlight}}"
+ data: '{ "{{colors["button01"]["color_mode"]}}": {{colors["button01"]["color_value"]}} }'
+ #########################################################################
+ # button02 was pressed, send color command
+ - conditions:
+ - condition: template
+ value_template: >-
+ {{
+ (activepage == 11)
+ and
+ (helperSourceAutomation == this.entity_id)
+ and
+ (trigger.payload_json.event_type == "button_short_press")
+ and
+ (trigger.payload_json.event == "touchxy")
+ and
+ (trigger.payload_json.touch_event == "ON")
+ and
+ (trigger.payload_json.touchy|int(default=-1) >= 63)
+ and
+ (trigger.payload_json.touchy|int(default=-1) <= 114)
+ and
+ (trigger.payload_json.touchx|int(default=-1) >= 60)
+ and
+ (trigger.payload_json.touchx|int(default=-1) <= 119)
+ }}
+ sequence:
+ - service: light.turn_on
+ target:
+ entity_id: "{{colorlight}}"
+ data: '{ "{{colors["button02"]["color_mode"]}}": {{colors["button02"]["color_value"]}} }'
+ #########################################################################
+ # button03 was pressed, send color command
+ - conditions:
+ - condition: template
+ value_template: >-
+ {{
+ (activepage == 11)
+ and
+ (helperSourceAutomation == this.entity_id)
+ and
+ (trigger.payload_json.event_type == "button_short_press")
+ and
+ (trigger.payload_json.event == "touchxy")
+ and
+ (trigger.payload_json.touch_event == "ON")
+ and
+ (trigger.payload_json.touchy|int(default=-1) >= 63)
+ and
+ (trigger.payload_json.touchy|int(default=-1) <= 114)
+ and
+ (trigger.payload_json.touchx|int(default=-1) >= 120)
+ and
+ (trigger.payload_json.touchx|int(default=-1) <= 179)
+ }}
+ sequence:
+ - service: light.turn_on
+ target:
+ entity_id: "{{colorlight}}"
+ data: '{ "{{colors["button03"]["color_mode"]}}": {{colors["button03"]["color_value"]}} }'
+ #########################################################################
+ # button04 was pressed, send color command
+ - conditions:
+ - condition: template
+ value_template: >-
+ {{
+ (activepage == 11)
+ and
+ (helperSourceAutomation == this.entity_id)
+ and
+ (trigger.payload_json.event_type == "button_short_press")
+ and
+ (trigger.payload_json.event == "touchxy")
+ and
+ (trigger.payload_json.touch_event == "ON")
+ and
+ (trigger.payload_json.touchy|int(default=-1) >= 63)
+ and
+ (trigger.payload_json.touchy|int(default=-1) <= 114)
+ and
+ (trigger.payload_json.touchx|int(default=-1) >= 180)
+ and
+ (trigger.payload_json.touchx|int(default=-1) <= 240)
+ }}
+ sequence:
+ - service: light.turn_on
+ target:
+ entity_id: "{{colorlight}}"
+ data: '{ "{{colors["button04"]["color_mode"]}}": {{colors["button04"]["color_value"]}} }'
+ #########################################################################
+ # button05 was pressed, send color command
+ - conditions:
+ - condition: template
+ value_template: >-
+ {{
+ (activepage == 11)
+ and
+ (helperSourceAutomation == this.entity_id)
+ and
+ (trigger.payload_json.event_type == "button_short_press")
+ and
+ (trigger.payload_json.event == "touchxy")
+ and
+ (trigger.payload_json.touch_event == "ON")
+ and
+ (trigger.payload_json.touchy|int(default=-1) >= 115)
+ and
+ (trigger.payload_json.touchy|int(default=-1) <= 166)
+ and
+ (trigger.payload_json.touchx|int(default=-1) >= 0)
+ and
+ (trigger.payload_json.touchx|int(default=-1) <= 59)
+ }}
+ sequence:
+ - service: light.turn_on
+ target:
+ entity_id: "{{colorlight}}"
+ data: '{ "{{colors["button05"]["color_mode"]}}": {{colors["button05"]["color_value"]}} }'
+ #########################################################################
+ # button06 was pressed, send color command
+ - conditions:
+ - condition: template
+ value_template: >-
+ {{
+ (activepage == 11)
+ and
+ (helperSourceAutomation == this.entity_id)
+ and
+ (trigger.payload_json.event_type == "button_short_press")
+ and
+ (trigger.payload_json.event == "touchxy")
+ and
+ (trigger.payload_json.touch_event == "ON")
+ and
+ (trigger.payload_json.touchy|int(default=-1) >= 115)
+ and
+ (trigger.payload_json.touchy|int(default=-1) <= 166)
+ and
+ (trigger.payload_json.touchx|int(default=-1) >= 60)
+ and
+ (trigger.payload_json.touchx|int(default=-1) <= 119)
+ }}
+ sequence:
+ - service: light.turn_on
+ target:
+ entity_id: "{{colorlight}}"
+ data: '{ "{{colors["button06"]["color_mode"]}}": {{colors["button06"]["color_value"]}} }'
+ #########################################################################
+ # button07 was pressed, send color command
+ - conditions:
+ - condition: template
+ value_template: >-
+ {{
+ (activepage == 11)
+ and
+ (helperSourceAutomation == this.entity_id)
+ and
+ (trigger.payload_json.event_type == "button_short_press")
+ and
+ (trigger.payload_json.event == "touchxy")
+ and
+ (trigger.payload_json.touch_event == "ON")
+ and
+ (trigger.payload_json.touchy|int(default=-1) >= 115)
+ and
+ (trigger.payload_json.touchy|int(default=-1) <= 166)
+ and
+ (trigger.payload_json.touchx|int(default=-1) >= 120)
+ and
+ (trigger.payload_json.touchx|int(default=-1) <= 179)
+ }}
+ sequence:
+ - service: light.turn_on
+ target:
+ entity_id: "{{colorlight}}"
+ data: '{ "{{colors["button07"]["color_mode"]}}": {{colors["button07"]["color_value"]}} }'
+ #########################################################################
+ # button08 was pressed, send color command
+ - conditions:
+ - condition: template
+ value_template: >-
+ {{
+ (activepage == 11)
+ and
+ (helperSourceAutomation == this.entity_id)
+ and
+ (trigger.payload_json.event_type == "button_short_press")
+ and
+ (trigger.payload_json.event == "touchxy")
+ and
+ (trigger.payload_json.touch_event == "ON")
+ and
+ (trigger.payload_json.touchy|int(default=-1) >= 115)
+ and
+ (trigger.payload_json.touchy|int(default=-1) <= 166)
+ and
+ (trigger.payload_json.touchx|int(default=-1) >= 180)
+ and
+ (trigger.payload_json.touchx|int(default=-1) <= 240)
+ }}
+ sequence:
+ - service: light.turn_on
+ target:
+ entity_id: "{{colorlight}}"
+ data: '{ "{{colors["button08"]["color_mode"]}}": {{colors["button08"]["color_value"]}} }'
+ #########################################################################
+ # button09 was pressed, send color command
+ - conditions:
+ - condition: template
+ value_template: >-
+ {{
+ (activepage == 11)
+ and
+ (helperSourceAutomation == this.entity_id)
+ and
+ (trigger.payload_json.event_type == "button_short_press")
+ and
+ (trigger.payload_json.event == "touchxy")
+ and
+ (trigger.payload_json.touch_event == "ON")
+ and
+ (trigger.payload_json.touchy|int(default=-1) >= 167)
+ and
+ (trigger.payload_json.touchy|int(default=-1) <= 218)
+ and
+ (trigger.payload_json.touchx|int(default=-1) >= 0)
+ and
+ (trigger.payload_json.touchx|int(default=-1) <= 59)
+ }}
+ sequence:
+ - service: light.turn_on
+ target:
+ entity_id: "{{colorlight}}"
+ data: '{ "{{colors["button09"]["color_mode"]}}": {{colors["button09"]["color_value"]}} }'
+ #########################################################################
+ # button10 was pressed, send color command
+ - conditions:
+ - condition: template
+ value_template: >-
+ {{
+ (activepage == 11)
+ and
+ (helperSourceAutomation == this.entity_id)
+ and
+ (trigger.payload_json.event_type == "button_short_press")
+ and
+ (trigger.payload_json.event == "touchxy")
+ and
+ (trigger.payload_json.touch_event == "ON")
+ and
+ (trigger.payload_json.touchy|int(default=-1) >= 167)
+ and
+ (trigger.payload_json.touchy|int(default=-1) <= 218)
+ and
+ (trigger.payload_json.touchx|int(default=-1) >= 60)
+ and
+ (trigger.payload_json.touchx|int(default=-1) <= 119)
+ }}
+ sequence:
+ - service: light.turn_on
+ target:
+ entity_id: "{{colorlight}}"
+ data: '{ "{{colors["button10"]["color_mode"]}}": {{colors["button10"]["color_value"]}} }'
+ #########################################################################
+ # button11 was pressed, send color command
+ - conditions:
+ - condition: template
+ value_template: >-
+ {{
+ (activepage == 11)
+ and
+ (helperSourceAutomation == this.entity_id)
+ and
+ (trigger.payload_json.event_type == "button_short_press")
+ and
+ (trigger.payload_json.event == "touchxy")
+ and
+ (trigger.payload_json.touch_event == "ON")
+ and
+ (trigger.payload_json.touchy|int(default=-1) >= 167)
+ and
+ (trigger.payload_json.touchy|int(default=-1) <= 218)
+ and
+ (trigger.payload_json.touchx|int(default=-1) >= 120)
+ and
+ (trigger.payload_json.touchx|int(default=-1) <= 179)
+ }}
+ sequence:
+ - service: light.turn_on
+ target:
+ entity_id: "{{colorlight}}"
+ data: '{ "{{colors["button11"]["color_mode"]}}": {{colors["button11"]["color_value"]}} }'
+ #########################################################################
+ # button12 was pressed, send color command
+ - conditions:
+ - condition: template
+ value_template: >-
+ {{
+ (activepage == 11)
+ and
+ (helperSourceAutomation == this.entity_id)
+ and
+ (trigger.payload_json.event_type == "button_short_press")
+ and
+ (trigger.payload_json.event == "touchxy")
+ and
+ (trigger.payload_json.touch_event == "ON")
+ and
+ (trigger.payload_json.touchy|int(default=-1) >= 167)
+ and
+ (trigger.payload_json.touchy|int(default=-1) <= 218)
+ and
+ (trigger.payload_json.touchx|int(default=-1) >= 180)
+ and
+ (trigger.payload_json.touchx|int(default=-1) <= 240)
+ }}
+ sequence:
+ - service: light.turn_on
+ target:
+ entity_id: "{{colorlight}}"
+ data: '{ "{{colors["button12"]["color_mode"]}}": {{colors["button12"]["color_value"]}} }'
+ #########################################################################
+ # Theme: Apply selected foreground color when it changes.
+ # Any change to the button will remove the overlaid icon.
+ - conditions:
+ - condition: template
+ value_template: "{{ trigger.topic == selectedfgtopic }}"
+ sequence:
+ - service: mqtt.publish
+ data:
+ topic: "{{commandtopic}}.pco"
+ payload: "{{trigger.payload}}"
+
+ #########################################################################
+ # Theme: Apply selected background color on change
+ - conditions:
+ - condition: template
+ value_template: "{{ trigger.topic == selectedbgtopic }}"
+ sequence:
+ - service: mqtt.publish
+ data:
+ topic: "{{commandtopic}}.bco"
+ payload: "{{trigger.payload}}"
+
+ #########################################################################
+ # Theme: Apply unselected foreground color on change
+ - conditions:
+ - condition: template
+ value_template: "{{ trigger.topic == unselectedfgtopic }}"
+ sequence:
+ - service: mqtt.publish
+ data:
+ topic: "{{commandtopic}}.pco2"
+ payload: "{{trigger.payload}}"
+ #########################################################################
+ # Theme: Apply unselected background color on change
+ - conditions:
+ - condition: template
+ value_template: "{{ trigger.topic == unselectedbgtopic }}"
+ sequence:
+ - service: mqtt.publish
+ data:
+ topic: "{{commandtopic}}.bco2"
+ payload: "{{trigger.payload}}"
diff --git a/Home_Assistant/blueprints/hasp_Display_Dimmer_with_Icon.yaml b/Home_Assistant/blueprints/hasp_Display_Dimmer_with_Icon.yaml
index 659b6bd..e1401ad 100644
--- a/Home_Assistant/blueprints/hasp_Display_Dimmer_with_Icon.yaml
+++ b/Home_Assistant/blueprints/hasp_Display_Dimmer_with_Icon.yaml
@@ -2,7 +2,7 @@ blueprint:
name: "HASPone p[x].b[y] displays a dimmer with a toggle on/off icon"
description: |
- ## Blueprint Version: `1.05.00`
+ ## Blueprint Version: `1.06.00`
# Description
@@ -144,11 +144,11 @@ variables:
text_on: !input text_on
text_off: !input text_off
font_select: !input font_select
- font: '{{ font_select.split(" - ")[0] | int }}'
+ font: '{{ font_select.split(" - ")[0] | int(default=6) }}'
xcen_select: !input xcen_select
- xcen: '{{ xcen_select.split(" - ")[0] | int }}'
+ xcen: '{{ xcen_select.split(" - ")[0] | int(default=1) }}'
ycen_select: !input ycen_select
- ycen: '{{ ycen_select.split(" - ")[0] | int }}'
+ ycen: '{{ ycen_select.split(" - ")[0] | int(default=1) }}'
wrap: !input wrap
icon_on: !input icon_on
icon_off: !input icon_off
diff --git a/Home_Assistant/blueprints/hasp_Display_Entity_State_or_Attribute.yaml b/Home_Assistant/blueprints/hasp_Display_Entity_State_or_Attribute.yaml
index c8f4848..c962ef5 100644
--- a/Home_Assistant/blueprints/hasp_Display_Entity_State_or_Attribute.yaml
+++ b/Home_Assistant/blueprints/hasp_Display_Entity_State_or_Attribute.yaml
@@ -2,7 +2,7 @@ blueprint:
name: "HASPone p[x].b[y] displays the state or attribute value of an entity"
description: |
- ## Blueprint Version: `1.05.00`
+ ## Blueprint Version: `1.06.00`
# Description
@@ -239,11 +239,11 @@ variables:
prefix: !input prefix
suffix: !input suffix
font_select: !input font_select
- font: '{{ font_select.split(" - ")[0] | int }}'
+ font: '{{ font_select.split(" - ")[0] | int(default=8) }}'
xcen_select: !input xcen_select
- xcen: '{{ xcen_select.split(" - ")[0] | int }}'
+ xcen: '{{ xcen_select.split(" - ")[0] | int(default=1) }}'
ycen_select: !input ycen_select
- ycen: '{{ ycen_select.split(" - ")[0] | int }}'
+ ycen: '{{ ycen_select.split(" - ")[0] | int(default=1) }}'
wrap: !input wrap
title_case: !input title_case
selected_fgcolor: !input selected_fgcolor
@@ -391,7 +391,7 @@ action:
# Display attribute and apply text style
- conditions:
- condition: template
- value_template: >-
+ value_template: >-
{{-
(trigger is not defined)
or
@@ -474,4 +474,3 @@ action:
data:
topic: "{{commandtopic}}.bco2"
payload: "{{trigger.payload}}"
-
diff --git a/Home_Assistant/blueprints/hasp_Display_Template.yaml b/Home_Assistant/blueprints/hasp_Display_Template.yaml
index 6803888..25910c0 100644
--- a/Home_Assistant/blueprints/hasp_Display_Template.yaml
+++ b/Home_Assistant/blueprints/hasp_Display_Template.yaml
@@ -2,7 +2,7 @@ blueprint:
name: "HASPone p[x].b[y] displays the output of a template"
description: |
- ## Blueprint Version: `1.05.00`
+ ## Blueprint Version: `1.06.00`
# Description
@@ -134,7 +134,7 @@ blueprint:
description: "Enter a well-formed [Home Assistant template](https://www.home-assistant.io/docs/configuration/templating/) string. The variable `trigger_entity` will contain the entity name selected above."
default: 'Forecast: {{state_attr("weather.home", "forecast")[0].condition|title}}'
selector:
- text:
+ template:
font_select:
name: "Font"
description: "Select the font for the displayed text. Refer to the HASPone Font Reference above."
@@ -232,11 +232,11 @@ variables:
trigger_entity: !input trigger_entity
text: !input template
font_select: !input font_select
- font: '{{ font_select.split(" - ")[0] | int }}'
+ font: '{{ font_select.split(" - ")[0] | int(default=8) }}'
xcen_select: !input xcen_select
- xcen: '{{ xcen_select.split(" - ")[0] | int }}'
+ xcen: '{{ xcen_select.split(" - ")[0] | int(default=1) }}'
ycen_select: !input ycen_select
- ycen: '{{ ycen_select.split(" - ")[0] | int }}'
+ ycen: '{{ ycen_select.split(" - ")[0] | int(default=1) }}'
wrap: !input wrap
selected_fgcolor: !input selected_fgcolor
selected_bgcolor: !input selected_bgcolor
diff --git a/Home_Assistant/blueprints/hasp_Display_Text.yaml b/Home_Assistant/blueprints/hasp_Display_Text.yaml
index d189e8e..bdf3b40 100644
--- a/Home_Assistant/blueprints/hasp_Display_Text.yaml
+++ b/Home_Assistant/blueprints/hasp_Display_Text.yaml
@@ -2,7 +2,7 @@ blueprint:
name: "HASPone p[x].b[y] displays text"
description: |
- ## Blueprint Version: `1.05.00`
+ ## Blueprint Version: `1.06.00`
## Description
@@ -215,11 +215,11 @@ variables:
haspbutton: !input haspbutton
text: !input text
font_select: !input font_select
- font: '{{ font_select.split(" - ")[0] | int }}'
+ font: '{{ font_select.split(" - ")[0] | int(default=8) }}'
xcen_select: !input xcen_select
- xcen: '{{ xcen_select.split(" - ")[0] | int }}'
+ xcen: '{{ xcen_select.split(" - ")[0] | int(default=1) }}'
ycen_select: !input ycen_select
- ycen: '{{ ycen_select.split(" - ")[0] | int }}'
+ ycen: '{{ ycen_select.split(" - ")[0] | int(default=1) }}'
wrap: !input wrap
selected_fgcolor: !input selected_fgcolor
selected_bgcolor: !input selected_bgcolor
diff --git a/Home_Assistant/blueprints/hasp_Display_Toggle.yaml b/Home_Assistant/blueprints/hasp_Display_Toggle.yaml
index 141b61d..a80f01a 100644
--- a/Home_Assistant/blueprints/hasp_Display_Toggle.yaml
+++ b/Home_Assistant/blueprints/hasp_Display_Toggle.yaml
@@ -2,7 +2,7 @@ blueprint:
name: "HASPone p[x].b[y] displays a toggle button"
description: |
- ## Blueprint Version: `1.05.00`
+ ## Blueprint Version: `1.06.00`
# Description
@@ -294,11 +294,11 @@ variables:
off_fgcolor: !input off_fgcolor
off_bgcolor: !input off_bgcolor
font_select: !input font_select
- font: '{{ font_select.split(" - ")[0] | int }}'
+ font: '{{ font_select.split(" - ")[0] | int(default=8) }}'
xcen_select: !input xcen_select
- xcen: '{{ xcen_select.split(" - ")[0] | int }}'
+ xcen: '{{ xcen_select.split(" - ")[0] | int(default=1) }}'
ycen_select: !input ycen_select
- ycen: '{{ ycen_select.split(" - ")[0] | int }}'
+ ycen: '{{ ycen_select.split(" - ")[0] | int(default=1) }}'
wrap: !input wrap
haspobject: '{{ "p[" ~ hasppage ~ "].b[" ~ haspbutton ~ "]" }}'
commandtopic: '{{ "hasp/" ~ haspname ~ "/command/" ~ haspobject }}'
diff --git a/Home_Assistant/blueprints/hasp_Display_Weather_Condition.yaml b/Home_Assistant/blueprints/hasp_Display_Weather_Condition.yaml
index b2967b8..1c8f5e2 100644
--- a/Home_Assistant/blueprints/hasp_Display_Weather_Condition.yaml
+++ b/Home_Assistant/blueprints/hasp_Display_Weather_Condition.yaml
@@ -2,7 +2,7 @@ blueprint:
name: "HASPone p[x].b[y] displays the current weather condition"
description: |
- ## Blueprint Version: `1.05.00`
+ ## Blueprint Version: `1.06.00`
# Description
@@ -214,11 +214,11 @@ variables:
haspbutton: !input haspbutton
weather_provider: !input weather_provider
font_select: !input font_select
- font: '{{ font_select.split(" - ")[0] | int }}'
+ font: '{{ font_select.split(" - ")[0] | int(default=8) }}'
xcen_select: !input xcen_select
- xcen: '{{ xcen_select.split(" - ")[0] | int }}'
+ xcen: '{{ xcen_select.split(" - ")[0] | int(default=1) }}'
ycen_select: !input ycen_select
- ycen: '{{ ycen_select.split(" - ")[0] | int }}'
+ ycen: '{{ ycen_select.split(" - ")[0] | int(default=1) }}'
wrap: !input wrap
selected_fgcolor: !input selected_fgcolor
selected_bgcolor: !input selected_bgcolor
diff --git a/Home_Assistant/blueprints/hasp_Display_Weather_Condition_Icon_Only.yaml b/Home_Assistant/blueprints/hasp_Display_Weather_Condition_Icon_Only.yaml
index 35f74fc..66b70dd 100644
--- a/Home_Assistant/blueprints/hasp_Display_Weather_Condition_Icon_Only.yaml
+++ b/Home_Assistant/blueprints/hasp_Display_Weather_Condition_Icon_Only.yaml
@@ -2,7 +2,7 @@ blueprint:
name: "HASPone p[x].b[y] displays the current weather condition icon only"
description: |
- ## Blueprint Version: `1.05.00`
+ ## Blueprint Version: `1.06.00`
# Description
@@ -183,11 +183,11 @@ variables:
haspbutton: !input haspbutton
weather_provider: !input weather_provider
font_select: !input font_select
- font: '{{ font_select.split(" - ")[0] | int }}'
+ font: '{{ font_select.split(" - ")[0] | int(default=8) }}'
xcen_select: !input xcen_select
- xcen: '{{ xcen_select.split(" - ")[0] | int }}'
+ xcen: '{{ xcen_select.split(" - ")[0] | int(default=1) }}'
ycen_select: !input ycen_select
- ycen: '{{ ycen_select.split(" - ")[0] | int }}'
+ ycen: '{{ ycen_select.split(" - ")[0] | int(default=1) }}'
selected_fgcolor: !input selected_fgcolor
selected_bgcolor: !input selected_bgcolor
unselected_fgcolor: !input unselected_fgcolor
@@ -346,7 +346,7 @@ variables:
{%- else -%}
{{ selected_fgcolor }}
{%- endif -%}
- {%- endif -%}
+ {%- endif -%}
trigger_variables:
haspdevice: !input haspdevice
@@ -397,7 +397,7 @@ action:
# Apply styles, place text, and then place icon if our target page is currently active
- conditions:
- condition: template
- value_template: >-
+ value_template: >-
{{-
(trigger is not defined)
or
diff --git a/Home_Assistant/blueprints/hasp_Display_Weather_Forecast.yaml b/Home_Assistant/blueprints/hasp_Display_Weather_Forecast.yaml
index 620d45b..c4fa1c9 100644
--- a/Home_Assistant/blueprints/hasp_Display_Weather_Forecast.yaml
+++ b/Home_Assistant/blueprints/hasp_Display_Weather_Forecast.yaml
@@ -2,7 +2,7 @@ blueprint:
name: "HASPone p[x].b[y] displays the weather forecast"
description: |
- ## Blueprint Version: `1.05.00`
+ ## Blueprint Version: `1.06.00`
## Description
@@ -139,7 +139,7 @@ blueprint:
prefix:
name: "Forecast display prefix"
description: 'Prefix for forecast display, maybe something like "tonight: " or "tomorrow: ". Leave blank for no prefix. Use "\\r" for a newline.'
- default:
+ default:
selector:
text:
font_select:
@@ -247,11 +247,11 @@ variables:
forecast_attribute: !input forecast_attribute
prefix: !input prefix
font_select: !input font_select
- font: '{{ font_select.split(" - ")[0] | int }}'
+ font: '{{ font_select.split(" - ")[0] | int(default=8) }}'
xcen_select: !input xcen_select
- xcen: '{{ xcen_select.split(" - ")[0] | int }}'
+ xcen: '{{ xcen_select.split(" - ")[0] | int(default=1) }}'
ycen_select: !input ycen_select
- ycen: '{{ ycen_select.split(" - ")[0] | int }}'
+ ycen: '{{ ycen_select.split(" - ")[0] | int(default=1) }}'
wrap: !input wrap
title_case: !input title_case
selected_fgcolor: !input selected_fgcolor
diff --git a/Home_Assistant/blueprints/hasp_Display_Weather_Temperature_Color_Icon_Only.yaml b/Home_Assistant/blueprints/hasp_Display_Weather_Temperature_Color_Icon_Only.yaml
index 013685e..12aabec 100644
--- a/Home_Assistant/blueprints/hasp_Display_Weather_Temperature_Color_Icon_Only.yaml
+++ b/Home_Assistant/blueprints/hasp_Display_Weather_Temperature_Color_Icon_Only.yaml
@@ -2,7 +2,7 @@ blueprint:
name: "HASPone p[x].b[y] displays the current temperature from a weather provider, coloured icon only"
description: |
- ## Blueprint Version: `1.05.00`
+ ## Blueprint Version: `1.06.00`
# Description
@@ -201,7 +201,7 @@ variables:
jsoncommandtopic: '{{ "hasp/" ~ haspname ~ "/command/json" }}'
temperature: '{{ state_attr(weather_provider, "temperature") }}'
icon: >-
- {%- set temp = temperature|int -%}
+ {%- set temp = temperature|int(default=0) -%}
{%- if temp <= thermometer_quarter_threshold|int -%}
{%- elif temp < thermometer_half_threshold|int -%}
@@ -333,7 +333,7 @@ action:
# Apply styles, place text, and then place icon if our target page is currently active
- conditions:
- condition: template
- value_template: >-
+ value_template: >-
{{-
(trigger is not defined)
or
diff --git a/Home_Assistant/blueprints/hasp_Display_Weather_Temperature_with_Icon_and_Colors.yaml b/Home_Assistant/blueprints/hasp_Display_Weather_Temperature_with_Icon_and_Colors.yaml
index 393f253..65c6500 100644
--- a/Home_Assistant/blueprints/hasp_Display_Weather_Temperature_with_Icon_and_Colors.yaml
+++ b/Home_Assistant/blueprints/hasp_Display_Weather_Temperature_with_Icon_and_Colors.yaml
@@ -2,7 +2,7 @@ blueprint:
name: "HASPone p[x].b[y] displays the current temperature from a weather provider with icon and colors"
description: |
- ## Blueprint Version: `1.05.00`
+ ## Blueprint Version: `1.06.00`
# Description
@@ -224,10 +224,10 @@ variables:
{%- if roundtemp == true -%}
{{- state_attr(weather_provider, "temperature") | round(default=0) -}}
{%- else -%}
- {{- state_attr(weather_provider, "temperature") -}}
+ {{- state_attr(weather_provider, "temperature") | float(default=0) -}}
{%- endif -%}
icon: >-
- {%- set temp = temperature|int -%}
+ {%- set temp = temperature|int(default=0) -%}
{%- if temp <= thermometer_quarter_threshold|int -%}
{%- elif temp < thermometer_half_threshold|int -%}
@@ -310,7 +310,7 @@ variables:
{%- set blue=(state_attr(color.source, "rgb_color")[2] * brightness)|int(default=0) -%}
{{ (red|bitwise_and(248)*256) + (green|bitwise_and(252)*8) + (blue|bitwise_and(248)/8)|int }}
tempcolor: >-
- {%- set temp = temperature|int -%}
+ {%- set temp = temperature|int(default=0) -%}
{%- if temp <= thermometer_quarter_threshold|int -%}
{%- set color = thermometer_empty_color -%}
{%- elif temp < thermometer_half_threshold|int -%}
diff --git a/Home_Assistant/blueprints/hasp_Theme_Light_on_BlueDark.yaml b/Home_Assistant/blueprints/hasp_Theme_Light_on_BlueDark.yaml
index 2bd23b6..9aa6a58 100644
--- a/Home_Assistant/blueprints/hasp_Theme_Light_on_BlueDark.yaml
+++ b/Home_Assistant/blueprints/hasp_Theme_Light_on_BlueDark.yaml
@@ -2,7 +2,7 @@ blueprint:
name: "HASPone Theme Light on Dark Blue"
description: |
- ## Blueprint Version: `1.05.00`
+ ## Blueprint Version: `1.06.00`
## Description
@@ -52,7 +52,7 @@ variables:
{%- endfor -%}
selected_foreground_brightness: "255"
selected_foreground_color: "[255, 255, 255]"
- selected_background_brightness: "1"
+ selected_background_brightness: "32"
selected_background_color: "[0, 0, 255]"
unselected_foreground_brightness: "224"
unselected_foreground_color: "[255, 255, 255]"