diff --git a/BETA Version/BETA_blueprint.yaml b/BETA Version/BETA_blueprint.yaml new file mode 100644 index 0000000..1c02a72 --- /dev/null +++ b/BETA Version/BETA_blueprint.yaml @@ -0,0 +1,1457 @@ +blueprint: + name: BETA - NSPanel Button synchronize + description: BETA - Synchronize NSpanel Button with HA Entities and Back! + domain: automation + input: + last_click: + name: NSPanel "last click" + description: 'Select NSPanel **"last click"** where the commands should be monitored' + selector: + entity: {} + last_click_coversettings: + name: NSPanel "last click coversettings" + description: 'Select NSPanel **"last click coversettings"** where the commands for Page Coversettings should be monitored (same NSPanel as **"last click"**)' + selector: + entity: {} + last_click_lightsettings: + name: NSPanel "last click lightsettings" + description: 'Select NSPanel **"last click lightsettings"** where the commands for Page Lightsettings should be monitored (same NSPanel as **"last click"**)' + selector: + entity: {} + nextion_inited: + name: NSPanel "Nextion Switch - nextion_inited" + description: 'nextion_inited is set up via esphome and shows the state of the Nspanel - NSPanel ready after Reboot (same NSPanel as **"last click"**) Example *"switch.nspanel_buro_nextion_inited"*' + selector: + entity: {} + command_printf: + name: Light Settings Page JUMP + description: 'Service for jump to the light settings (same NSPanel as **"last click"**) Example *"esphome.nspanel_buero_send_command_printf"*' + default: esphome.nspanel_buero_send_command_printf + selector: + text: {} + command_value: + name: Sync Button Funktion + description: 'Service to synchronize HA Entity State (ON/OFF) to NSPanel Button Page(same NSPanel as **"last click"**) Example *"esphome.nspanel_buero_send_command_value"*' + default: esphome.nspanel_buero_send_command_value + selector: + text: {} + command_text_printf: + name: Sync Light Status + description: 'Service to synchronize Eintity States to NSPanel Lightsettings (same NSPanel as **"last click"**) Example *"esphome.nspanel_buero_send_command_text_printf"*' + default: esphome.nspanel_buero_send_command_text_printf + selector: + text: {} + tft_path: + name: Path for Nextion TFT File + description: 'TFT Path where the Nextion TFT File is stored (same NSPanel as **"last click"**) Example *"/config/www/nspanel/buero/nspanel_buero.tft"*' + default: /config/www/nspanel/buero/nspanel_buero.tft + selector: + text: {} + entity01: + name: Button 01 + description: 'Nextion Editor' + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + entity02: + name: Button 02 + description: 'Nextion Editor' + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + + entity03: + name: Button 03 + description: 'Nextion Editor' + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + + +mode: parallel +max: 500 + +######################################### +# +# +############################################################# +##### CLOSE - INPUT ##### +############################################################# +# +## +### +############################################################################################################################################################################################# +### +## +# +############################################################# +##### START - Variables ##### +############################################################# +# +# +######################################### +trigger_variables: + last_click: !input 'last_click' + last_click_lightsettings: !input 'last_click_lightsettings' + last_click_coversettings: !input 'last_click_coversettings' + +variables: + command_value: !input 'command_value' + command_text_printf: !input 'command_text_printf' + command_printf: !input 'command_printf' + tft_path: !input 'tft_path' + nextion_inited: !input 'nextion_inited' + + +##### Buttons ##### + entity01: !input 'entity01' + entity02: !input 'entity02' + entity03: !input 'entity03' + +######################################### +# +# +############################################################# +##### CLOSE - Variables ##### +############################################################# +# +## +### +############################################################################################################################################################################################# +### +## +# +############################################################# +##### START - Trigger ##### +############################################################# +# +# +######################################### + +trigger: +##### Page Button - Trigger ##### + - platform: event + event_type: state_changed + event_data: + entity_id: !input 'last_click' + id: short_press + +##### Button LONG Press for jump to Lightsetting or Coversetting Page - Trigger ##### + - platform: template + value_template: '{{ states(last_click) is match "press" }}' + for: + seconds: 2 + id: long_press + +##### Page Lightsettings - Trigger ##### + - platform: event + event_type: state_changed + event_data: + entity_id: !input 'last_click_lightsettings' + id: light_settings + +##### Page Coversettings - Trigger ##### + - platform: event + event_type: state_changed + event_data: + entity_id: !input 'last_click_coversettings' + id: cover_settings + +#### Weather - Trigger #### + - platform: time_pattern + minutes: '10' + id: weather + - platform: state + entity_id: !input 'nextion_inited' + to: 'on' + id: weather + +##### TFT Upload ##### + - platform: event + event_type: folder_watcher + event_data: + event_type: modified + path: !input 'tft_path' + id: tft_upload + +##### Button01 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity01' + for: + seconds: 1 + id: current_state_entity01 + +##### Button02 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity02' + for: + seconds: 1 + id: current_state_entity02 + +##### Button03 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity03' + for: + seconds: 1 + id: current_state_entity03 + +######################################### +# +# +############################################################# +##### CLOSE - Trigger ##### +############################################################# +# +## +### +############################################################################################################################################################################################# +### +## +# +############################################################# +##### START - Action ##### +############################################################# +# +# +######################################### +action: + - variables: +##### Entity - Page Button - Toggle Entity ##### + entity_short: >- + {%- if states(last_click) == "releasebuttonpage01button01" -%} {{ entity01 }} + {%- elif states(last_click) == "releasebuttonpage01button02" -%} {{ entity02 }} + {%- elif states(last_click) == "releasebuttonpage01button03" -%} {{ entity03 }} + {%- endif -%} + +##### Entity - Page Lightsettings ##### + entity_long: >- + {%- if states(last_click) == "pressbuttonpage01button01" -%} {{ entity01 }} + {%- elif states(last_click) == "pressbuttonpage01button02" -%} {{ entity02 }} + {%- elif states(last_click) == "pressbuttonpage01button03" -%} {{ entity03 }} + {%- endif -%} + +##### Entity - Page Lightsettings - Skip Back ##### + entity_back: >- + {%- if states(last_click) == "pressbuttonpage01button01" -%} {{ "page buttonpage01" }} + {%- elif states(last_click) == "pressbuttonpage01button02" -%} {{ "page buttonpage01" }} + {%- elif states(last_click) == "pressbuttonpage01button03" -%} {{ "page buttonpage01" }} + {%- endif -%} + +##### Page Button - SHORT Press - Toggle ##### + - choose: + - conditions: + - condition: trigger + id: short_press + sequence: + - service: >- + {% if entity_short is match 'light.' %} + light.toggle + {% elif entity_short is match 'switch.' %} + switch.toggle + {% elif entity_short is match 'cover.' %} + cover.toggle + {% elif entity_short is match 'input_boolean.' %} + input_boolean.toggle + {% endif %} + data: + entity_id: '{{ entity_short }}' + +##### Page Lightsettings - JUMP to Page Lightsettings and SYNC Light Settings ##### + - choose: + - conditions: + - condition: trigger + id: long_press + - condition: template + value_template: '{{ entity_long is match "light." }}' + sequence: + - service: !input command_printf + data: + cmd: page lightsettings + - service: !input command_text_printf + data: + component: lightsettings.a03 + message: '{{ (state_attr(entity_long, "brightness") | int * 100 / 254) |round(0) }}' + - service: !input command_text_printf + data: + component: lightsettings.a04 + message: '{{ state_attr(entity_long, "color_temp") |int }}' + +##### Page Lightsettings - SYNC Light Button ON / OFF ##### + - choose: + - conditions: + - condition: trigger + id: long_press + - condition: template + value_template: '{{ states(entity_long) == "on" }}' + sequence: + - service: !input command_value + data: + component: lightsettings.a06 + message: 1 + +##### Page Lightsettings - Brightness Slider ##### + - choose: + - conditions: + - condition: trigger + id: light_settings + - condition: template + value_template: '{{ states(last_click_lightsettings) is match "brightness\d+" }}' + sequence: + - service: light.turn_on + data: + entity_id: '{{ entity_long }}' + brightness_pct: '{{ states(last_click_lightsettings) |replace("brightness","") | int }}' + - service: !input command_text_printf + data: + component: lightsettings.a03 + message: '{{ states(last_click_lightsettings) |replace("brightness","") | int }}' + +##### Page Lightsettings - Color_Temp Slider ##### + - choose: + - conditions: + - condition: trigger + id: light_settings + - condition: template + value_template: '{{ states(last_click_lightsettings) is match "colortemp\d+" }}' + sequence: + - service: light.turn_on + data: + entity_id: '{{ entity_long }}' + color_temp: '{{ states(last_click_lightsettings) |replace("colortemp","") | int }}' + - service: !input command_text_printf + data: + component: lightsettings.a04 + message: '{{ states(last_click_lightsettings) |replace("colortemp","") | int }}' + +##### Page Lightsettings - Color RGB Slider ##### + - choose: + - conditions: + - condition: trigger + id: light_settings + - condition: template + value_template: '{{ states(last_click_lightsettings) is match "\d+,\d+,\d+" }}' + sequence: + - service: light.turn_on + data: + entity_id: '{{ entity_long }}' + rgb_color: '{{ states(last_click_lightsettings).split(",") }}' + +##### Page Lightsettings - Toggle Light ##### + - choose: + - conditions: + - condition: trigger + id: light_settings + - condition: template + value_template: '{{ states(last_click_lightsettings) == "releaselight" }}' + sequence: + - service: light.toggle + data: + entity_id: '{{ entity_long }}' + - delay: + milliseconds: 250 + - service: !input command_text_printf + data: + component: lightsettings.a03 + message: '{{ (state_attr(entity_long, "brightness") | int * 100 / 254) |round(0) }}' + - service: !input command_text_printf + data: + component: lightsettings.a04 + message: '{{ state_attr(entity_long, "color_temp") |int }}' + +##### Page Lightsettings - Close Lightsettings ##### + - choose: + - conditions: + - condition: trigger + id: light_settings + - condition: template + value_template: '{{ states(last_click_lightsettings) == "releaselightsettingsclose" }}' + sequence: + - service: !input command_printf + data: + cmd: '{{ entity_back }}' + +##### Page Coversettings - JUMP to Page Coversettings and SYNC Cover Settings ##### + - choose: + - conditions: + - condition: trigger + id: long_press + - condition: template + value_template: '{{ entity_long is match "cover." }}' + sequence: + - service: !input command_printf + data: + cmd: page coversettings + - service: !input command_text_printf + data: + component: coversettings.a03 + message: '{{ (state_attr(entity_long, "position") | int ) |round(0) }}' + - service: !input command_text_printf + data: + component: coversettings.a04 + message: '{{ (state_attr(entity_long, "battery") | int ) |round(0) }}' + +##### Page Coversettings - SYNC Cover Button ON / OFF ##### + - choose: + - conditions: + - condition: trigger + id: long_press + - condition: template + value_template: '{{ states(entity_long) == "open" }}' + sequence: + - service: !input command_value + data: + component: coversettings.a06 + message: 1 + +##### Page Coversettings - Cover Slider ##### + - choose: + - conditions: + - condition: trigger + id: cover_settings + - condition: template + value_template: '{{ states(last_click_coversettings) is match "coverposition\d+" }}' + sequence: + - service: cover.set_cover_position + data: + entity_id: '{{ entity_long }}' + position: '{{ states(last_click_coversettings) |replace("coverposition","") | int }}' + - service: !input command_text_printf + data: + component: coversettings.a03 + message: '{{ states(last_click_coversettings) |replace("coverposition","") | int }}' + +##### Page Coversettings - Toggle Cover ##### + - choose: + - conditions: + - condition: trigger + id: cover_settings + - condition: template + value_template: '{{ states(last_click_coversettings) == "releasecover" }}' + sequence: + - service: cover.toggle + data: + entity_id: '{{ entity_long }}' + - delay: + milliseconds: 250 + - service: !input command_text_printf + data: + component: coversettings.a03 + message: '{{ (state_attr(entity_long, "position") | int ) |round(0) }}' + +##### Page Coversettings - Close Coversettings ##### + - choose: + - conditions: + - condition: trigger + id: cover_settings + - condition: template + value_template: '{{ states(last_click_coversettings) == "releasecoversettingsclose" }}' + sequence: + - service: !input command_printf + data: + cmd: '{{ entity_back }}' + +##### TFT Upload Automation ##### + - choose: + - conditions: + - condition: trigger + id: tft_upload + sequence: + - delay: + seconds: 2 + - service: esphome.nspanel_buero_upload_tft + data: {} + +######################################### +# +# +############################################################# +##### CLOSE - START - Action ##### +############################################################# +# +## +### +############################################################################################################################################################################################# +### +## +# +############################################################# +##### START - HA Button SYNC ##### +############################################################# +# +# +######################################### + +##### Button01 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity01 +# - "{{ is_state('entity01', 'on' or 'open') }}" + - condition: state + entity_id: !input entity01 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage01.button01 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity01 +# - "{{ is_state('entity01', 'off' or 'closed') }}" + - condition: state + entity_id: !input entity01 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage01.button01 + message: 0 + +##### Button02 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity02 + - condition: state + entity_id: !input entity02 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage01.button02 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity02 + - condition: state + entity_id: !input entity02 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage01.button02 + message: 0 + +##### Button03 ################################################################# +#################### + - choose: + - conditions: + - condition: trigger + id: current_state_entity03 + - condition: state + entity_id: !input entity03 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage01.button03 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity03 + - condition: state + entity_id: !input entity03 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage01.button03 + message: 0 +######################################### +# +# +############################################################# +##### CLOSE - HA Button SYNC ##### +############################################################# +# +## +### +############################################################################################################################################################################################# +### +## +# +############################################################# +##### START - Weather Forcast ##### +############################################################# +# +# +######################################### + - choose: + - conditions: + - condition: trigger + id: weather + sequence: + - service: !input command_text_printf + data: + component: weather01.a02 + message: '{{states("sensor.wochentag")}}' + - service: !input command_text_printf + data: + component: weather01.a04 + message: '{{states("sensor.home_wetter_realfeel_temperature_min_0d") | round(0)}}°' + - service: !input command_text_printf + data: + component: weather01.a05 + message: '{{states("sensor.home_wetter_realfeel_temperature_max_0d") | round(0)}}°' + - service: !input command_text_printf + data: + component: weather01.a06 + message: '{{ state_attr("weather.home_wetter","forecast")[0].precipitation_probability}} + %' + - service: !input command_text_printf + data: + component: weather01.a07 + message: '{{states("sensor.home_wetter_hours_of_sun_0d") | round(0)}} h' + - service: !input command_text_printf + data: + component: weather01.a08 + message: '{{state_attr("sensor.home_wetter_uv_index_0d", "level")}}' + - service: !input command_text_printf + data: + component: weather01.a09 + message: '{{states("sensor.home_wetter_uv_index_0d") | round(0)}}' + - service: !input command_text_printf + data: + component: weather01.a10 + message: '{{states("sensor.home_wetter_thunderstorm_probability_day_0d") | round(0)}} + %' + - service: !input command_text_printf + data: + component: weather01.a11 + message: '{{states("sensor.home_wetter_wind_day_0d") | round(0)}} km/h' + - service: !input command_text_printf + data: + component: weather01.a12 + message: '{{states("sensor.home_wetter_thunderstorm_probability_night_0d") | + round(0)}} %' + - service: !input command_text_printf + data: + component: weather01.a13 + message: '{{states("sensor.home_wetter_wind_night_0d") | round(0)}} km/h' + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[0].condition + == ''sunny''}}' + then: + - service: !input command_printf + data: + cmd: weather01.a03.pic=2 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[0].condition + == ''cloudy''}}' + then: + - service: !input command_printf + data: + cmd: weather01.a03.pic=3 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[0].condition + == ''rainy''}}' + then: + - service: !input command_printf + data: + cmd: weather01.a03.pic=4 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[0].condition + == ''pouring''}}' + then: + - service: !input command_printf + data: + cmd: weather01.a03.pic=5 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[0].condition + == ''snowy''}}' + then: + - service: !input command_printf + data: + cmd: weather01.a03.pic=6 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[0].condition + == ''hail''}}' + then: + - service: !input command_printf + data: + cmd: weather01.a03.pic=7 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[0].condition + == ''snowy-rainy''}}' + then: + - service: !input command_printf + data: + cmd: weather01.a03.pic=7 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[0].condition + == ''fog''}}' + then: + - service: !input command_printf + data: + cmd: weather01.a03.pic=8 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[0].condition + == ''windy''}}' + then: + - service: !input command_printf + data: + cmd: weather01.a03.pic=9 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[0].condition + == ''windy-variant''}}' + then: + - service: !input command_printf + data: + cmd: weather01.a03.pic=9 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[0].condition + == ''lightning''}}' + then: + - service: !input command_printf + data: + cmd: weather01.a03.pic=10 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[0].condition + == ''partlycloudy''}}' + then: + - service: !input command_printf + data: + cmd: weather01.a03.pic=11 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[0].condition + == ''lightning-rainy''}}' + then: + - service: !input command_printf + data: + cmd: weather01.a03.pic=13 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[0].condition + == ''execptional''}}' + then: + - service: !input command_printf + data: + cmd: weather01.a03.pic=13 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[0].condition + == ''clear-night''}}' + then: + - service: !input command_printf + data: + cmd: weather01.a03.pic=15 + - service: !input command_text_printf + data: + component: weather02.a02 + message: '{{states("sensor.wochentag01")}}' + - service: !input command_text_printf + data: + component: weather02.a04 + message: '{{states("sensor.home_wetter_realfeel_temperature_min_1d") | round(0)}}°' + - service: !input command_text_printf + data: + component: weather02.a05 + message: '{{states("sensor.home_wetter_realfeel_temperature_max_1d") | round(0)}}°' + - service: !input command_text_printf + data: + component: weather02.a06 + message: '{{ state_attr("weather.home_wetter","forecast")[1].precipitation_probability}} + %' + - service: !input command_text_printf + data: + component: weather02.a07 + message: '{{states("sensor.home_wetter_hours_of_sun_1d") | round(0)}} h' + - service: !input command_text_printf + data: + component: weather02.a08 + message: '{{state_attr("sensor.home_wetter_uv_index_1d", "level")}}' + - service: !input command_text_printf + data: + component: weather02.a09 + message: '{{states("sensor.home_wetter_uv_index_1d") | round(0)}}' + - service: !input command_text_printf + data: + component: weather02.a10 + message: '{{states("sensor.home_wetter_thunderstorm_probability_day_1d") | round(0)}} + %' + - service: !input command_text_printf + data: + component: weather02.a11 + message: '{{states("sensor.home_wetter_wind_day_1d") | round(0)}} km/h' + - service: !input command_text_printf + data: + component: weather02.a12 + message: '{{states("sensor.home_wetter_thunderstorm_probability_night_1d") | + round(0)}} %' + - service: !input command_text_printf + data: + component: weather02.a13 + message: '{{states("sensor.home_wetter_wind_night_1d") | round(0)}} km/h' + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[1].condition + == ''sunny''}}' + then: + - service: !input command_printf + data: + cmd: weather02.a03.pic=2 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[1].condition + == ''cloudy''}}' + then: + - service: !input command_printf + data: + cmd: weather02.a03.pic=3 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[1].condition + == ''rainy''}}' + then: + - service: !input command_printf + data: + cmd: weather02.a03.pic=4 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[1].condition + == ''pouring''}}' + then: + - service: !input command_printf + data: + cmd: weather02.a03.pic=5 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[1].condition + == ''snowy''}}' + then: + - service: !input command_printf + data: + cmd: weather02.a03.pic=6 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[1].condition + == ''hail''}}' + then: + - service: !input command_printf + data: + cmd: weather02.a03.pic=7 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[1].condition + == ''snowy-rainy''}}' + then: + - service: !input command_printf + data: + cmd: weather02.a03.pic=7 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[1].condition + == ''fog''}}' + then: + - service: !input command_printf + data: + cmd: weather02.a03.pic=8 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[1].condition + == ''windy''}}' + then: + - service: !input command_printf + data: + cmd: weather02.a03.pic=9 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[1].condition + == ''windy-variant''}}' + then: + - service: !input command_printf + data: + cmd: weather02.a03.pic=9 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[1].condition + == ''lightning''}}' + then: + - service: !input command_printf + data: + cmd: weather02.a03.pic=10 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[1].condition + == ''partlycloudy''}}' + then: + - service: !input command_printf + data: + cmd: weather02.a03.pic=11 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[1].condition + == ''lightning-rainy''}}' + then: + - service: !input command_printf + data: + cmd: weather02.a03.pic=13 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[1].condition + == ''execptional''}}' + then: + - service: !input command_printf + data: + cmd: weather02.a03.pic=13 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[1].condition + == ''clear-night''}}' + then: + - service: !input command_printf + data: + cmd: weather02.a03.pic=15 + - service: !input command_text_printf + data: + component: weather03.a02 + message: '{{states("sensor.wochentag02")}}' + - service: !input command_text_printf + data: + component: weather03.a04 + message: '{{states("sensor.home_wetter_realfeel_temperature_min_2d") | round(0)}}°' + - service: !input command_text_printf + data: + component: weather03.a05 + message: '{{states("sensor.home_wetter_realfeel_temperature_max_2d") | round(0)}}°' + - service: !input command_text_printf + data: + component: weather03.a06 + message: '{{ state_attr("weather.home_wetter","forecast")[2].precipitation_probability}} + %' + - service: !input command_text_printf + data: + component: weather03.a07 + message: '{{states("sensor.home_wetter_hours_of_sun_2d") | round(0)}} h' + - service: !input command_text_printf + data: + component: weather03.a08 + message: '{{state_attr("sensor.home_wetter_uv_index_2d", "level")}}' + - service: !input command_text_printf + data: + component: weather03.a09 + message: '{{states("sensor.home_wetter_uv_index_2d") | round(0)}}' + - service: !input command_text_printf + data: + component: weather03.a10 + message: '{{states("sensor.home_wetter_thunderstorm_probability_day_2d") | round(0)}} + %' + - service: !input command_text_printf + data: + component: weather03.a11 + message: '{{states("sensor.home_wetter_wind_day_2d") | round(0)}} km/h' + - service: !input command_text_printf + data: + component: weather03.a12 + message: '{{states("sensor.home_wetter_thunderstorm_probability_night_2d") | + round(0)}} %' + - service: !input command_text_printf + data: + component: weather03.a13 + message: '{{states("sensor.home_wetter_wind_night_2d") | round(0)}} km/h' + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[2].condition + == ''sunny''}}' + then: + - service: !input command_printf + data: + cmd: weather03.a03.pic=2 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[2].condition + == ''cloudy''}}' + then: + - service: !input command_printf + data: + cmd: weather03.a03.pic=3 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[2].condition + == ''rainy''}}' + then: + - service: !input command_printf + data: + cmd: weather03.a03.pic=4 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[2].condition + == ''pouring''}}' + then: + - service: !input command_printf + data: + cmd: weather03.a03.pic=5 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[2].condition + == ''snowy''}}' + then: + - service: !input command_printf + data: + cmd: weather03.a03.pic=6 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[2].condition + == ''hail''}}' + then: + - service: !input command_printf + data: + cmd: weather03.a03.pic=7 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[2].condition + == ''snowy-rainy''}}' + then: + - service: !input command_printf + data: + cmd: weather03.a03.pic=7 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[2].condition + == ''fog''}}' + then: + - service: !input command_printf + data: + cmd: weather03.a03.pic=8 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[2].condition + == ''windy''}}' + then: + - service: !input command_printf + data: + cmd: weather03.a03.pic=9 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[2].condition + == ''windy-variant''}}' + then: + - service: !input command_printf + data: + cmd: weather03.a03.pic=9 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[2].condition + == ''lightning''}}' + then: + - service: !input command_printf + data: + cmd: weather03.a03.pic=10 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[2].condition + == ''partlycloudy''}}' + then: + - service: !input command_printf + data: + cmd: weather03.a03.pic=11 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[2].condition + == ''lightning-rainy''}}' + then: + - service: !input command_printf + data: + cmd: weather03.a03.pic=13 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[2].condition + == ''execptional''}}' + then: + - service: !input command_printf + data: + cmd: weather03.a03.pic=13 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[2].condition + == ''clear-night''}}' + then: + - service: !input command_printf + data: + cmd: weather03.a03.pic=15 + - service: !input command_text_printf + data: + component: weather04.a02 + message: '{{states("sensor.wochentag03")}}' + - service: !input command_text_printf + data: + component: weather04.a04 + message: '{{states("sensor.home_wetter_realfeel_temperature_min_3d") | round(0)}}°' + - service: !input command_text_printf + data: + component: weather04.a05 + message: '{{states("sensor.home_wetter_realfeel_temperature_max_3d") | round(0)}}°' + - service: !input command_text_printf + data: + component: weather04.a06 + message: '{{ state_attr("weather.home_wetter","forecast")[3].precipitation_probability}} + %' + - service: !input command_text_printf + data: + component: weather04.a07 + message: '{{states("sensor.home_wetter_hours_of_sun_3d") | round(0)}} h' + - service: !input command_text_printf + data: + component: weather04.a08 + message: '{{state_attr("sensor.home_wetter_uv_index_3d", "level")}}' + - service: !input command_text_printf + data: + component: weather04.a09 + message: '{{states("sensor.home_wetter_uv_index_3d") | round(0)}}' + - service: !input command_text_printf + data: + component: weather04.a10 + message: '{{states("sensor.home_wetter_thunderstorm_probability_day_3d") | round(0)}} + %' + - service: !input command_text_printf + data: + component: weather04.a11 + message: '{{states("sensor.home_wetter_wind_day_3d") | round(0)}} km/h' + - service: !input command_text_printf + data: + component: weather04.a12 + message: '{{states("sensor.home_wetter_thunderstorm_probability_night_3d") | + round(0)}} %' + - service: !input command_text_printf + data: + component: weather04.a13 + message: '{{states("sensor.home_wetter_wind_night_3d") | round(0)}} km/h' + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[3].condition + == ''sunny''}}' + then: + - service: !input command_printf + data: + md: weather04.a03.pic=2 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[3].condition + == ''cloudy''}}' + then: + - service: !input command_printf + data: + cmd: weather04.a03.pic=3 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[3].condition + == ''rainy''}}' + then: + - service: !input command_printf + data: + cmd: weather04.a03.pic=4 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[3].condition + == ''pouring''}}' + then: + - service: !input command_printf + data: + cmd: weather04.a03.pic=5 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[3].condition + == ''snowy''}}' + then: + - service: !input command_printf + data: + cmd: weather04.a03.pic=6 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[3].condition + == ''hail''}}' + then: + - service: !input command_printf + data: + cmd: weather04.a03.pic=7 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[3].condition + == ''snowy-rainy''}}' + then: + - service: !input command_printf + data: + cmd: weather04.a03.pic=7 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[3].condition + == ''fog''}}' + then: + - service: !input command_printf + data: + cmd: weather04.a03.pic=8 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[3].condition + == ''windy''}}' + then: + - service: !input command_printf + data: + cmd: weather04.a03.pic=9 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[3].condition + == ''windy-variant''}}' + then: + - service: !input command_printf + data: + cmd: weather04.a03.pic=9 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[3].condition + == ''lightning''}}' + then: + - service: !input command_printf + data: + cmd: weather04.a03.pic=10 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[3].condition + == ''partlycloudy''}}' + then: + - service: !input command_printf + data: + cmd: weather04.a03.pic=11 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[3].condition + == ''lightning-rainy''}}' + then: + - service: !input command_printf + data: + cmd: weather04.a03.pic=13 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[3].condition + == ''execptional''}}' + then: + - service: !input command_printf + data: + cmd: weather04.a03.pic=13 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[3].condition + == ''clear-night''}}' + then: + - service: !input command_printf + data: + cmd: weather04.a03.pic=15 + - service: !input command_text_printf + data: + component: weather05.a02 + message: '{{states("sensor.wochentag04")}}' + - service: !input command_text_printf + data: + component: weather05.a04 + message: '{{states("sensor.home_wetter_realfeel_temperature_min_4d") | round(0)}}°' + - service: !input command_text_printf + data: + component: weather05.a05 + message: '{{states("sensor.home_wetter_realfeel_temperature_max_4d") | round(0)}}°' + - service: !input command_text_printf + data: + component: weather05.a06 + message: '{{ state_attr("weather.home_wetter","forecast")[4].precipitation_probability}} + %' + - service: !input command_text_printf + data: + component: weather05.a07 + message: '{{states("sensor.home_wetter_hours_of_sun_4d") | round(0)}} h' + - service: !input command_text_printf + data: + component: weather05.a08 + message: '{{state_attr("sensor.home_wetter_uv_index_4d", "level")}}' + - service: !input command_text_printf + data: + component: weather05.a09 + message: '{{states("sensor.home_wetter_uv_index_4d") | round(0)}}' + - service: !input command_text_printf + data: + component: weather05.a10 + message: '{{states("sensor.home_wetter_thunderstorm_probability_day_4d") | round(0)}} + %' + - service: !input command_text_printf + data: + component: weather05.a11 + message: '{{states("sensor.home_wetter_wind_day_4d") | round(0)}} km/h' + - service: !input command_text_printf + data: + component: weather05.a12 + message: '{{states("sensor.home_wetter_thunderstorm_probability_night_4d") | + round(0)}} %' + - service: !input command_text_printf + data: + component: weather05.a13 + message: '{{states("sensor.home_wetter_wind_night_4d") | round(0)}} km/h' + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[4].condition + == ''sunny''}}' + then: + - service: !input command_printf + data: + cmd: weather05.a03.pic=2 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[4].condition + == ''cloudy''}}' + then: + - service: !input command_printf + data: + cmd: weather05.a03.pic=3 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[4].condition + == ''rainy''}}' + then: + - service: !input command_printf + data: + cmd: weather05.a03.pic=4 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[4].condition + == ''pouring''}}' + then: + - service: !input command_printf + data: + cmd: weather05.a03.pic=5 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[4].condition + == ''snowy''}}' + then: + - service: !input command_printf + data: + cmd: weather05.a03.pic=6 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[4].condition + == ''hail''}}' + then: + - service: !input command_printf + data: + cmd: weather05.a03.pic=7 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[4].condition + == ''snowy-rainy''}}' + then: + - service: !input command_printf + data: + cmd: weather05.a03.pic=7 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[4].condition + == ''fog''}}' + then: + - service: !input command_printf + data: + cmd: weather05.a03.pic=8 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[4].condition + == ''windy''}}' + then: + - service: !input command_printf + data: + cmd: weather05.a03.pic=9 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[4].condition + == ''windy-variant''}}' + then: + - service: !input command_printf + data: + cmd: weather05.a03.pic=9 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[4].condition + == ''lightning''}}' + then: + - service: !input command_printf + data: + cmd: weather05.a03.pic=10 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[4].condition + == ''partlycloudy''}}' + then: + - service: !input command_printf + data: + cmd: weather05.a03.pic=11 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[4].condition + == ''lightning-rainy''}}' + then: + - service: !input command_printf + data: + cmd: weather05.a03.pic=13 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[4].condition + == ''execptional''}}' + then: + - service: !input command_printf + data: + cmd: weather05.a03.pic=13 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[4].condition + == ''clear-night''}}' + then: + - service: !input command_printf + data: + cmd: weather05.a03.pic=15 + + ######################################### +# +# +############################################################# +##### CLOSE - Weather Forcast ##### +############################################################# +# +## +### +############################################################################################################################################################################################# diff --git a/blueprint.yaml b/blueprint.yaml new file mode 100644 index 0000000..c22c96f --- /dev/null +++ b/blueprint.yaml @@ -0,0 +1,3341 @@ +blueprint: + name: NSPanel Configuration + description: Synchronize NSpanel Button with HA Entities and Back! And many other things! + domain: automation + input: + last_click: + name: NSPanel "last click" + description: 'Select NSPanel **"last click"** where the commands should be monitored' + selector: + entity: {} + last_click_coversettings: + name: NSPanel "last click coversettings" + description: 'Select NSPanel **"last click coversettings"** where the commands for Page Coversettings should be monitored (same NSPanel as **"last click"**)' + selector: + entity: {} + last_click_lightsettings: + name: NSPanel "last click lightsettings" + description: 'Select NSPanel **"last click lightsettings"** where the commands for Page Lightsettings should be monitored (same NSPanel as **"last click"**)' + selector: + entity: {} + nextion_inited: + name: NSPanel "Nextion Switch - nextion_inited" + description: 'nextion_inited is set up via esphome and shows the state of the Nspanel - NSPanel ready after Reboot (same NSPanel as **"last click"**) Example *"switch.nspanel_buro_nextion_inited"*' + selector: + entity: {} + command_printf: + name: Light Settings Page JUMP + description: 'Service for jump to the light settings (same NSPanel as **"last click"**) Example *"esphome.nspanel_buero_send_command_printf"*' + default: esphome.nspanel_buero_send_command_printf + selector: + text: {} + command_value: + name: Sync Button Funktion + description: 'Service to synchronize HA Entity State (ON/OFF) to NSPanel Button Page(same NSPanel as **"last click"**) Example *"esphome.nspanel_buero_send_command_value"*' + default: esphome.nspanel_buero_send_command_value + selector: + text: {} + command_text_printf: + name: Sync Light Status + description: 'Service to synchronize Eintity States to NSPanel Lightsettings (same NSPanel as **"last click"**) Example *"esphome.nspanel_buero_send_command_text_printf"*' + default: esphome.nspanel_buero_send_command_text_printf + selector: + text: {} + tft_path: + name: Path for Nextion TFT File + description: 'TFT Path where the Nextion TFT File is stored (same NSPanel as **"last click"**) Example *"/config/www/nspanel/buero/nspanel_buero.tft"*' + default: /config/www/nspanel/buero/nspanel_buero.tft + selector: + text: {} + entity01: + name: Button 01 (Optional) + description: Nextion Editor - *buttonpage01.button01* **(ONLY light | switch | cover | input_boolean)** + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + entity02: + name: Button 02 (Optional) + description: Nextion Editor - *buttonpage01.button02* **(ONLY light | switch | cover | input_boolean)** + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + entity03: + name: Button 03 (Optional) + description: Nextion Editor - *buttonpage01.button03* **(ONLY light | switch | cover | input_boolean)** + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + entity04: + name: Button 04 (Optional) + description: Nextion Editor - *buttonpage01.button04* **(ONLY light | switch | cover | input_boolean)** + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + entity05: + name: Button 05 (Optional) + description: Nextion Editor - *buttonpage01.button05* **(ONLY light | switch | cover | input_boolean)** + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + entity06: + name: Button 06 (Optional) + description: Nextion Editor - *buttonpage01.button06* **(ONLY light | switch | cover | input_boolean)** + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + entity07: + name: Button 07 (Optional) + description: Nextion Editor - *buttonpage01.button07* **(ONLY light | switch | cover | input_boolean)** + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + entity08: + name: Button 08 (Optional) + description: Nextion Editor - *buttonpage01.button08* **(ONLY light | switch | cover | input_boolean)** + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + entity09: + name: Button 09 (Optional) + description: Nextion Editor - *buttonpage02.button01* **(ONLY light | switch | cover | input_boolean)** + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + entity10: + name: Button 10 (Optional) + description: Nextion Editor - *buttonpage02.button02* **(ONLY light | switch | cover | input_boolean)** + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + entity11: + name: Button 11 (Optional) + description: Nextion Editor - *buttonpage02.button03* **(ONLY light | switch | cover | input_boolean)** + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + entity12: + name: Button 12 (Optional) + description: Nextion Editor - *buttonpage02.button04* **(ONLY light | switch | cover | input_boolean)** + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + entity13: + name: Button 13 (Optional) + description: Nextion Editor - *buttonpage01.button05* **(ONLY light | switch | cover | input_boolean)** + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + entity14: + name: Button 14 (Optional) + description: Nextion Editor - *buttonpage02.button06* **(ONLY light | switch | cover | input_boolean)** + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + entity15: + name: Button 15 (Optional) + description: Nextion Editor - *buttonpage02.button07* **(ONLY light | switch | cover | input_boolean)** + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + entity16: + name: Button 16 (Optional) + description: Nextion Editor - *buttonpage02.button08* **(ONLY light | switch | cover | input_boolean)** + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + entity17: + name: Button 17 (Optional) + description: Nextion Editor - *buttonpage03.button01* **(ONLY light | switch | cover | input_boolean)** + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + entity18: + name: Button 18 (Optional) + description: Nextion Editor - *buttonpage03.button02* **(ONLY light | switch | cover | input_boolean)** + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + entity19: + name: Button 19 (Optional) + description: Nextion Editor - *buttonpage03.button03* **(ONLY light | switch | cover | input_boolean)** + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + entity20: + name: Button 20 (Optional) + description: Nextion Editor - *buttonpage03.button04* **(ONLY light | switch | cover | input_boolean)** + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + entity21: + name: Button 21 (Optional) + description: Nextion Editor - *buttonpage03.button05* **(ONLY light | switch | cover | input_boolean)** + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + entity22: + name: Button 22 (Optional) + description: Nextion Editor - *buttonpage03.button06* **(ONLY light | switch | cover | input_boolean)** + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + entity23: + name: Button 23 (Optional) + description: Nextion Editor - *buttonpage03.button07* **(ONLY light | switch | cover | input_boolean)** + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + entity24: + name: Button 24 (Optional) + description: Nextion Editor - *buttonpage03.button08* **(ONLY light | switch | cover | input_boolean)** + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + entity25: + name: Button 25 (Optional) + description: Nextion Editor - *buttonpage04.button01* **(ONLY light | switch | cover | input_boolean)** + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + entity26: + name: Button 26 (Optional) + description: Nextion Editor - *buttonpage04.button02* **(ONLY light | switch | cover | input_boolean)** + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + entity27: + name: Button 27 (Optional) + description: Nextion Editor - *buttonpage04.button03* **(ONLY light | switch | cover | input_boolean)** + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + entity28: + name: Button 28 (Optional) + description: Nextion Editor - *buttonpage04.button04* **(ONLY light | switch | cover | input_boolean)** + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + entity29: + name: Button 29 (Optional) + description: Nextion Editor - *buttonpage04.button05* **(ONLY light | switch | cover | input_boolean)** + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + entity30: + name: Button 30 (Optional) + description: Nextion Editor - *buttonpage04.button06* **(ONLY light | switch | cover | input_boolean)** + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + entity31: + name: Button 31 (Optional) + description: Nextion Editor - *buttonpage04.button07* **(ONLY light | switch | cover | input_boolean)** + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + entity32: + name: Button 32 (Optional) + description: Nextion Editor - *buttonpage04.button08* **(ONLY light | switch | cover | input_boolean)** + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + entity33: + name: Button 33 (Optional) + description: Nextion Editor - *buttonpage05.button01* **(ONLY light | switch | cover | input_boolean)** + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + entity34: + name: Button 34 (Optional) + description: Nextion Editor - *buttonpage05.button02* **(ONLY light | switch | cover | input_boolean)** + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + entity35: + name: Button 35 (Optional) + description: Nextion Editor - *buttonpage05.button03* **(ONLY light | switch | cover | input_boolean)** + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + entity36: + name: Button 36 (Optional) + description: Nextion Editor - *buttonpage05.button04* **(ONLY light | switch | cover | input_boolean)** + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + entity37: + name: Button 37 (Optional) + description: Nextion Editor - *buttonpage05.button05* **(ONLY light | switch | cover | input_boolean)** + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + entity38: + name: Button 38 (Optional) + description: Nextion Editor - *buttonpage05.button06* **(ONLY light | switch | cover | input_boolean)** + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + entity39: + name: Button 39 (Optional) + description: Nextion Editor - *buttonpage05.button07* **(ONLY light | switch | cover | input_boolean)** + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + entity40: + name: Button 40 (Optional) + description: Nextion Editor - *buttonpage05.button08* **(ONLY light | switch | cover | input_boolean)** + default: [] + selector: + entity: + domain: + - light + - switch + - cover + - input_boolean + +mode: parallel +max: 500 + +######################################### +# +# +############################################################# +##### CLOSE - INPUT ##### +############################################################# +# +## +### +############################################################################################################################################################################################# +### +## +# +############################################################# +##### START - Variables ##### +############################################################# +# +# +######################################### +trigger_variables: + last_click: !input 'last_click' + last_click_lightsettings: !input 'last_click_lightsettings' + last_click_coversettings: !input 'last_click_coversettings' + +variables: + command_value: !input 'command_value' + command_text_printf: !input 'command_text_printf' + command_printf: !input 'command_printf' + tft_path: !input 'tft_path' + nextion_inited: !input 'nextion_inited' + +##### Buttons ##### + entity01: !input 'entity01' + entity02: !input 'entity02' + entity03: !input 'entity03' + entity04: !input 'entity04' + entity05: !input 'entity05' + entity06: !input 'entity06' + entity07: !input 'entity07' + entity08: !input 'entity08' + entity09: !input 'entity09' + entity10: !input 'entity10' + entity11: !input 'entity11' + entity12: !input 'entity12' + entity13: !input 'entity13' + entity14: !input 'entity14' + entity15: !input 'entity15' + entity16: !input 'entity16' + entity17: !input 'entity17' + entity18: !input 'entity18' + entity19: !input 'entity19' + entity20: !input 'entity20' + entity21: !input 'entity21' + entity22: !input 'entity22' + entity23: !input 'entity23' + entity24: !input 'entity24' + entity25: !input 'entity25' + entity26: !input 'entity26' + entity27: !input 'entity27' + entity28: !input 'entity28' + entity29: !input 'entity29' + entity30: !input 'entity30' + entity31: !input 'entity31' + entity32: !input 'entity32' + entity33: !input 'entity33' + entity34: !input 'entity34' + entity35: !input 'entity35' + entity36: !input 'entity36' + entity37: !input 'entity37' + entity38: !input 'entity38' + entity39: !input 'entity39' + entity40: !input 'entity40' + +######################################### +# +# +############################################################# +##### CLOSE - Variables ##### +############################################################# +# +## +### +############################################################################################################################################################################################# +### +## +# +############################################################# +##### START - Trigger ##### +############################################################# +# +# +######################################### + +trigger: +##### Page Button - Trigger ##### + - platform: event + event_type: state_changed + event_data: + entity_id: !input 'last_click' + id: short_press + +##### Button LONG Press for jump to Lightsetting or Coversetting Page - Trigger ##### + - platform: template + value_template: '{{ states(last_click) is match "press" }}' + for: + seconds: 2 + id: long_press + +##### Page Lightsettings - Trigger ##### + - platform: event + event_type: state_changed + event_data: + entity_id: !input 'last_click_lightsettings' + id: light_settings + +##### Page Coversettings - Trigger ##### + - platform: event + event_type: state_changed + event_data: + entity_id: !input 'last_click_coversettings' + id: cover_settings + +#### Weather - Trigger #### + - platform: time_pattern + minutes: '10' + id: weather + - platform: state + entity_id: !input 'nextion_inited' + to: 'on' + id: weather + +##### TFT Upload ##### + - platform: event + event_type: folder_watcher + event_data: + event_type: modified + path: !input 'tft_path' + id: tft_upload + +##### Button01 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity01' + for: + seconds: 1 + id: current_state_entity01 + +##### Button02 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity02' + for: + seconds: 1 + id: current_state_entity02 + +##### Button03 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity03' + for: + seconds: 1 + id: current_state_entity03 + +##### Button04 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity04' + for: + seconds: 1 + id: current_state_entity04 + +##### Button05 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity05' + for: + seconds: 1 + id: current_state_entity05 + +##### Button06 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity06' + for: + seconds: 1 + id: current_state_entity06 + +##### Button07 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity07' + for: + seconds: 1 + id: current_state_entity07 + +##### Button08 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity08' + for: + seconds: 1 + id: current_state_entity08 + +##### Button09 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity09' + for: + seconds: 1 + id: current_state_entity09 + +##### Button10 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity10' + for: + seconds: 1 + id: current_state_entity10 + +##### Button11 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity11' + for: + seconds: 1 + id: current_state_entity11 + +##### Button12 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity12' + for: + seconds: 1 + id: current_state_entity12 + +##### Button13 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity13' + for: + seconds: 1 + id: current_state_entity13 + +##### Button14 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity14' + for: + seconds: 1 + id: current_state_entity14 + +##### Button15 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity15' + for: + seconds: 1 + id: current_state_entity15 + +##### Button16 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity16' + for: + seconds: 1 + id: current_state_entity16 + +##### Button17 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity17' + for: + seconds: 1 + id: current_state_entity17 + +##### Button18 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity18' + for: + seconds: 1 + id: current_state_entity18 + +##### Button19 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity19' + for: + seconds: 1 + id: current_state_entity19 + +##### Button20 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity20' + for: + seconds: 1 + id: current_state_entity20 + +##### Button21 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity21' + for: + seconds: 1 + id: current_state_entity21 + +##### Button22 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity22' + for: + seconds: 1 + id: current_state_entity22 + +##### Button23 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity23' + for: + seconds: 1 + id: current_state_entity23 + +##### Button24 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity24' + for: + seconds: 1 + id: current_state_entity24 + +##### Button25 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity25' + for: + seconds: 1 + id: current_state_entity25 + +##### Button26 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity26' + for: + seconds: 1 + id: current_state_entity26 + +##### Button27 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity27' + for: + seconds: 1 + id: current_state_entity27 + +##### Button28 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity28' + for: + seconds: 1 + id: current_state_entity28 + +##### Button29 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity29' + for: + seconds: 1 + id: current_state_entity29 + +##### Button30 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity30' + for: + seconds: 1 + id: current_state_entity30 + +##### Button31 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity31' + for: + seconds: 1 + id: current_state_entity31 + +##### Button32 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity32' + for: + seconds: 1 + id: current_state_entity32 + +##### Button33 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity33' + for: + seconds: 1 + id: current_state_entity33 + +##### Button34 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity34' + for: + seconds: 1 + id: current_state_entity34 + +##### Button35 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity35' + for: + seconds: 1 + id: current_state_entity35 + +##### Button36 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity36' + for: + seconds: 1 + id: current_state_entity36 + +##### Button37 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity37' + for: + seconds: 1 + id: current_state_entity37 + +##### Button38 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity38' + for: + seconds: 1 + id: current_state_entity38 + +##### Button39 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity39' + for: + seconds: 1 + id: current_state_entity39 + +##### Button40 Sync - Trigger ##### + - platform: state + entity_id: !input 'entity40' + for: + seconds: 1 + id: current_state_entity40 + +######################################### +# +# +############################################################# +##### CLOSE - Trigger ##### +############################################################# +# +## +### +############################################################################################################################################################################################# +### +## +# +############################################################# +##### START - Action ##### +############################################################# +# +# +######################################### +action: + - variables: +##### Entity - Page Button - Toggle Entity ##### + entity_short: >- + {%- if states(last_click) == "releasebuttonpage01button01" -%} {{ entity01 }} + {%- elif states(last_click) == "releasebuttonpage01button02" -%} {{ entity02 }} + {%- elif states(last_click) == "releasebuttonpage01button03" -%} {{ entity03 }} + {%- elif states(last_click) == "releasebuttonpage01button04" -%} {{ entity04 }} + {%- elif states(last_click) == "releasebuttonpage01button05" -%} {{ entity05 }} + {%- elif states(last_click) == "releasebuttonpage01button06" -%} {{ entity06 }} + {%- elif states(last_click) == "releasebuttonpage01button07" -%} {{ entity07 }} + {%- elif states(last_click) == "releasebuttonpage01button08" -%} {{ entity08 }} + {%- elif states(last_click) == "releasebuttonpage02button01" -%} {{ entity09 }} + {%- elif states(last_click) == "releasebuttonpage02button02" -%} {{ entity10 }} + {%- elif states(last_click) == "releasebuttonpage02button03" -%} {{ entity11 }} + {%- elif states(last_click) == "releasebuttonpage02button04" -%} {{ entity12 }} + {%- elif states(last_click) == "releasebuttonpage02button05" -%} {{ entity13 }} + {%- elif states(last_click) == "releasebuttonpage02button06" -%} {{ entity14 }} + {%- elif states(last_click) == "releasebuttonpage02button07" -%} {{ entity15 }} + {%- elif states(last_click) == "releasebuttonpage02button08" -%} {{ entity16 }} + {%- elif states(last_click) == "releasebuttonpage03button01" -%} {{ entity17 }} + {%- elif states(last_click) == "releasebuttonpage03button02" -%} {{ entity18 }} + {%- elif states(last_click) == "releasebuttonpage03button03" -%} {{ entity19 }} + {%- elif states(last_click) == "releasebuttonpage03button04" -%} {{ entity20 }} + {%- elif states(last_click) == "releasebuttonpage03button05" -%} {{ entity21 }} + {%- elif states(last_click) == "releasebuttonpage03button06" -%} {{ entity22 }} + {%- elif states(last_click) == "releasebuttonpage03button07" -%} {{ entity23 }} + {%- elif states(last_click) == "releasebuttonpage03button08" -%} {{ entity24 }} + {%- elif states(last_click) == "releasebuttonpage04button01" -%} {{ entity25 }} + {%- elif states(last_click) == "releasebuttonpage04button02" -%} {{ entity26 }} + {%- elif states(last_click) == "releasebuttonpage04button03" -%} {{ entity27 }} + {%- elif states(last_click) == "releasebuttonpage04button04" -%} {{ entity28 }} + {%- elif states(last_click) == "releasebuttonpage04button05" -%} {{ entity29 }} + {%- elif states(last_click) == "releasebuttonpage04button06" -%} {{ entity30 }} + {%- elif states(last_click) == "releasebuttonpage04button07" -%} {{ entity31 }} + {%- elif states(last_click) == "releasebuttonpage04button08" -%} {{ entity32 }} + {%- elif states(last_click) == "releasebuttonpage05button01" -%} {{ entity33 }} + {%- elif states(last_click) == "releasebuttonpage05button02" -%} {{ entity34 }} + {%- elif states(last_click) == "releasebuttonpage05button03" -%} {{ entity35 }} + {%- elif states(last_click) == "releasebuttonpage05button04" -%} {{ entity36 }} + {%- elif states(last_click) == "releasebuttonpage05button05" -%} {{ entity37 }} + {%- elif states(last_click) == "releasebuttonpage05button06" -%} {{ entity38 }} + {%- elif states(last_click) == "releasebuttonpage05button07" -%} {{ entity39 }} + {%- elif states(last_click) == "releasebuttonpage05button08" -%} {{ entity40 }} + {%- endif -%} + +##### Entity - Page Lightsettings ##### + entity_long: >- + {%- if states(last_click) == "pressbuttonpage01button01" -%} {{ entity01 }} + {%- elif states(last_click) == "pressbuttonpage01button02" -%} {{ entity02 }} + {%- elif states(last_click) == "pressbuttonpage01button03" -%} {{ entity03 }} + {%- elif states(last_click) == "pressbuttonpage01button04" -%} {{ entity04 }} + {%- elif states(last_click) == "pressbuttonpage01button05" -%} {{ entity05 }} + {%- elif states(last_click) == "pressbuttonpage01button06" -%} {{ entity06 }} + {%- elif states(last_click) == "pressbuttonpage01button07" -%} {{ entity07 }} + {%- elif states(last_click) == "pressbuttonpage01button08" -%} {{ entity08 }} + {%- elif states(last_click) == "pressbuttonpage02button01" -%} {{ entity09 }} + {%- elif states(last_click) == "pressbuttonpage02button02" -%} {{ entity10 }} + {%- elif states(last_click) == "pressbuttonpage02button03" -%} {{ entity11 }} + {%- elif states(last_click) == "pressbuttonpage02button04" -%} {{ entity12 }} + {%- elif states(last_click) == "pressbuttonpage02button05" -%} {{ entity13 }} + {%- elif states(last_click) == "pressbuttonpage02button06" -%} {{ entity14 }} + {%- elif states(last_click) == "pressbuttonpage02button07" -%} {{ entity15 }} + {%- elif states(last_click) == "pressbuttonpage02button08" -%} {{ entity16 }} + {%- elif states(last_click) == "pressbuttonpage03button01" -%} {{ entity17 }} + {%- elif states(last_click) == "pressbuttonpage03button02" -%} {{ entity18 }} + {%- elif states(last_click) == "pressbuttonpage03button03" -%} {{ entity19 }} + {%- elif states(last_click) == "pressbuttonpage03button04" -%} {{ entity20 }} + {%- elif states(last_click) == "pressbuttonpage03button05" -%} {{ entity21 }} + {%- elif states(last_click) == "pressbuttonpage03button06" -%} {{ entity22 }} + {%- elif states(last_click) == "pressbuttonpage03button07" -%} {{ entity23 }} + {%- elif states(last_click) == "pressbuttonpage03button08" -%} {{ entity24 }} + {%- elif states(last_click) == "pressbuttonpage04button01" -%} {{ entity25 }} + {%- elif states(last_click) == "pressbuttonpage04button02" -%} {{ entity26 }} + {%- elif states(last_click) == "pressbuttonpage04button03" -%} {{ entity27 }} + {%- elif states(last_click) == "pressbuttonpage04button04" -%} {{ entity28 }} + {%- elif states(last_click) == "pressbuttonpage04button05" -%} {{ entity29 }} + {%- elif states(last_click) == "pressbuttonpage04button06" -%} {{ entity30 }} + {%- elif states(last_click) == "pressbuttonpage04button07" -%} {{ entity31 }} + {%- elif states(last_click) == "pressbuttonpage04button08" -%} {{ entity32 }} + {%- elif states(last_click) == "pressbuttonpage05button01" -%} {{ entity33 }} + {%- elif states(last_click) == "pressbuttonpage05button02" -%} {{ entity34 }} + {%- elif states(last_click) == "pressbuttonpage05button03" -%} {{ entity35 }} + {%- elif states(last_click) == "pressbuttonpage05button04" -%} {{ entity36 }} + {%- elif states(last_click) == "pressbuttonpage05button05" -%} {{ entity37 }} + {%- elif states(last_click) == "pressbuttonpage05button06" -%} {{ entity38 }} + {%- elif states(last_click) == "pressbuttonpage05button07" -%} {{ entity39 }} + {%- elif states(last_click) == "pressbuttonpage05button08" -%} {{ entity40 }} + {%- endif -%} + +##### Entity - Page Lightsettings - Skip Back ##### + entity_back: >- + {%- if states(last_click) == "pressbuttonpage01button01" -%} {{ "page buttonpage01" }} + {%- elif states(last_click) == "pressbuttonpage01button02" -%} {{ "page buttonpage01" }} + {%- elif states(last_click) == "pressbuttonpage01button03" -%} {{ "page buttonpage01" }} + {%- elif states(last_click) == "pressbuttonpage01button04" -%} {{ "page buttonpage01" }} + {%- elif states(last_click) == "pressbuttonpage01button05" -%} {{ "page buttonpage01" }} + {%- elif states(last_click) == "pressbuttonpage01button06" -%} {{ "page buttonpage01" }} + {%- elif states(last_click) == "pressbuttonpage01button07" -%} {{ "page buttonpage01" }} + {%- elif states(last_click) == "pressbuttonpage01button08" -%} {{ "page buttonpage01" }} + {%- elif states(last_click) == "pressbuttonpage02button01" -%} {{ "page buttonpage02" }} + {%- elif states(last_click) == "pressbuttonpage02button02" -%} {{ "page buttonpage02" }} + {%- elif states(last_click) == "pressbuttonpage02button03" -%} {{ "page buttonpage02" }} + {%- elif states(last_click) == "pressbuttonpage02button04" -%} {{ "page buttonpage02" }} + {%- elif states(last_click) == "pressbuttonpage02button05" -%} {{ "page buttonpage02" }} + {%- elif states(last_click) == "pressbuttonpage02button06" -%} {{ "page buttonpage02" }} + {%- elif states(last_click) == "pressbuttonpage02button07" -%} {{ "page buttonpage02" }} + {%- elif states(last_click) == "pressbuttonpage02button08" -%} {{ "page buttonpage02" }} + {%- elif states(last_click) == "pressbuttonpage03button01" -%} {{ "page buttonpage03" }} + {%- elif states(last_click) == "pressbuttonpage03button02" -%} {{ "page buttonpage03" }} + {%- elif states(last_click) == "pressbuttonpage03button03" -%} {{ "page buttonpage03" }} + {%- elif states(last_click) == "pressbuttonpage03button04" -%} {{ "page buttonpage03" }} + {%- elif states(last_click) == "pressbuttonpage03button05" -%} {{ "page buttonpage03" }} + {%- elif states(last_click) == "pressbuttonpage03button06" -%} {{ "page buttonpage03" }} + {%- elif states(last_click) == "pressbuttonpage03button07" -%} {{ "page buttonpage03" }} + {%- elif states(last_click) == "pressbuttonpage03button08" -%} {{ "page buttonpage03" }} + {%- elif states(last_click) == "pressbuttonpage04button01" -%} {{ "page buttonpage04" }} + {%- elif states(last_click) == "pressbuttonpage04button02" -%} {{ "page buttonpage04" }} + {%- elif states(last_click) == "pressbuttonpage04button03" -%} {{ "page buttonpage04" }} + {%- elif states(last_click) == "pressbuttonpage04button04" -%} {{ "page buttonpage04" }} + {%- elif states(last_click) == "pressbuttonpage04button05" -%} {{ "page buttonpage04" }} + {%- elif states(last_click) == "pressbuttonpage04button06" -%} {{ "page buttonpage04" }} + {%- elif states(last_click) == "pressbuttonpage04button07" -%} {{ "page buttonpage04" }} + {%- elif states(last_click) == "pressbuttonpage04button08" -%} {{ "page buttonpage04" }} + {%- elif states(last_click) == "pressbuttonpage05button01" -%} {{ "page buttonpage05" }} + {%- elif states(last_click) == "pressbuttonpage05button02" -%} {{ "page buttonpage05" }} + {%- elif states(last_click) == "pressbuttonpage05button03" -%} {{ "page buttonpage05" }} + {%- elif states(last_click) == "pressbuttonpage05button04" -%} {{ "page buttonpage05" }} + {%- elif states(last_click) == "pressbuttonpage05button05" -%} {{ "page buttonpage05" }} + {%- elif states(last_click) == "pressbuttonpage05button06" -%} {{ "page buttonpage05" }} + {%- elif states(last_click) == "pressbuttonpage05button07" -%} {{ "page buttonpage05" }} + {%- elif states(last_click) == "pressbuttonpage05button08" -%} {{ "page buttonpage05" }} + {%- endif -%} + +##### Page Button - SHORT Press - Toggle ##### + - choose: + - conditions: + - condition: trigger + id: short_press + sequence: + - service: >- + {% if entity_short is match 'light.' %} + light.toggle + {% elif entity_short is match 'switch.' %} + switch.toggle + {% elif entity_short is match 'cover.' %} + cover.toggle + {% elif entity_short is match 'input_boolean.' %} + input_boolean.toggle + {% endif %} + data: + entity_id: '{{ entity_short }}' + +##### Page Lightsettings - JUMP to Page Lightsettings and SYNC Light Settings ##### + - choose: + - conditions: + - condition: trigger + id: long_press + - condition: template + value_template: '{{ entity_long is match "light." }}' + sequence: + - service: !input command_printf + data: + cmd: page lightsettings + - service: !input command_text_printf + data: + component: lightsettings.a03 + message: '{{ (state_attr(entity_long, "brightness") | int * 100 / 254) |round(0) }}' + - service: !input command_text_printf + data: + component: lightsettings.a04 + message: '{{ state_attr(entity_long, "color_temp") |int }}' + +##### Page Lightsettings - SYNC Light Button ON / OFF ##### + - choose: + - conditions: + - condition: trigger + id: long_press + - condition: template + value_template: '{{ states(entity_long) == "on" }}' + sequence: + - service: !input command_value + data: + component: lightsettings.a06 + message: 1 + +##### Page Lightsettings - Brightness Slider ##### + - choose: + - conditions: + - condition: trigger + id: light_settings + - condition: template + value_template: '{{ states(last_click_lightsettings) is match "brightness\d+" }}' + sequence: + - service: light.turn_on + data: + entity_id: '{{ entity_long }}' + brightness_pct: '{{ states(last_click_lightsettings) |replace("brightness","") | int }}' + - service: !input command_text_printf + data: + component: lightsettings.a03 + message: '{{ states(last_click_lightsettings) |replace("brightness","") | int }}' + +##### Page Lightsettings - Color_Temp Slider ##### + - choose: + - conditions: + - condition: trigger + id: light_settings + - condition: template + value_template: '{{ states(last_click_lightsettings) is match "colortemp\d+" }}' + sequence: + - service: light.turn_on + data: + entity_id: '{{ entity_long }}' + color_temp: '{{ states(last_click_lightsettings) |replace("colortemp","") | int }}' + - service: !input command_text_printf + data: + component: lightsettings.a04 + message: '{{ states(last_click_lightsettings) |replace("colortemp","") | int }}' + +##### Page Lightsettings - Color RGB Slider ##### + - choose: + - conditions: + - condition: trigger + id: light_settings + - condition: template + value_template: '{{ states(last_click_lightsettings) is match "\d+,\d+,\d+" }}' + sequence: + - service: light.turn_on + data: + entity_id: '{{ entity_long }}' + rgb_color: '{{ states(last_click_lightsettings).split(",") }}' + +##### Page Lightsettings - Toggle Light ##### + - choose: + - conditions: + - condition: trigger + id: light_settings + - condition: template + value_template: '{{ states(last_click_lightsettings) == "releaselight" }}' + sequence: + - service: light.toggle + data: + entity_id: '{{ entity_long }}' + - delay: + milliseconds: 250 + - service: !input command_text_printf + data: + component: lightsettings.a03 + message: '{{ (state_attr(entity_long, "brightness") | int * 100 / 254) |round(0) }}' + - service: !input command_text_printf + data: + component: lightsettings.a04 + message: '{{ state_attr(entity_long, "color_temp") |int }}' + +##### Page Lightsettings - Close Lightsettings ##### + - choose: + - conditions: + - condition: trigger + id: light_settings + - condition: template + value_template: '{{ states(last_click_lightsettings) == "releaselightsettingsclose" }}' + sequence: + - service: !input command_printf + data: + cmd: '{{ entity_back }}' + +##### Page Coversettings - JUMP to Page Coversettings and SYNC Cover Settings ##### + - choose: + - conditions: + - condition: trigger + id: long_press + - condition: template + value_template: '{{ entity_long is match "cover." }}' + sequence: + - service: !input command_printf + data: + cmd: page coversettings + - service: !input command_text_printf + data: + component: coversettings.a03 + message: '{{ (state_attr(entity_long, "position") | int ) |round(0) }}' + - service: !input command_text_printf + data: + component: coversettings.a04 + message: '{{ (state_attr(entity_long, "battery") | int ) |round(0) }}' + +##### Page Coversettings - SYNC Cover Button ON / OFF ##### + - choose: + - conditions: + - condition: trigger + id: long_press + - condition: template + value_template: '{{ states(entity_long) == "open" }}' + sequence: + - service: !input command_value + data: + component: coversettings.a06 + message: 1 + +##### Page Coversettings - Cover Slider ##### + - choose: + - conditions: + - condition: trigger + id: cover_settings + - condition: template + value_template: '{{ states(last_click_coversettings) is match "coverposition\d+" }}' + sequence: + - service: cover.set_cover_position + data: + entity_id: '{{ entity_long }}' + position: '{{ states(last_click_coversettings) |replace("coverposition","") | int }}' + - service: !input command_text_printf + data: + component: coversettings.a03 + message: '{{ states(last_click_coversettings) |replace("coverposition","") | int }}' + +##### Page Coversettings - Toggle Cover ##### + - choose: + - conditions: + - condition: trigger + id: cover_settings + - condition: template + value_template: '{{ states(last_click_coversettings) == "releasecover" }}' + sequence: + - service: cover.toggle + data: + entity_id: '{{ entity_long }}' + - delay: + milliseconds: 250 + - service: !input command_text_printf + data: + component: coversettings.a03 + message: '{{ (state_attr(entity_long, "position") | int ) |round(0) }}' + +##### Page Coversettings - Close Coversettings ##### + - choose: + - conditions: + - condition: trigger + id: cover_settings + - condition: template + value_template: '{{ states(last_click_coversettings) == "releasecoversettingsclose" }}' + sequence: + - service: !input command_printf + data: + cmd: '{{ entity_back }}' + +##### TFT Upload Automation ##### + - choose: + - conditions: + - condition: trigger + id: tft_upload + sequence: + - delay: + seconds: 2 + - service: esphome.nspanel_buero_upload_tft + data: {} + +######################################### +# +# +############################################################# +##### CLOSE - START - Action ##### +############################################################# +# +## +### +############################################################################################################################################################################################# +### +## +# +############################################################# +##### START - HA Button SYNC ##### +############################################################# +# +# +######################################### + +##### Button01 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity01 +# - "{{ is_state('entity01', 'on' or 'open') }}" + - condition: state + entity_id: !input entity01 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage01.button01 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity01 +# - "{{ is_state('entity01', 'off' or 'closed') }}" + - condition: state + entity_id: !input entity01 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage01.button01 + message: 0 + +##### Button02 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity02 + - condition: state + entity_id: !input entity02 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage01.button02 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity02 + - condition: state + entity_id: !input entity02 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage01.button02 + message: 0 + +##### Button03 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity03 + - condition: state + entity_id: !input entity03 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage01.button03 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity03 + - condition: state + entity_id: !input entity03 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage01.button03 + message: 0 + +##### Button04 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity04 + - condition: state + entity_id: !input entity04 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage01.button04 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity04 + - condition: state + entity_id: !input entity04 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage01.button04 + message: 0 + +##### Button05 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity05 + - condition: state + entity_id: !input entity05 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage01.button05 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity05 + - condition: state + entity_id: !input entity05 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage01.button05 + message: 0 + +##### Button06 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity06 + - condition: state + entity_id: !input entity06 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage01.button06 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity06 + - condition: state + entity_id: !input entity06 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage01.button06 + message: 0 + +##### Button07 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity07 + - condition: state + entity_id: !input entity07 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage01.button07 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity07 + - condition: state + entity_id: !input entity07 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage01.button07 + message: 0 + +##### Button08 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity08 + - condition: state + entity_id: !input entity08 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage01.button08 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity08 + - condition: state + entity_id: !input entity08 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage01.button08 + message: 0 + +##### Button09 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity09 + - condition: state + entity_id: !input entity09 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage02.button01 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity09 + - condition: state + entity_id: !input entity09 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage02.button01 + message: 0 + +##### Button10 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity10 + - condition: state + entity_id: !input entity10 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage02.button02 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity10 + - condition: state + entity_id: !input entity10 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage02.button02 + message: 0 + +##### Button11 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity11 + - condition: state + entity_id: !input entity11 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage02.button03 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity11 + - condition: state + entity_id: !input entity11 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage02.button03 + message: 0 + +##### Button12 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity12 + - condition: state + entity_id: !input entity12 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage02.button04 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity12 + - condition: state + entity_id: !input entity12 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage02.button04 + message: 0 + +##### Button13 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity13 + - condition: state + entity_id: !input entity13 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage02.button05 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity13 + - condition: state + entity_id: !input entity13 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage02.button05 + message: 0 + +##### Button14 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity14 + - condition: state + entity_id: !input entity14 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage02.button06 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity14 + - condition: state + entity_id: !input entity14 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage02.button06 + message: 0 + +##### Button15 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity15 + - condition: state + entity_id: !input entity15 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage02.button07 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity16 + - condition: state + entity_id: !input entity16 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage02.button07 + message: 0 + +##### Button16 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity16 + - condition: state + entity_id: !input entity16 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage02.button08 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity16 + - condition: state + entity_id: !input entity16 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage02.button08 + message: 0 + +##### Button17 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity17 + - condition: state + entity_id: !input entity17 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage03.button01 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity17 + - condition: state + entity_id: !input entity17 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage03.button01 + message: 0 + +##### Button18 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity18 + - condition: state + entity_id: !input entity18 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage03.button02 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity18 + - condition: state + entity_id: !input entity18 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage03.button02 + message: 0 + +##### Button19 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity19 + - condition: state + entity_id: !input entity19 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage03.button03 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity19 + - condition: state + entity_id: !input entity19 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage03.button03 + message: 0 + +##### Button20 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity20 + - condition: state + entity_id: !input entity20 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage03.button04 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity20 + - condition: state + entity_id: !input entity20 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage03.button04 + message: 0 + +##### Button21 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity21 + - condition: state + entity_id: !input entity21 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage03.button05 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity21 + - condition: state + entity_id: !input entity21 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage03.button05 + message: 0 + +##### Button22 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity22 + - condition: state + entity_id: !input entity22 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage03.button06 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity22 + - condition: state + entity_id: !input entity22 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage03.button06 + message: 0 + +##### Button23 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity23 + - condition: state + entity_id: !input entity23 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage03.button07 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity23 + - condition: state + entity_id: !input entity23 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage03.button07 + message: 0 + +##### Button24 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity24 + - condition: state + entity_id: !input entity24 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage03.button08 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity24 + - condition: state + entity_id: !input entity24 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage03.button08 + message: 0 + +##### Button25 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity25 + - condition: state + entity_id: !input entity25 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage04.button01 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity25 + - condition: state + entity_id: !input entity25 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage04.button01 + message: 0 + +##### Button26 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity26 + - condition: state + entity_id: !input entity26 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage04.button02 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity26 + - condition: state + entity_id: !input entity26 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage04.button02 + message: 0 + +##### Button27 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity27 + - condition: state + entity_id: !input entity27 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage04.button03 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity27 + - condition: state + entity_id: !input entity27 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage04.button03 + message: 0 + +##### Button28 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity28 + - condition: state + entity_id: !input entity28 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage04.button04 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity28 + - condition: state + entity_id: !input entity28 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage04.button04 + message: 0 + +##### Button29 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity29 + - condition: state + entity_id: !input entity29 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage04.button05 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity29 + - condition: state + entity_id: !input entity29 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage04.button05 + message: 0 + +##### Button30 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity30 + - condition: state + entity_id: !input entity30 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage04.button06 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity30 + - condition: state + entity_id: !input entity30 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage04.button06 + message: 0 + +##### Button31 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity31 + - condition: state + entity_id: !input entity31 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage04.button07 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity31 + - condition: state + entity_id: !input entity31 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage04.button07 + message: 0 + +##### Button32 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity32 + - condition: state + entity_id: !input entity32 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage04.button08 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity32 + - condition: state + entity_id: !input entity32 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage04.button08 + message: 0 + +##### Button33 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity33 + - condition: state + entity_id: !input entity33 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage05.button01 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity33 + - condition: state + entity_id: !input entity33 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage05.button01 + message: 0 + +##### Button34 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity34 + - condition: state + entity_id: !input entity34 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage05.button02 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity34 + - condition: state + entity_id: !input entity34 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage05.button02 + message: 0 + +##### Button35 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity35 + - condition: state + entity_id: !input entity35 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage05.button03 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity35 + - condition: state + entity_id: !input entity35 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage05.button03 + message: 0 + +##### Button36 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity36 + - condition: state + entity_id: !input entity36 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage05.button04 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity36 + - condition: state + entity_id: !input entity36 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage05.button04 + message: 0 + +##### Button37 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity37 + - condition: state + entity_id: !input entity37 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage05.button05 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity37 + - condition: state + entity_id: !input entity37 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage05.button05 + message: 0 + +##### Button38 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity38 + - condition: state + entity_id: !input entity38 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage05.button06 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity38 + - condition: state + entity_id: !input entity38 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage05.button06 + message: 0 + +##### Button39 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity39 + - condition: state + entity_id: !input entity39 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage05.button07 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity39 + - condition: state + entity_id: !input entity39 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage05.button07 + message: 0 + +##### Button40 ################################################################# + - choose: + - conditions: + - condition: trigger + id: current_state_entity40 + - condition: state + entity_id: !input entity40 + state: + - "on" + - "open" + sequence: + - service: !input command_value + data: + component: buttonpage05.button08 + message: 1 + - conditions: + - condition: trigger + id: current_state_entity40 + - condition: state + entity_id: !input entity40 + state: + - "off" + - "closed" + sequence: + - service: !input command_value + data: + component: buttonpage05.button08 + message: 0 + +######################################### +# +# +############################################################# +##### CLOSE - HA Button SYNC ##### +############################################################# +# +## +### +############################################################################################################################################################################################# +### +## +# +############################################################# +##### START - Weather Forcast ##### +############################################################# +# +# +######################################### + - choose: + - conditions: + - condition: trigger + id: weather + sequence: + - service: !input command_text_printf + data: + component: weather01.a02 + message: '{{states("sensor.wochentag")}}' + - service: !input command_text_printf + data: + component: weather01.a04 + message: '{{states("sensor.home_wetter_realfeel_temperature_min_0d") | round(0)}}°' + - service: !input command_text_printf + data: + component: weather01.a05 + message: '{{states("sensor.home_wetter_realfeel_temperature_max_0d") | round(0)}}°' + - service: !input command_text_printf + data: + component: weather01.a06 + message: '{{ state_attr("weather.home_wetter","forecast")[0].precipitation_probability}} + %' + - service: !input command_text_printf + data: + component: weather01.a07 + message: '{{states("sensor.home_wetter_hours_of_sun_0d") | round(0)}} h' + - service: !input command_text_printf + data: + component: weather01.a08 + message: '{{state_attr("sensor.home_wetter_uv_index_0d", "level")}}' + - service: !input command_text_printf + data: + component: weather01.a09 + message: '{{states("sensor.home_wetter_uv_index_0d") | round(0)}}' + - service: !input command_text_printf + data: + component: weather01.a10 + message: '{{states("sensor.home_wetter_thunderstorm_probability_day_0d") | round(0)}} + %' + - service: !input command_text_printf + data: + component: weather01.a11 + message: '{{states("sensor.home_wetter_wind_day_0d") | round(0)}} km/h' + - service: !input command_text_printf + data: + component: weather01.a12 + message: '{{states("sensor.home_wetter_thunderstorm_probability_night_0d") | + round(0)}} %' + - service: !input command_text_printf + data: + component: weather01.a13 + message: '{{states("sensor.home_wetter_wind_night_0d") | round(0)}} km/h' + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[0].condition + == ''sunny''}}' + then: + - service: !input command_printf + data: + cmd: weather01.a03.pic=2 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[0].condition + == ''cloudy''}}' + then: + - service: !input command_printf + data: + cmd: weather01.a03.pic=3 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[0].condition + == ''rainy''}}' + then: + - service: !input command_printf + data: + cmd: weather01.a03.pic=4 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[0].condition + == ''pouring''}}' + then: + - service: !input command_printf + data: + cmd: weather01.a03.pic=5 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[0].condition + == ''snowy''}}' + then: + - service: !input command_printf + data: + cmd: weather01.a03.pic=6 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[0].condition + == ''hail''}}' + then: + - service: !input command_printf + data: + cmd: weather01.a03.pic=7 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[0].condition + == ''snowy-rainy''}}' + then: + - service: !input command_printf + data: + cmd: weather01.a03.pic=7 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[0].condition + == ''fog''}}' + then: + - service: !input command_printf + data: + cmd: weather01.a03.pic=8 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[0].condition + == ''windy''}}' + then: + - service: !input command_printf + data: + cmd: weather01.a03.pic=9 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[0].condition + == ''windy-variant''}}' + then: + - service: !input command_printf + data: + cmd: weather01.a03.pic=9 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[0].condition + == ''lightning''}}' + then: + - service: !input command_printf + data: + cmd: weather01.a03.pic=10 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[0].condition + == ''partlycloudy''}}' + then: + - service: !input command_printf + data: + cmd: weather01.a03.pic=11 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[0].condition + == ''lightning-rainy''}}' + then: + - service: !input command_printf + data: + cmd: weather01.a03.pic=13 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[0].condition + == ''execptional''}}' + then: + - service: !input command_printf + data: + cmd: weather01.a03.pic=13 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[0].condition + == ''clear-night''}}' + then: + - service: !input command_printf + data: + cmd: weather01.a03.pic=15 + - service: !input command_text_printf + data: + component: weather02.a02 + message: '{{states("sensor.wochentag01")}}' + - service: !input command_text_printf + data: + component: weather02.a04 + message: '{{states("sensor.home_wetter_realfeel_temperature_min_1d") | round(0)}}°' + - service: !input command_text_printf + data: + component: weather02.a05 + message: '{{states("sensor.home_wetter_realfeel_temperature_max_1d") | round(0)}}°' + - service: !input command_text_printf + data: + component: weather02.a06 + message: '{{ state_attr("weather.home_wetter","forecast")[1].precipitation_probability}} + %' + - service: !input command_text_printf + data: + component: weather02.a07 + message: '{{states("sensor.home_wetter_hours_of_sun_1d") | round(0)}} h' + - service: !input command_text_printf + data: + component: weather02.a08 + message: '{{state_attr("sensor.home_wetter_uv_index_1d", "level")}}' + - service: !input command_text_printf + data: + component: weather02.a09 + message: '{{states("sensor.home_wetter_uv_index_1d") | round(0)}}' + - service: !input command_text_printf + data: + component: weather02.a10 + message: '{{states("sensor.home_wetter_thunderstorm_probability_day_1d") | round(0)}} + %' + - service: !input command_text_printf + data: + component: weather02.a11 + message: '{{states("sensor.home_wetter_wind_day_1d") | round(0)}} km/h' + - service: !input command_text_printf + data: + component: weather02.a12 + message: '{{states("sensor.home_wetter_thunderstorm_probability_night_1d") | + round(0)}} %' + - service: !input command_text_printf + data: + component: weather02.a13 + message: '{{states("sensor.home_wetter_wind_night_1d") | round(0)}} km/h' + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[1].condition + == ''sunny''}}' + then: + - service: !input command_printf + data: + cmd: weather02.a03.pic=2 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[1].condition + == ''cloudy''}}' + then: + - service: !input command_printf + data: + cmd: weather02.a03.pic=3 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[1].condition + == ''rainy''}}' + then: + - service: !input command_printf + data: + cmd: weather02.a03.pic=4 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[1].condition + == ''pouring''}}' + then: + - service: !input command_printf + data: + cmd: weather02.a03.pic=5 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[1].condition + == ''snowy''}}' + then: + - service: !input command_printf + data: + cmd: weather02.a03.pic=6 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[1].condition + == ''hail''}}' + then: + - service: !input command_printf + data: + cmd: weather02.a03.pic=7 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[1].condition + == ''snowy-rainy''}}' + then: + - service: !input command_printf + data: + cmd: weather02.a03.pic=7 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[1].condition + == ''fog''}}' + then: + - service: !input command_printf + data: + cmd: weather02.a03.pic=8 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[1].condition + == ''windy''}}' + then: + - service: !input command_printf + data: + cmd: weather02.a03.pic=9 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[1].condition + == ''windy-variant''}}' + then: + - service: !input command_printf + data: + cmd: weather02.a03.pic=9 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[1].condition + == ''lightning''}}' + then: + - service: !input command_printf + data: + cmd: weather02.a03.pic=10 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[1].condition + == ''partlycloudy''}}' + then: + - service: !input command_printf + data: + cmd: weather02.a03.pic=11 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[1].condition + == ''lightning-rainy''}}' + then: + - service: !input command_printf + data: + cmd: weather02.a03.pic=13 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[1].condition + == ''execptional''}}' + then: + - service: !input command_printf + data: + cmd: weather02.a03.pic=13 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[1].condition + == ''clear-night''}}' + then: + - service: !input command_printf + data: + cmd: weather02.a03.pic=15 + - service: !input command_text_printf + data: + component: weather03.a02 + message: '{{states("sensor.wochentag02")}}' + - service: !input command_text_printf + data: + component: weather03.a04 + message: '{{states("sensor.home_wetter_realfeel_temperature_min_2d") | round(0)}}°' + - service: !input command_text_printf + data: + component: weather03.a05 + message: '{{states("sensor.home_wetter_realfeel_temperature_max_2d") | round(0)}}°' + - service: !input command_text_printf + data: + component: weather03.a06 + message: '{{ state_attr("weather.home_wetter","forecast")[2].precipitation_probability}} + %' + - service: !input command_text_printf + data: + component: weather03.a07 + message: '{{states("sensor.home_wetter_hours_of_sun_2d") | round(0)}} h' + - service: !input command_text_printf + data: + component: weather03.a08 + message: '{{state_attr("sensor.home_wetter_uv_index_2d", "level")}}' + - service: !input command_text_printf + data: + component: weather03.a09 + message: '{{states("sensor.home_wetter_uv_index_2d") | round(0)}}' + - service: !input command_text_printf + data: + component: weather03.a10 + message: '{{states("sensor.home_wetter_thunderstorm_probability_day_2d") | round(0)}} + %' + - service: !input command_text_printf + data: + component: weather03.a11 + message: '{{states("sensor.home_wetter_wind_day_2d") | round(0)}} km/h' + - service: !input command_text_printf + data: + component: weather03.a12 + message: '{{states("sensor.home_wetter_thunderstorm_probability_night_2d") | + round(0)}} %' + - service: !input command_text_printf + data: + component: weather03.a13 + message: '{{states("sensor.home_wetter_wind_night_2d") | round(0)}} km/h' + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[2].condition + == ''sunny''}}' + then: + - service: !input command_printf + data: + cmd: weather03.a03.pic=2 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[2].condition + == ''cloudy''}}' + then: + - service: !input command_printf + data: + cmd: weather03.a03.pic=3 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[2].condition + == ''rainy''}}' + then: + - service: !input command_printf + data: + cmd: weather03.a03.pic=4 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[2].condition + == ''pouring''}}' + then: + - service: !input command_printf + data: + cmd: weather03.a03.pic=5 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[2].condition + == ''snowy''}}' + then: + - service: !input command_printf + data: + cmd: weather03.a03.pic=6 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[2].condition + == ''hail''}}' + then: + - service: !input command_printf + data: + cmd: weather03.a03.pic=7 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[2].condition + == ''snowy-rainy''}}' + then: + - service: !input command_printf + data: + cmd: weather03.a03.pic=7 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[2].condition + == ''fog''}}' + then: + - service: !input command_printf + data: + cmd: weather03.a03.pic=8 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[2].condition + == ''windy''}}' + then: + - service: !input command_printf + data: + cmd: weather03.a03.pic=9 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[2].condition + == ''windy-variant''}}' + then: + - service: !input command_printf + data: + cmd: weather03.a03.pic=9 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[2].condition + == ''lightning''}}' + then: + - service: !input command_printf + data: + cmd: weather03.a03.pic=10 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[2].condition + == ''partlycloudy''}}' + then: + - service: !input command_printf + data: + cmd: weather03.a03.pic=11 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[2].condition + == ''lightning-rainy''}}' + then: + - service: !input command_printf + data: + cmd: weather03.a03.pic=13 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[2].condition + == ''execptional''}}' + then: + - service: !input command_printf + data: + cmd: weather03.a03.pic=13 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[2].condition + == ''clear-night''}}' + then: + - service: !input command_printf + data: + cmd: weather03.a03.pic=15 + - service: !input command_text_printf + data: + component: weather04.a02 + message: '{{states("sensor.wochentag03")}}' + - service: !input command_text_printf + data: + component: weather04.a04 + message: '{{states("sensor.home_wetter_realfeel_temperature_min_3d") | round(0)}}°' + - service: !input command_text_printf + data: + component: weather04.a05 + message: '{{states("sensor.home_wetter_realfeel_temperature_max_3d") | round(0)}}°' + - service: !input command_text_printf + data: + component: weather04.a06 + message: '{{ state_attr("weather.home_wetter","forecast")[3].precipitation_probability}} + %' + - service: !input command_text_printf + data: + component: weather04.a07 + message: '{{states("sensor.home_wetter_hours_of_sun_3d") | round(0)}} h' + - service: !input command_text_printf + data: + component: weather04.a08 + message: '{{state_attr("sensor.home_wetter_uv_index_3d", "level")}}' + - service: !input command_text_printf + data: + component: weather04.a09 + message: '{{states("sensor.home_wetter_uv_index_3d") | round(0)}}' + - service: !input command_text_printf + data: + component: weather04.a10 + message: '{{states("sensor.home_wetter_thunderstorm_probability_day_3d") | round(0)}} + %' + - service: !input command_text_printf + data: + component: weather04.a11 + message: '{{states("sensor.home_wetter_wind_day_3d") | round(0)}} km/h' + - service: !input command_text_printf + data: + component: weather04.a12 + message: '{{states("sensor.home_wetter_thunderstorm_probability_night_3d") | + round(0)}} %' + - service: !input command_text_printf + data: + component: weather04.a13 + message: '{{states("sensor.home_wetter_wind_night_3d") | round(0)}} km/h' + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[3].condition + == ''sunny''}}' + then: + - service: !input command_printf + data: + md: weather04.a03.pic=2 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[3].condition + == ''cloudy''}}' + then: + - service: !input command_printf + data: + cmd: weather04.a03.pic=3 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[3].condition + == ''rainy''}}' + then: + - service: !input command_printf + data: + cmd: weather04.a03.pic=4 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[3].condition + == ''pouring''}}' + then: + - service: !input command_printf + data: + cmd: weather04.a03.pic=5 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[3].condition + == ''snowy''}}' + then: + - service: !input command_printf + data: + cmd: weather04.a03.pic=6 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[3].condition + == ''hail''}}' + then: + - service: !input command_printf + data: + cmd: weather04.a03.pic=7 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[3].condition + == ''snowy-rainy''}}' + then: + - service: !input command_printf + data: + cmd: weather04.a03.pic=7 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[3].condition + == ''fog''}}' + then: + - service: !input command_printf + data: + cmd: weather04.a03.pic=8 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[3].condition + == ''windy''}}' + then: + - service: !input command_printf + data: + cmd: weather04.a03.pic=9 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[3].condition + == ''windy-variant''}}' + then: + - service: !input command_printf + data: + cmd: weather04.a03.pic=9 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[3].condition + == ''lightning''}}' + then: + - service: !input command_printf + data: + cmd: weather04.a03.pic=10 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[3].condition + == ''partlycloudy''}}' + then: + - service: !input command_printf + data: + cmd: weather04.a03.pic=11 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[3].condition + == ''lightning-rainy''}}' + then: + - service: !input command_printf + data: + cmd: weather04.a03.pic=13 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[3].condition + == ''execptional''}}' + then: + - service: !input command_printf + data: + cmd: weather04.a03.pic=13 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[3].condition + == ''clear-night''}}' + then: + - service: !input command_printf + data: + cmd: weather04.a03.pic=15 + - service: !input command_text_printf + data: + component: weather05.a02 + message: '{{states("sensor.wochentag04")}}' + - service: !input command_text_printf + data: + component: weather05.a04 + message: '{{states("sensor.home_wetter_realfeel_temperature_min_4d") | round(0)}}°' + - service: !input command_text_printf + data: + component: weather05.a05 + message: '{{states("sensor.home_wetter_realfeel_temperature_max_4d") | round(0)}}°' + - service: !input command_text_printf + data: + component: weather05.a06 + message: '{{ state_attr("weather.home_wetter","forecast")[4].precipitation_probability}} + %' + - service: !input command_text_printf + data: + component: weather05.a07 + message: '{{states("sensor.home_wetter_hours_of_sun_4d") | round(0)}} h' + - service: !input command_text_printf + data: + component: weather05.a08 + message: '{{state_attr("sensor.home_wetter_uv_index_4d", "level")}}' + - service: !input command_text_printf + data: + component: weather05.a09 + message: '{{states("sensor.home_wetter_uv_index_4d") | round(0)}}' + - service: !input command_text_printf + data: + component: weather05.a10 + message: '{{states("sensor.home_wetter_thunderstorm_probability_day_4d") | round(0)}} + %' + - service: !input command_text_printf + data: + component: weather05.a11 + message: '{{states("sensor.home_wetter_wind_day_4d") | round(0)}} km/h' + - service: !input command_text_printf + data: + component: weather05.a12 + message: '{{states("sensor.home_wetter_thunderstorm_probability_night_4d") | + round(0)}} %' + - service: !input command_text_printf + data: + component: weather05.a13 + message: '{{states("sensor.home_wetter_wind_night_4d") | round(0)}} km/h' + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[4].condition + == ''sunny''}}' + then: + - service: !input command_printf + data: + cmd: weather05.a03.pic=2 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[4].condition + == ''cloudy''}}' + then: + - service: !input command_printf + data: + cmd: weather05.a03.pic=3 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[4].condition + == ''rainy''}}' + then: + - service: !input command_printf + data: + cmd: weather05.a03.pic=4 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[4].condition + == ''pouring''}}' + then: + - service: !input command_printf + data: + cmd: weather05.a03.pic=5 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[4].condition + == ''snowy''}}' + then: + - service: !input command_printf + data: + cmd: weather05.a03.pic=6 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[4].condition + == ''hail''}}' + then: + - service: !input command_printf + data: + cmd: weather05.a03.pic=7 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[4].condition + == ''snowy-rainy''}}' + then: + - service: !input command_printf + data: + cmd: weather05.a03.pic=7 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[4].condition + == ''fog''}}' + then: + - service: !input command_printf + data: + cmd: weather05.a03.pic=8 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[4].condition + == ''windy''}}' + then: + - service: !input command_printf + data: + cmd: weather05.a03.pic=9 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[4].condition + == ''windy-variant''}}' + then: + - service: !input command_printf + data: + cmd: weather05.a03.pic=9 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[4].condition + == ''lightning''}}' + then: + - service: !input command_printf + data: + cmd: weather05.a03.pic=10 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[4].condition + == ''partlycloudy''}}' + then: + - service: !input command_printf + data: + cmd: weather05.a03.pic=11 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[4].condition + == ''lightning-rainy''}}' + then: + - service: !input command_printf + data: + cmd: weather05.a03.pic=13 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[4].condition + == ''execptional''}}' + then: + - service: !input command_printf + data: + cmd: weather05.a03.pic=13 + - if: + - condition: template + value_template: '{{state_attr(''weather.home_wetter'',''forecast'')[4].condition + == ''clear-night''}}' + then: + - service: !input command_printf + data: + cmd: weather05.a03.pic=15 + + ######################################### +# +# +############################################################# +##### CLOSE - Weather Forcast ##### +############################################################# +# +## +### +############################################################################################################################################################################################# \ No newline at end of file diff --git a/climate.yaml b/climate.yaml new file mode 100644 index 0000000..6a64410 --- /dev/null +++ b/climate.yaml @@ -0,0 +1,18 @@ +climate: + - platform: generic_thermostat + unique_id: cf308990-0dbd-4e8a-be77-aec56d7a5aa4 + name: NSPanel Büro + heater: switch.nspanel_buro_relay_2 + target_sensor: sensor.nspanel_buro_temperature + min_temp: 13 + max_temp: 27 + ac_mode: false + target_temp: 22 + cold_tolerance: 0.5 + hot_tolerance: 0.5 + min_cycle_duration: + seconds: 60 + keep_alive: + minutes: 3 + initial_hvac_mode: "heat" + precision: 0.5 diff --git a/esphome.yaml b/esphome.yaml new file mode 100644 index 0000000..6b3a01e --- /dev/null +++ b/esphome.yaml @@ -0,0 +1,1168 @@ +############################################################# +##### START - SUBSTITUTIONS ##### +############################################################# +substitutions: +##### GENEREL CONFIG ############################################################################################# + node_name: nspanel-buero # $node_name + device_name: NSPanel Büro # $device_name + + wifi_ssid: !secret wifi_ssid # add in your esphome secrets file. + wifi_password: !secret wifi_password # add in your esphome secrets file. + ota_password: !secret ota_password # add in your esphome secrets file. + nextion_update_url: !secret nextion_update_url_buero # add in your esphome secrets file. + +###### EDIT THE BELOW ENTITIES FOR YOURS... ####################################################################### + + ha_weekday: sensor.wochentag ##### Sensor Wochentag generiert in HA (custom_configuration -> nspanel) ##### + ha_outdoor_temp: sensor.terrasse_garage_motion_sensor_temperature ##### Temperatur von Bewegungsmelder Outdoor (Zigbee2Mqtt) ##### + ha_hotwater_temp: sensor.hotwater_temp ##### Buderus Heizung Warmwasser Temperatur (Integration) ##### + ha_hotwater_charge: switch.charge + ha_heating_system_flame: binary_sensor.flamestatus ##### Buderus Heizung Flamen-Status (Integration) ##### + ha_climate_thermostat_target_temp: sensor.nspanel_buro_target_temp ##### Climate Thermostat generiert in HA (custom_configuration -> nspanel) ##### + ha_climate_thermostat: climate.nspanel_buro ##### Climate Thermostat generiert in HA (custom_configuration -> nspanel) ##### + ha_humidity: sensor.kinderzimmer_lea_temperatur_sensor_humidity +######################################### +# +# +############################################################# +##### CLOSE - SUBSTITUTIONS ##### +############################################################# +# +## +### +############################################################################################################################################################################################# +### +## +# +############################################################# +##### START - Settings ##### +############################################################# +# +# +######################################### + +##### Functionality for the Nextion display ##### +external_components: + - source: github://pr#2956 + components: [nextion] + refresh: 1h + +##### ESP home CONFIG ##### +esphome: + name: $node_name + comment: $device_name + +##### TYPE OF ESP BOARD ##### +esp32: + board: esp32dev + +##### WIFI SETUP ##### +wifi: + ssid: $wifi_ssid + password: $wifi_password + power_save_mode: none + +captive_portal: + +##### OTA (Over the air updates) password ##### +ota: + password: $ota_password + safe_mode: true + reboot_timeout: 3min + num_attempts: 3 + +##### LOGGER ##### +logger: +# baud_rate: 0 +# level: WARN + +##### CONFIGURE INTERNAL BUZZER ##### +output: + ##### BUZZER FOR PLAYING RINGTONES ##### + - platform: ledc + id: buzzer_out + pin: + number: 21 + +##### ENABLE RINGTONE MUSIC SUPPORT ##### +rtttl: + id: buzzer + output: buzzer_out + +##### UART FOR NEXTION DISPLAY ##### +uart: + tx_pin: 16 + rx_pin: 17 + baud_rate: 115200 + id: tf_uart + +##### INFO - Time component that fetches time from home Assistant and updates the display once a minute and when the display is ready at bootup (and time is available) ##### +time: + - platform: homeassistant + id: homeassistant_time + on_time: + - seconds: 0 + minutes: /1 + then: + - wait_until: + switch.is_on: nextion_init + - lambda: id(disp1).set_component_text_printf("home.a01", "%02i:%02i", id(homeassistant_time).now().hour, id(homeassistant_time).now().minute); + on_time_sync: + then: + - wait_until: + switch.is_on: nextion_init + - lambda: id(disp1).set_component_text_printf("home.a01", "%02i:%02i", id(homeassistant_time).now().hour, id(homeassistant_time).now().minute); + +###### A reboot button is always useful ##### +button: + - platform: restart + name: $device_name Restart + id: restart_nspanel + +######################################### +# +# +############################################################# +##### CLOSE - Settings ##### +############################################################# +# +## +### +############################################################################################################################################################################################# +### +## +# +############################################################# +##### START - API ##### +############################################################# +# +# +######################################### + +api: + services: + +##### SERVICE TO UPDATE THE HMI FILE ##### + - service: upload_tft + then: + - lambda: 'id(disp1)->upload_tft();' + +##### Service to send a command "printf" directly to the display. Useful for testing ##### + - service: send_command_printf + variables: + cmd: string + then: + - lambda: 'id(disp1).send_command_printf("%s", cmd.c_str());' + +##### Service to send a command "text_printf" directly to the display. Useful for testing ##### + - service: send_command_text_printf + variables: + component: string + message: string + then: + - wait_until: + switch.is_on: nextion_init + - lambda: 'id(disp1).set_component_text_printf(component.c_str(), "%s", message.c_str());' + +##### Service to send a command "component_value (Dualstate Button)" directly to the display. Useful for testing ##### + - service: send_command_value + variables: + component: string + message: int + then: + - wait_until: + switch.is_on: nextion_init + - lambda: 'id(disp1).set_component_value(component.c_str(), message);' + +######################################### +# +# +############################################################# +##### CLOSE - API ##### +############################################################# +# +## +### +############################################################################################################################################################################################# +### +## +# +############################################################# +##### START - GLOBALS ##### +############################################################# +# +# +######################################### + +globals: + +##### Save Target Temp ##### + - id: climate_target_temp_val_global + type: float + restore_value: true + initial_value: '12' + +##### Save Thermostat PIC Position ##### + - id: climate_slider_val_global + type: int + restore_value: true + initial_value: '0' + +##### Save Display Brightness for NSPanel reboot ##### + - id: display_brightness_global + type: int + restore_value: true + initial_value: '100' + +##### Save Display DIM Brightness for NSPanel reboot + - id: display_dim_brightness_global + type: int + restore_value: true + initial_value: '10' + +##### Save Display DIM Brightness for NSPanel reboot + - id: sleep_modus_global + type: int + restore_value: true + initial_value: '0' + +##### Save State Heating Room ##### + - id: heating_room_global + type: int + restore_value: true + initial_value: '0' + +##### Save State HVAC ##### + - id: hvac_mode_global + type: int + restore_value: true + initial_value: '0' + +######################################### +# +# +############################################################# +##### CLOSE - GLOBALS ##### +############################################################# +# +## +### +############################################################################################################################################################################################# +### +## +# +############################################################# +##### START - BINARY SENSOR ##### +############################################################# +# +# +######################################### + +binary_sensor: + +###### LEFT BUTTON BELOW DISPLAY TO TOGGLE RELAY##### + - platform: gpio + name: $device_name Left Button + pin: + number: 14 + inverted: true + on_click: + - switch.toggle: relay_1 + +##### RIGHT BUTTON BELOW DISPLAY TO TOGGLE RELAY ##### + - platform: gpio + name: $device_name Right Button + pin: + number: 27 + inverted: true + on_click: + - switch.toggle: relay_2 + +##### THERMOSTAT - BUTTON DECREASES CLIMATE TARGET TEMPERATURE IN HA ##### + - platform: nextion + name: $device_name Climate Target DOWN + page_id: 6 + component_id: 14 + internal: true + on_click: + - homeassistant.service: + service: climate.set_temperature + data_template: + entity_id: $ha_climate_thermostat + temperature: !lambda return id(climate_target_temp_val_global) - 0.5; + +##### THERMOSTAT - BUTTON INCREASES CLIMATE TARGET TEMPERATURE IN HA ##### + - platform: nextion + name: $device_name Climate Target UP + page_id: 6 + component_id: 15 + internal: true + on_click: + - homeassistant.service: + service: climate.set_temperature + data_template: + entity_id: $ha_climate_thermostat + temperature: !lambda return id(climate_target_temp_val_global) + 0.5; + +##### THERMOSTAT - BUTTON ON / OFF Heating ##### + - platform: nextion + name: $device_name Heating Room State + id: heating_room_state + page_id: 6 + component_id: 17 + internal: true + on_click: + - switch.toggle: hvac_mode + +##### Display Brightness - BUTTON DECREASES Brightness ##### + - platform: nextion + name: $device_name Brightness DOWN + page_id: 7 + component_id: 12 + internal: true + on_click: + - number.set: + id: display_brightness + value: !lambda return id(display_brightness_global) - 1; + - lambda: id(disp1).set_component_text_printf("settings.a03", "%i", id(display_brightness_global)); + - lambda: id(disp1).send_command_printf("settings.brightslider.val=%i", id(display_brightness_global)); + +##### Display Brightness - BUTTON INCREASES Brightness ##### + - platform: nextion + name: $device_name Brightness UP + page_id: 7 + component_id: 13 + internal: true + on_click: + - number.set: + id: display_brightness + value: !lambda return id(display_brightness_global) + 1; + - lambda: id(disp1).set_component_text_printf("settings.a03", "%i", id(display_brightness_global)); + - lambda: id(disp1).send_command_printf("settings.brightslider.val=%i", id(display_brightness_global)); + +##### Display DIM Brightness - BUTTON DECREASES Brightness ##### + - platform: nextion + name: $device_name Brightness DIM DOWN + page_id: 7 + component_id: 14 + internal: true + on_click: + - number.set: + id: display_dim_brightness + value: !lambda return id(display_dim_brightness_global) - 1; + - lambda: id(disp1).set_component_text_printf("settings.a04", "%i", id(display_dim_brightness_global)); + - lambda: id(disp1).send_command_printf("settings.dimslider.val=%i", id(display_dim_brightness_global)); + +##### Display DIM Brightness - BUTTON INCREASES Brightness ##### + - platform: nextion + name: $device_name Brightness DIM UP + page_id: 7 + component_id: 15 + internal: true + on_click: + - number.set: + id: display_dim_brightness + value: !lambda return id(display_dim_brightness_global) + 1; + - lambda: id(disp1).set_component_text_printf("settings.a04", "%i", id(display_dim_brightness_global)); + - lambda: id(disp1).send_command_printf("settings.dimslider.val=%i", id(display_dim_brightness_global)); + +##### Restart NSPanel Button ##### + - platform: nextion + name: $device_name Restart + page_id: 7 + component_id: 11 + internal: true + on_click: + - button.press: restart_nspanel + +##### Sleep Modus NSPanel Button ##### + - platform: nextion + name: $device_name Sleep Modus + page_id: 7 + component_id: 6 + internal: true + on_click: + - switch.toggle: sleep_modus + +##### Hotwater Charge ##### + - platform: nextion + name: $device_name Hotwater Charge + page_id: 6 + component_id: 22 + on_click: + - homeassistant.service: + service: switch.toggle + data: + entity_id: $ha_hotwater_charge + +######################################### +# +# +############################################################# +##### CLOSE - BINARY SENSOR ##### +############################################################# +# +## +### +############################################################################################################################################################################################# +### +## +# +############################################################# +##### START - SENSOR ##### +############################################################# +# +# +######################################### + +sensor: + +##### INTERNAL TEMPERATUE SENSOR, ADC VALUE ##### + - platform: adc + id: ntc_source + pin: 38 + update_interval: 10s + attenuation: 11db + +##### INTERNAL TEMPERATUE SENSOR, adc reading converted to resistance (calculation)##### + - platform: resistance + id: resistance_sensor + sensor: ntc_source + configuration: DOWNSTREAM + resistor: 11.2kOhm + +##### INTERNAL TEMPERATUE SENSOR, resistance to temperature (calculation) ##### + - platform: ntc + name: $device_name Temperature + id: temp_nspanel + sensor: resistance_sensor + calibration: + b_constant: 3950 + reference_temperature: 25°C + reference_resistance: 10kOhm + on_value: + then: + - wait_until: + switch.is_on: nextion_init + - lambda: id(disp1).set_component_text_printf("home.a03", "%.1f°", id(temp_nspanel).state); # onboard temp (thermostat temp) to home page. + - lambda: id(disp1).set_component_text_printf("thermostat.a04", "%.1f", id(temp_nspanel).state); + +##### TEMPERATURE Outdoor FROM HA ##### + - platform: homeassistant + id: temp_outdoor + entity_id: $ha_outdoor_temp + on_value: + then: + - wait_until: + switch.is_on: nextion_init + - lambda: id(disp1).set_component_text_printf("home.a06", "%.0f°", id(temp_outdoor).state); + - lambda: id(disp1).set_component_text_printf("thermostat.a07", "%.0f°", id(temp_outdoor).state); + +##### HUMIDITY Indoor FROM HA ##### + - platform: homeassistant + id: humidity + entity_id: $ha_humidity + on_value: + then: + - wait_until: + switch.is_on: nextion_init + - lambda: id(disp1).set_component_text_printf("home.a04", "%.0f°", id(humidity).state); + + +##### THERMOSTAT HOT WATER TEMP FROM HA ##### + - platform: homeassistant + id: temp_hotwater + entity_id: $ha_hotwater_temp + on_value: + then: + - wait_until: + switch.is_on: nextion_init + - lambda: id(disp1).set_component_text_printf("home.a07", "%.1f°", id(temp_hotwater).state); + - lambda: id(disp1).set_component_text_printf("thermostat.a08", "%.1f°", id(temp_hotwater).state); + +##### THERMOSTAT CLIMATE TARGET TEMPERATURE FROM HA ##### + - platform: homeassistant + id: ha_climate_target_temp + entity_id: $ha_climate_thermostat_target_temp + on_value: + then: + - wait_until: + switch.is_on: nextion_init + - globals.set: + id: climate_target_temp_val_global + value: !lambda 'return float(x);' + - lambda: id(disp1).set_component_text_printf("thermostat.a05", "%.1f", id(climate_target_temp_val_global)); + # THERMO PROGRESS CIRCLE, broken into 3 images to create space for the temperatures in the center. + - lambda: |- + int left=16; // 16 is empty left. + int mid=17; // 17 is empty mid. + int right=18; // 18 is empty right. + if (id(climate_target_temp_val_global) == 13) { + left=16; + mid=17; + right=18; + } else if (id(climate_target_temp_val_global) == 13.5) { + left=19; + mid=17; + right=18; + } else if (id(climate_target_temp_val_global) == 14) { + left=20; + mid=17; + right=18; + } else if (id(climate_target_temp_val_global) == 14.5) { + left=21; + mid=17; + right=18; + } else if (id(climate_target_temp_val_global) == 15) { + left=22; + mid=17; + right=18; + } else if (id(climate_target_temp_val_global) == 15.5) { + left=23; + mid=17; + right=18; + } else if (id(climate_target_temp_val_global) == 16) { + left=24; + mid=17; + right=18; + } else if (id(climate_target_temp_val_global) == 16.5) { + left=25; + mid=17; + right=18; + } else if (id(climate_target_temp_val_global) == 17) { + left=26; + mid=17; + right=18; + } else if (id(climate_target_temp_val_global) == 17.5) { + left=27; + mid=17; + right=18; + } else if (id(climate_target_temp_val_global) == 18) { + left=28; + mid=17; + right=18; + } else if (id(climate_target_temp_val_global) == 18.5) { + left=29; + mid=30; + right=18; + } else if (id(climate_target_temp_val_global) == 19) { + left=29; + mid=31; + right=18; + } else if (id(climate_target_temp_val_global) == 19.5) { + left=29; + mid=32; + right=18; + } else if (id(climate_target_temp_val_global) == 20) { + left=29; + mid=33; + right=18; + } else if (id(climate_target_temp_val_global) == 20.5) { + left=29; + mid=34; + right=18; + } else if (id(climate_target_temp_val_global) == 21) { + left=29; + mid=35; + right=18; + } else if (id(climate_target_temp_val_global) == 21.5) { + left=29; + mid=36; + right=18; + } else if (id(climate_target_temp_val_global) == 22) { + left=29; + mid=37; + right=38; + } else if (id(climate_target_temp_val_global) == 22.5) { + left=29; + mid=37; + right=39; + } else if (id(climate_target_temp_val_global) == 23) { + left=29; + mid=37; + right=40; + } else if (id(climate_target_temp_val_global) == 23.5) { + left=29; + mid=37; + right=41; + } else if (id(climate_target_temp_val_global) == 24) { + left=29; + mid=37; + right=42; + } else if (id(climate_target_temp_val_global) == 24.5) { + left=29; + mid=37; + right=43; + } else if (id(climate_target_temp_val_global) == 25) { + left=29; + mid=37; + right=44; + } else if (id(climate_target_temp_val_global) == 25.5) { + left=29; + mid=37; + right=45; + } else if (id(climate_target_temp_val_global) == 26) { + left=29; + mid=37; + right=46; + } else if (id(climate_target_temp_val_global) == 26.5) { + left=29; + mid=37; + right=47; + } else if (id(climate_target_temp_val_global) == 27) { + left=29; + mid=37; + right=48; + } + // sends the 3 images to the display + id(disp1).send_command_printf("thermostat.a01.pic=%i", left); + id(disp1).send_command_printf("thermostat.a02.pic=%i", mid); + id(disp1).send_command_printf("thermostat.a03.pic=%i", right); + +###### TARGET TEMPERATURE GET VALUE FROM NEXTION CIRCLE SLIDER AND SET GLOBAL VARIBLE ##### + - platform: nextion + id: climate_circleslider + name: $device_name Climate circleslider + variable_name: climateslider + internal: true + on_value: + then: + - wait_until: + switch.is_on: nextion_init + - globals.set: + id: climate_slider_val_global + value: !lambda 'return int(x);' + - lambda: |- + if (id(climate_slider_val_global) == 0) { + id(climate_target_temp_val_global) = 13; + } else if (id(climate_slider_val_global) == 1) { + id(climate_target_temp_val_global) = 13.5; + } else if (id(climate_slider_val_global) == 2) { + id(climate_target_temp_val_global) = 14; + } else if (id(climate_slider_val_global) == 3) { + id(climate_target_temp_val_global) = 14.5; + } else if (id(climate_slider_val_global) == 4) { + id(climate_target_temp_val_global) = 15; + } else if (id(climate_slider_val_global) == 5) { + id(climate_target_temp_val_global) = 15.5; + } else if (id(climate_slider_val_global) == 6) { + id(climate_target_temp_val_global) = 16; + } else if (id(climate_slider_val_global) == 7) { + id(climate_target_temp_val_global) = 16.5; + } else if (id(climate_slider_val_global) == 8) { + id(climate_target_temp_val_global) = 17; + } else if (id(climate_slider_val_global) == 9) { + id(climate_target_temp_val_global) = 17.5; + } else if (id(climate_slider_val_global) == 10) { + id(climate_target_temp_val_global) = 18; + } else if (id(climate_slider_val_global) == 11) { + id(climate_target_temp_val_global) = 18.5; + } else if (id(climate_slider_val_global) == 12) { + id(climate_target_temp_val_global) = 19; + } else if (id(climate_slider_val_global) == 13) { + id(climate_target_temp_val_global) = 19.5; + } else if (id(climate_slider_val_global) == 14) { + id(climate_target_temp_val_global) = 20; + } else if (id(climate_slider_val_global) == 15) { + id(climate_target_temp_val_global) = 20.5; + } else if (id(climate_slider_val_global) == 16) { + id(climate_target_temp_val_global) = 21; + } else if (id(climate_slider_val_global) == 17) { + id(climate_target_temp_val_global) = 21.5; + } else if (id(climate_slider_val_global) == 18) { + id(climate_target_temp_val_global) = 22; + } else if (id(climate_slider_val_global) == 19) { + id(climate_target_temp_val_global) = 22.5; + } else if (id(climate_slider_val_global) == 20) { + id(climate_target_temp_val_global) = 23; + } else if (id(climate_slider_val_global) == 21) { + id(climate_target_temp_val_global) = 23.5; + } else if (id(climate_slider_val_global) == 22) { + id(climate_target_temp_val_global) = 24; + } else if (id(climate_slider_val_global) == 23) { + id(climate_target_temp_val_global) = 24.5; + } else if (id(climate_slider_val_global) == 24) { + id(climate_target_temp_val_global) = 25; + } else if (id(climate_slider_val_global) == 25) { + id(climate_target_temp_val_global) = 25.5; + } else if (id(climate_slider_val_global) == 26) { + id(climate_target_temp_val_global) = 26; + } else if (id(climate_slider_val_global) == 27) { + id(climate_target_temp_val_global) = 26.5; + } else if (id(climate_slider_val_global) == 28) { + id(climate_target_temp_val_global) = 27; + } + - homeassistant.service: + service: climate.set_temperature + data_template: + entity_id: $ha_climate_thermostat + temperature: !lambda return id(climate_target_temp_val_global); + +###### Display Brightness GET VALUE FROM NSPanel SLIDER ##### + - platform: nextion + id: brightslider + name: $device_name brightness Slider + variable_name: brightslider + internal: true + on_value: + then: + - wait_until: + switch.is_on: nextion_init + - number.set: + id: display_brightness + value: !lambda 'return int(x);' + # send text field percentage of current_lightslider_val + - lambda: id(disp1).set_component_text_printf("settings.a03", "%i", id(display_brightness_global)); + +###### Display DIM Brightness GET VALUE FROM NSPanel SLIDER ##### + - platform: nextion + id: dimslider + name: $device_name dim brightness slider + variable_name: dimslider + internal: true + on_value: + then: + - wait_until: + switch.is_on: nextion_init + - number.set: + id: display_dim_brightness + value: !lambda 'return int(x);' + # send text field percentage of current_lightslider_val + - lambda: id(disp1).set_component_text_printf("settings.a04", "%i", id(display_dim_brightness_global)); + + +######################################### +# +# +############################################################# +##### CLOSE - SENSOR ##### +############################################################# +# +## +### +############################################################################################################################################################################################# +### +## +# +############################################################# +##### START - TEXT SENSOR##### +############################################################# +# +# +######################################### + +text_sensor: + +##### ESPhome version used to compile the app ##### + - platform: version + name: $device_name ESPhome Version + +##### SUN SENSOR FROM HA ##### + - platform: homeassistant + id: sun_sun + entity_id: sun.sun + +##### last click sensor, the main action variable - push to HA ##### + - platform: nextion + nextion_id: disp1 + name: $device_name last click + id: disp1_last_click_va + update_interval: 50ms + component_name: lastclick + +##### last click lightsettings page, the main action variable - push to HA ##### + - platform: nextion + nextion_id: disp1 + name: $device_name last click lightsettings + id: disp1_last_click_lightsettings + update_interval: 50ms + component_name: lightsetting + +##### last click coversettings page, the main action variable - push to HA ##### + - platform: nextion + nextion_id: disp1 + name: $device_name last click coversettings + id: disp1_last_click_coversettings + update_interval: 50ms + component_name: coverposition + +##### Wochentag SENSOR FROM HA ##### + - platform: homeassistant + id: weekday + entity_id: $ha_weekday + on_value: + then: + - wait_until: + switch.is_on: nextion_init + - lambda: id(disp1).set_component_text_printf("home.a02", "%s", id(weekday).state.c_str()); + +##### HEATING System ICON ##### + - platform: homeassistant + entity_id: $ha_heating_system_flame + name: "Heating System" + id: heating_system + on_value: + then: + - wait_until: + switch.is_on: nextion_init + - lambda: |- + int symbol=60; // 60 is a blank image 30x30 + if (id(heating_system).state == "on") { + symbol=61; + } + id(disp1).send_command_printf("home.a50.pic=%i", symbol); + id(disp1).send_command_printf("thermostat.a50.pic=%i", symbol); + +##### Hotwater Charge ICON ##### + - platform: homeassistant + entity_id: $ha_hotwater_charge + name: "Hotwater Charge" + id: hotwater_charge + on_value: + then: + - wait_until: + switch.is_on: nextion_init + - lambda: |- + if (id(hotwater_charge).state == "on") { + id(disp1).set_component_value("thermostat.a12",1); + } else { + id(disp1).set_component_value("thermostat.a12",0); + } +# - lambda: |- +# id(disp1).set_component_value("thermostat.a12",0); +# if (id(hotwater_charge) == "on") +# { +# id(disp1).set_component_value("thermostat.a12",1); +# } + +##### WEATHER SYMBOL FROM HA WEATHER ENTITY ##### + - platform: homeassistant + id: weather_symbol + entity_id: weather.home_wetter + on_value: + then: + - wait_until: + switch.is_on: nextion_init + - lambda: |- + int symbol=1; // 1 is a empty box. + if (id(weather_symbol).state == "sunny") { + symbol=2; + } else if (id(weather_symbol).state == "cloudy") { + symbol=3; + if (id(sun_sun).state == "below_horizon") { + symbol=3; + } + } else if (id(weather_symbol).state == "rainy") { + symbol=4; + } else if (id(weather_symbol).state == "pouring") { + symbol=5; + } else if (id(weather_symbol).state == "snowy") { + symbol=6; + } else if (id(weather_symbol).state == "hail" || id(weather_symbol).state == "snowy-rainy") { + symbol=7; + } else if (id(weather_symbol).state == "fog") { + symbol=8; + } else if (id(weather_symbol).state == "windy" || id(weather_symbol).state == "windy-variant") { + symbol=9; + } else if (id(weather_symbol).state == "lightning") { + symbol=10; + } else if (id(weather_symbol).state == "partlycloudy") { + symbol=11; + if (id(sun_sun).state == "below_horizon") { + symbol=12; + } + } else if (id(weather_symbol).state == "lightning-rainy" || id(weather_symbol).state == "exceptional") { + symbol=13; + if (id(sun_sun).state == "below_horizon") { + symbol=14; + } + } else if (id(weather_symbol).state == "clear-night") { + symbol=15; + } + id(disp1).send_command_printf("home.a05.pic=%i", symbol); + +######################################### +# +# +############################################################# +##### CLOSE - TEXT SENSOR ##### +############################################################# +# +## +### +############################################################################################################################################################################################# +### +## +# +############################################################# +##### START - SWITCH ##### +############################################################# +# +# +######################################### + +switch: + +##### global variable to keep track on whether the Nextion display is ready or not. Delays initial info from HA to the display ##### + - platform: template + name: $device_name Nextion inited + id: nextion_init + entity_category: config + restore_state: false + assumed_state: off + optimistic: true + +##### UPDATE TFT DISPLAY ##### + - platform: template + name: Update TFT display + id: tft_update + turn_on_action: + - delay: 16ms + - lambda: id(disp1).upload_tft(); + - switch.turn_off: tft_update + +##### PHYSICAL SWITCH 1 ##### + - platform: gpio + name: $device_name Relay 1 + id: relay_1 + pin: + number: 22 + +##### PHYSICAL SWITCH 2 ###### + - platform: gpio + name: $device_name Relay 2 + id: relay_2 + pin: + number: 19 + on_turn_off: + - globals.set: + id: heating_room_global + value: '0' + - lambda: |- + if (id(hvac_mode_global) == 0) + { + id(disp1).send_command_printf("thermostat.a06.pic=51"); + } else if (id(hvac_mode_global) == 1) { + id(disp1).send_command_printf("thermostat.a06.pic=52"); + } + - lambda: id(disp1).send_command_printf("home.a52.pic=60"); + - lambda: id(disp1).send_command_printf("thermostat.a52.pic=60"); + on_turn_on: + - globals.set: + id: heating_room_global + value: '1' + - lambda: id(disp1).send_command_printf("thermostat.a06.pic=53"); + - lambda: id(disp1).send_command_printf("home.a52.pic=63"); + - lambda: id(disp1).send_command_printf("thermostat.a52.pic=63"); + +##### Switch Climate HVAC Mode ##### + - platform: template + device_class: switch + name: $device_name hvac Mode + id: hvac_mode + restore_state: true + assumed_state: false + optimistic: true + on_turn_off: + - lambda: id(disp1).set_component_value("thermostat.a10",0); + - globals.set: + id: hvac_mode_global + value: '0' + - homeassistant.service: + service: climate.set_hvac_mode + data_template: + entity_id: $ha_climate_thermostat + hvac_mode: 'off' + - lambda: id(disp1).send_command_printf("thermostat.a06.pic=51"); + - lambda: id(disp1).send_command_printf("home.a51.pic=60"); + - lambda: id(disp1).send_command_printf("thermostat.a51.pic=60"); + on_turn_on: + - lambda: id(disp1).set_component_value("thermostat.a10",1); + - globals.set: + id: hvac_mode_global + value: '1' + - homeassistant.service: + service: climate.set_hvac_mode + data_template: + entity_id: $ha_climate_thermostat + hvac_mode: 'heat' + - lambda: |- + if (id(heating_room_global) == 0) + { + id(disp1).send_command_printf("thermostat.a06.pic=52"); + } else if (id(heating_room_global) == 1) { + id(disp1).send_command_printf("thermostat.a06.pic=53"); + } + - lambda: id(disp1).send_command_printf("home.a51.pic=62"); + - lambda: id(disp1).send_command_printf("thermostat.a51.pic=62"); + +##### DISPLAY ALWAYS ON ##### + - platform: gpio + name: $device_name Screen Power + id: screen_power + entity_category: config + pin: + number: 4 + inverted: true + restore_mode: ALWAYS_ON + internal: true + +##### Switch Display Sleep Modus ##### + - platform: template + device_class: switch + name: $device_name Sleep Modus + id: sleep_modus + restore_state: true + assumed_state: false + optimistic: true + on_turn_off: + - lambda: id(disp1).send_command_printf("home.sleepmodus.val=0"); + - globals.set: + id: sleep_modus_global + value: '0' + - lambda: id(disp1).set_component_value("settings.a02",0); + on_turn_on: + - lambda: id(disp1).send_command_printf("home.sleepmodus.val=1"); + - globals.set: + id: sleep_modus_global + value: '1' + - lambda: id(disp1).set_component_value("settings.a02",1); + +######################################### +# +# +############################################################# +##### CLOSE - SWITCH ##### +############################################################# +# +## +### +############################################################################################################################################################################################# +### +## +# +############################################################# +##### START - NUMBER ##### +############################################################# +# +# +######################################### + +number: + +##### SCREEN BRIGHTNESS ##### + - platform: template + name: $device_name Display Brightness + id: display_brightness + entity_category: config + unit_of_measurement: '%' + min_value: 1 + max_value: 100 + step: 1 + restore_value: true + optimistic: true + set_action: + then: + - lambda: 'id(disp1).set_backlight_brightness(x/100);' + - lambda: 'id(disp1).send_command_printf("home.brightness.val=%i", int(x));' + - globals.set: + id: display_brightness_global + value: !lambda 'return int(x);' + +##### SCREEN BRIGHTNESS DIMMED DOWN ##### + - platform: template + name: $device_name Display Brightness Dimdown + id: display_dim_brightness + entity_category: config + unit_of_measurement: '%' + min_value: 1 + max_value: 100 + step: 1 + restore_value: true + optimistic: true + set_action: + then: + - lambda: 'id(disp1).send_command_printf("home.brightdd.val=%i", int(x));' + - globals.set: + id: display_dim_brightness_global + value: !lambda 'return int(x);' + +######################################### +# +# +############################################################# +##### CLOSE - NUMBER ##### +############################################################# +# +## +### +############################################################################################################################################################################################# +### +## +# +############################################################# +##### START - DISPLAY START##### +############################################################# +# +# +######################################### + +display: + - platform: nextion + id: disp1 + uart_id: tf_uart + tft_url: $nextion_update_url + on_setup: + then: + - lambda: id(disp1).send_command_printf("page 9"); ##### CHANGE! - Loading page ##### + - wait_until: + api.connected + - delay: 0.5s + - rtttl.play: "two short:d=4,o=5,b=100:16e6,16e6" + - delay: 0.5s + - switch.template.publish: + id: nextion_init + state: on + - lambda: id(disp1).send_command_printf("page 0"); #### home page ##### + - delay: 2s ##### gives the display time to update other components & set the home page ##### + - number.set: + id: display_brightness + value: !lambda 'return id(display_brightness_global);' + - number.set: + id: display_dim_brightness + value: !lambda 'return id(display_dim_brightness_global);' + - lambda: id(disp1).set_component_text_printf("settings.a03", "%i", id(display_brightness_global)); + - lambda: id(disp1).set_component_text_printf("settings.a04", "%i", id(display_dim_brightness_global)); + - lambda: id(disp1).send_command_printf("settings.brightslider.val=%i", id(display_brightness_global)); + - lambda: id(disp1).send_command_printf("settings.dimslider.val=%i", id(display_dim_brightness_global)); + - lambda: id(disp1).send_command_printf("home.sleepmodus.val=%i", id(sleep_modus_global)); + - lambda: |- + id(disp1).set_component_value("settings.a02",0); + if (id(sleep_modus_global) == 1) + { + id(disp1).set_component_value("settings.a02",1); + } + - lambda: |- + id(disp1).send_command_printf("home.a50.pic=60"); + id(disp1).send_command_printf("thermostat.a50.pic=60"); + id(disp1).send_command_printf("thermostat.a06.pic=52"); + if (id(heating_room_global) == 1) + { + id(disp1).send_command_printf("home.a52.pic=63"); + id(disp1).send_command_printf("thermostat.a52.pic=63"); + id(disp1).send_command_printf("thermostat.a06.pic=53"); + } + - lambda: |- + if (id(hvac_mode_global) == 0) { + id(disp1).send_command_printf("home.a51.pic=60"); + id(disp1).send_command_printf("thermostat.a51.pic=60"); + id(disp1).send_command_printf("thermostat.a06.pic=51"); + } else if (id(hvac_mode_global) == 1) { + id(disp1).send_command_printf("home.a51.pic=62"); + id(disp1).send_command_printf("thermostat.a51.pic=62"); + id(disp1).set_component_value("thermostat.a10",1); + } + +############################################################# +##### CLOSE - DISPLAY START ##### +############################################################# \ No newline at end of file diff --git a/folder_watcher.yaml b/folder_watcher.yaml new file mode 100644 index 0000000..4a503d1 --- /dev/null +++ b/folder_watcher.yaml @@ -0,0 +1,7 @@ +# Please insert into the default file "configuration.yaml +# Folder must be changed to the directory where the tft file (Nextion Editor) will be uploaded +########### +# +#Folder watcher for NS panel auto upload tft +folder_watcher: + - folder: /config/www/nspanel/ \ No newline at end of file diff --git a/nspanel_buero.HMI b/nspanel_buero.HMI new file mode 100644 index 0000000..854d3da Binary files /dev/null and b/nspanel_buero.HMI differ diff --git a/nspanel_buero.tft b/nspanel_buero.tft new file mode 100644 index 0000000..abfc207 Binary files /dev/null and b/nspanel_buero.tft differ diff --git a/sensor.yaml b/sensor.yaml new file mode 100644 index 0000000..1431ae1 --- /dev/null +++ b/sensor.yaml @@ -0,0 +1,78 @@ +##### Sensor ###### +sensor: + + - platform: template + sensors: + wochentag: + friendly_name: "Wochentag" + unique_id: 6ac64850-8563-456c-b562-92343dd96f0b + value_template: > + {% set days = ['Montag,', 'Dienstag,', 'Mittwoch,', 'Donnerstag,', 'Freitag,', 'Samstag,', 'Sonntag,'] %} + {{ now().timestamp() | timestamp_custom(days[now().weekday()] ~ ' %d.%m')}} + icon_template: mdi:calendar-range + + - platform: template + sensors: + wochentag01: + friendly_name: "Wochentag+1" + unique_id: 6b2aad54-3eb0-48cc-ae32-ee3574197f1b + value_template: > + {% set days = ['Montag,', 'Dienstag,', 'Mittwoch,', 'Donnerstag,', 'Freitag,', 'Samstag,', 'Sonntag,', 'Montag,'] %} + {{(as_timestamp(now())+ (86400)) | timestamp_custom(days[now().weekday()+1] ~ ' %d.%m') }} + icon_template: mdi:calendar-range + + - platform: template + sensors: + wochentag02: + friendly_name: "Wochentag+2" + unique_id: edbddaf0-2791-4774-b8d4-aa706f75cc7a + value_template: > + {% set days = ['Montag,', 'Dienstag,', 'Mittwoch,', 'Donnerstag,', 'Freitag,', 'Samstag,', 'Sonntag,', 'Montag,', 'Dienstag,'] %} + {{(as_timestamp(now())+ (172800)) | timestamp_custom(days[now().weekday()+2] ~ ' %d.%m') }} + icon_template: mdi:calendar-range + + - platform: template + sensors: + wochentag03: + friendly_name: "Wochentag+3" + unique_id: ad592622-db86-40f7-9961-4c1ffd21c711 + value_template: > + {% set days = ['Montag,', 'Dienstag,', 'Mittwoch,', 'Donnerstag,', 'Freitag,', 'Samstag,', 'Sonntag,', 'Montag,', 'Dienstag,', 'Mittwoch,'] %} + {{(as_timestamp(now())+ (259200)) | timestamp_custom(days[now().weekday()+3] ~ ' %d.%m') }} + icon_template: mdi:calendar-range + + - platform: template + sensors: + wochentag04: + friendly_name: "Wochentag+4" + unique_id: dcb3ed45-2b89-4672-a04f-a55f025ac745 + value_template: > + {% set days = ['Montag,', 'Dienstag,', 'Mittwoch,', 'Donnerstag,', 'Freitag,', 'Samstag,', 'Sonntag,', 'Montag,', 'Dienstag,', 'Mittwoch,', 'Donnerstag,'] %} + {{(as_timestamp(now())+ (345600)) | timestamp_custom(days[now().weekday()+4] ~ ' %d.%m') }} + icon_template: mdi:calendar-range + + - platform: template + sensors: + wochentag05: + friendly_name: "Wochentag+5" + unique_id: 77e642a5-de54-452d-9f4a-febe3a7851c2 + value_template: > + {% set days = ['Montag,', 'Dienstag,', 'Mittwoch,', 'Donnerstag,', 'Freitag,', 'Samstag,', 'Sonntag,', 'Montag,', 'Dienstag,', 'Mittwoch,', 'Donnerstag,', 'Freitag,'] %} + {{(as_timestamp(now())+ (432000)) | timestamp_custom(days[now().weekday()+ 5] ~ ' %d.%m') }} + icon_template: mdi:calendar-range + +###### NSPanel Büro - climate target temperature ##### + - platform: template + sensors: + nspanel_buro_target_temp: + unique_id: 2393ab74-21ce-42d3-b15e-ec162b9d6f31 + friendly_name: NSPanel Buro Target Temp + value_template: "{{ state_attr('climate.nspanel_buro', 'temperature') }}" + +###### NSPanel Büro - climate target temperature ##### + - platform: template + sensors: + nspanel_lea_target_temp: + unique_id: e8e61ff7-3a41-47ad-bd6c-303f730de96f + friendly_name: NSPanel Lea Target Temp + value_template: "{{ state_attr('climate.nspanel_lea', 'temperature') }}" \ No newline at end of file