From 90c01e1de9a128b2a309379a3fd275cd38edff6c Mon Sep 17 00:00:00 2001 From: LuBeDa Date: Sun, 16 Apr 2023 17:37:45 +0200 Subject: [PATCH] blueprints --- copy2esphome/EHMTX_easy_delete.yaml | 112 +++++++--------------------- copy2esphome/EHMTX_easy_hide.yaml | 23 ++---- copy2esphome/EHMTX_easy_show.yaml | 9 ++- copy2esphome/Ulanzi-simple.yaml | 7 ++ 4 files changed, 48 insertions(+), 103 deletions(-) diff --git a/copy2esphome/EHMTX_easy_delete.yaml b/copy2esphome/EHMTX_easy_delete.yaml index 44f53dc..7320191 100644 --- a/copy2esphome/EHMTX_easy_delete.yaml +++ b/copy2esphome/EHMTX_easy_delete.yaml @@ -9,26 +9,32 @@ blueprint: selector: device: integration: esphome - mode: + trigger_sensor: + name: which state to show + description: This sensor state will be displayed + selector: + entity: + domain: sensor + screen_mode: name: the mode selector: select: custom_value: true mode: dropdown options: - - label: MODE_ICONSCREEN - value: 5 - - label: MODE_BLANK - value: 1 - - label: MODE_CLOCK - value: 2 - - label: MODE_DATE - value: 3 - - label: MODE_FULLSCREEN - value: 4 - - label: MODE_TEXT - value: 6 - default: 5 + - label: MODE_ICONSCREEN + value: 5 + - label: MODE_BLANK + value: 1 + - label: MODE_CLOCK + value: 2 + - label: MODE_DATE + value: 3 + - label: MODE_FULLSCREEN + value: 4 + - label: MODE_TEXT + value: 6 + default: 5 icon_name: name: the icon selector: @@ -50,84 +56,18 @@ blueprint: selector: color_rgb: default: [40, 240, 40] - high_value: - name: upper limit - selector: - number: - mode: box - min: -10000 - max: +10000 - high_color: - name: High Color - description: Text color for values above the defined value - selector: - color_rgb: - default: [240, 40, 40] - default_font: - name: true uses the default, false the specialer font - selector: - boolean: - default: true variables: display: !input ehmtx_device - def_color: !input default_color - lo_color: !input low_color - hi_color: !input high_color trigger: - platform: state entity_id: !input trigger_sensor action: - - choose: - - conditions: - - condition: numeric_state - entity_id: !input trigger_sensor - below: !input low_value - sequence: - - service: esphome.{{ device_attr(display, "name") }}_icon_screen - data: - icon_name: !input icon_name - screen_time: !input screen_time - lifetime: !input lifetime - text: "{{trigger.to_state.state}} {{trigger.to_state.attributes.unit_of_measurement}}" - default_font: !input default_font - r: |- - {{ lo_color[0] }} - g: |- - {{ lo_color[1] }} - b: |- - {{ lo_color[2] }} - - conditions: - - condition: numeric_state - entity_id: !input trigger_sensor - above: !input high_value - sequence: - - service: esphome.{{ device_attr(display, "name") }}_icon_screen - data: - icon_name: !input icon_name - screen_time: !input screen_time - lifetime: !input lifetime - text: "{{trigger.to_state.state}} {{trigger.to_state.attributes.unit_of_measurement}}" - default_font: !input default_font - r: |- - {{ hi_color[0] }} - g: |- - {{ hi_color[1] }} - b: |- - {{ hi_color[2] }} - default: - - service: esphome.{{ device_attr(display, "name") }}_icon_screen - data: - icon_name: !input icon_name - screen_time: !input screen_time - lifetime: !input lifetime - text: "{{trigger.to_state.state}} {{trigger.to_state.attributes.unit_of_measurement}}" - default_font: !input default_font - r: |- - {{ def_color[0] }} - g: |- - {{ def_color[1] }} - b: |- - {{ def_color[2] }} + sequence: + - service: esphome.{{ device_attr(display, "name") }}_del_screen + data: + icon_name: !input icon_name + mode: {{ !input screen_mode }} + \ No newline at end of file diff --git a/copy2esphome/EHMTX_easy_hide.yaml b/copy2esphome/EHMTX_easy_hide.yaml index ff5f882..f1ac393 100644 --- a/copy2esphome/EHMTX_easy_hide.yaml +++ b/copy2esphome/EHMTX_easy_hide.yaml @@ -9,6 +9,12 @@ blueprint: selector: device: integration: esphome + trigger_sensor: + name: which state to show + description: This sensor state will be displayed + selector: + entity: + domain: sensor element: name: the element selector: @@ -22,19 +28,11 @@ blueprint: value: hide_gauge - label: indicator value: hide_indicator - default: hide_indicator - element_color: - name: The color for the element - description: the color - selector: - color_rgb: - default: [240, 40, 40] + default: hide_indicator variables: display: !input ehmtx_device - element_color: !input element_color sercice: !input element - value: !input gauge_value trigger: - platform: state @@ -43,10 +41,3 @@ trigger: action: - service: esphome.{{ device_attr(display, "name") }}_{{service}} data: - value: {{ value }} - r: |- - {{ element_color[0] }} - g: |- - {{ element_color[1] }} - b: |- - {{ element_color[2] }} \ No newline at end of file diff --git a/copy2esphome/EHMTX_easy_show.yaml b/copy2esphome/EHMTX_easy_show.yaml index bb23bba..dd6f07d 100644 --- a/copy2esphome/EHMTX_easy_show.yaml +++ b/copy2esphome/EHMTX_easy_show.yaml @@ -9,6 +9,12 @@ blueprint: selector: device: integration: esphome + trigger_sensor: + name: which state to show + description: This sensor state will be displayed + selector: + entity: + domain: sensor element: name: the element selector: @@ -22,7 +28,7 @@ blueprint: value: show_gauge - label: indicator value: show_indicator - default: show_indicator + default: show_indicator gauge_value: name: the value on the gauge selector: @@ -30,6 +36,7 @@ blueprint: mode: slider min: 0 max: 100 + default: 50 element_color: name: The color for the element description: the color diff --git a/copy2esphome/Ulanzi-simple.yaml b/copy2esphome/Ulanzi-simple.yaml index 7ff2cf5..4fc3cf1 100644 --- a/copy2esphome/Ulanzi-simple.yaml +++ b/copy2esphome/Ulanzi-simple.yaml @@ -35,6 +35,7 @@ esp32: font: - file: EHMTXv2.ttf + size: 16 id: default_font glyphs: | !?"%()+*=,-_.:°0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnÖÄÜöäüopqrstuvwxyz@<>ß§€/ @@ -234,3 +235,9 @@ ehmtx: lameid: 2819 - id: sleep8x32 url: https://user-images.githubusercontent.com/16407309/224850723-634c9b2d-55d9-44f2-9f93-765c0485b090.gif + on_next_screen: + - homeassistant.event: + event: ehmtxv2.new_screen + data_template: + iconname: !lambda "return x.c_str();" + text: !lambda "return y.c_str();"