From 1bf8a0b9419468481b6d7ae89212f8fb1f4146e4 Mon Sep 17 00:00:00 2001 From: Blackymas Date: Tue, 8 Nov 2022 09:47:06 +0100 Subject: [PATCH] change blueprint, esphome --- blueprint.yaml | 46 ++-- esphome.yaml | 674 ++++++++++++++++++++++++------------------------- 2 files changed, 359 insertions(+), 361 deletions(-) diff --git a/blueprint.yaml b/blueprint.yaml index 00b50c7..d1ce756 100644 --- a/blueprint.yaml +++ b/blueprint.yaml @@ -771,11 +771,19 @@ variables: right_button_name: !input "right_button_name" ##### NEXTION PIC MAPPING ##### - cover_pic_closed: "106" - cover_pic_open: "107" - battery_icon: "108" - light_pic_off: "125" - light_pic_on: "126" + button_light_off: "62" + button_light_on: "63" + button_switch_off: "64" + button_switch_on: "65" + button_cover_off: "66" + button_cover_on: "67" + cover_pic_closed: "78" + cover_pic_open: "79" + battery_icon: "80" + light_pic_off: "96" + light_pic_on: "97" + hotwater_pic_off: "60" + hotwater_pic_on: "61" weather_sunny: "2" weather_cloudy: "3" @@ -796,20 +804,14 @@ variables: weather_execptional_night: "14" weather_clear_night: "15" - weather_icon_blank: "53" - weather_icon_rain: "59" - weather_icon_sun: "60" - weather_icon_protect: "61" - weather_icon_lightning: "62" - weather_icon_wind: "63" + weather_icon_blank: "51" + weather_icon_rain: "52" + weather_icon_sun: "53" + weather_icon_protect: "54" + weather_icon_lightning: "55" + weather_icon_wind: "56" - ###### NEXTION COLOR BUTTON DESIGN ##### - button_light_off: "90" - button_light_on: "91" - button_switch_off: "92" - button_switch_on: "93" - button_cover_off: "94" - button_cover_on: "95" + ###### NEXTION COLOR MAPPING ##### button_color_1: "65535" button_color_2: "10597" @@ -1735,7 +1737,7 @@ action: milliseconds: "{{ delay_value }}" - service: "{{ command_printf }}" data: - cmd: home.p01.pic=68 + cmd: home.p01.pic={{ hotwater_pic_on }} - delay: milliseconds: "{{ delay_value }}" - service: "{{ command_text_printf }}" @@ -1884,7 +1886,7 @@ action: milliseconds: "{{ delay_value }}" - service: "{{ command_text_printf }}" data: - component: home.left_button + component: home.left_bt_text message: "{{ left_button_name }}" ##### NSPanel boot init - Left Button ##### @@ -1892,7 +1894,7 @@ action: milliseconds: "{{ delay_value }}" - service: "{{ command_text_printf }}" data: - component: home.right_button + component: home.right_bt_text message: "{{ right_button_name }}" ##### NSPanel boot init finished ##### @@ -2765,7 +2767,7 @@ action: milliseconds: "{{ delay_value }}" - service: "{{ command_printf }}" data: - cmd: home.p01.pic=68 + cmd: home.p01.pic={{ hotwater_pic_on }} diff --git a/esphome.yaml b/esphome.yaml index 82d5568..b02e801 100644 --- a/esphome.yaml +++ b/esphome.yaml @@ -328,8 +328,6 @@ binary_sensor: pin: number: 14 inverted: true - # on_click: - # - switch.toggle: relay_1 ##### RIGHT BUTTON BELOW DISPLAY TO TOGGLE RELAY ##### - platform: gpio @@ -337,44 +335,42 @@ binary_sensor: 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: 13 - 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; + # - platform: nextion + # name: ${device_name} Climate Target DOWN + # page_id: 6 + # component_id: 13 + # 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: 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; + # - platform: nextion + # name: ${device_name} Climate Target UP + # 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 ON / OFF Heating ##### - - platform: nextion - name: ${device_name} Heating Room State - id: heating_room_state - page_id: 6 - component_id: 16 - internal: true - on_click: - - switch.toggle: hvac_mode + # - platform: nextion + # name: ${device_name} Heating Room State + # id: heating_room_state + # page_id: 6 + # component_id: 16 + # internal: true + # on_click: + # - switch.toggle: hvac_mode ##### Restart NSPanel Button ##### - platform: nextion @@ -468,222 +464,222 @@ sensor: - lambda: id(disp1).set_component_text_printf("thermostat.a04", "%.1f", id(temp_nspanel).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); + # - 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); + # - 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 @@ -768,9 +764,9 @@ text_sensor: disabled_by_default: true ##### SUN SENSOR FROM HA ##### - - platform: homeassistant - id: sun_sun - entity_id: sun.sun + # - platform: homeassistant + # id: sun_sun + # entity_id: sun.sun ##### last click sensor, the main action variable - push to HA ##### - platform: nextion @@ -857,37 +853,37 @@ text_sensor: value: !lambda return x; ##### 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=53; // 53 is a blank image 20x20 - if (id(heating_system).state == "on") { - symbol=64; - } - id(disp1).send_command_printf("home.a50.pic=%i", symbol); - id(disp1).send_command_printf("thermostat.a50.pic=%i", symbol); + # - 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=53; // 53 is a blank image 20x20 + # if (id(heating_system).state == "on") { + # symbol=64; + # } + # 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); - } + # - 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); + # } ######################################### # @@ -952,45 +948,45 @@ switch: number: 19 ##### 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=49"); - - lambda: id(disp1).send_command_printf("home.a51.pic=53"); - - lambda: id(disp1).send_command_printf("thermostat.a51.pic=53"); - 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=50"); - } else if (id(heating_room_global) == 1) { - id(disp1).send_command_printf("thermostat.a06.pic=51"); - } - - lambda: id(disp1).send_command_printf("home.a51.pic=65"); - - lambda: id(disp1).send_command_printf("thermostat.a51.pic=65"); + # - 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=49"); + # - lambda: id(disp1).send_command_printf("home.a51.pic=53"); + # - lambda: id(disp1).send_command_printf("thermostat.a51.pic=53"); + # 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=50"); + # } else if (id(heating_room_global) == 1) { + # id(disp1).send_command_printf("thermostat.a06.pic=51"); + # } + # - lambda: id(disp1).send_command_printf("home.a51.pic=65"); + # - lambda: id(disp1).send_command_printf("thermostat.a51.pic=65"); ##### DISPLAY ALWAYS ON ##### - platform: gpio @@ -1138,26 +1134,26 @@ display: { id(disp1).set_component_value("settings.a02",1); } - - lambda: |- - id(disp1).send_command_printf("home.a50.pic=53"); - id(disp1).send_command_printf("thermostat.a50.pic=53"); - id(disp1).send_command_printf("thermostat.a06.pic=50"); - if (id(heating_room_global) == 1) - { - id(disp1).send_command_printf("home.a52.pic=66"); - id(disp1).send_command_printf("thermostat.a52.pic=66"); - id(disp1).send_command_printf("thermostat.a06.pic=51"); - } - - lambda: |- - if (id(hvac_mode_global) == 0) { - id(disp1).send_command_printf("home.a51.pic=53"); - id(disp1).send_command_printf("thermostat.a51.pic=53"); - id(disp1).send_command_printf("thermostat.a06.pic=49"); - } else if (id(hvac_mode_global) == 1) { - id(disp1).send_command_printf("home.a51.pic=65"); - id(disp1).send_command_printf("thermostat.a51.pic=65"); - id(disp1).set_component_value("thermostat.a10",1); - } + # - lambda: |- + # id(disp1).send_command_printf("home.a50.pic=53"); + # id(disp1).send_command_printf("thermostat.a50.pic=53"); + # id(disp1).send_command_printf("thermostat.a06.pic=50"); + # if (id(heating_room_global) == 1) + # { + # id(disp1).send_command_printf("home.a52.pic=66"); + # id(disp1).send_command_printf("thermostat.a52.pic=66"); + # id(disp1).send_command_printf("thermostat.a06.pic=51"); + # } + # - lambda: |- + # if (id(hvac_mode_global) == 0) { + # id(disp1).send_command_printf("home.a51.pic=53"); + # id(disp1).send_command_printf("thermostat.a51.pic=53"); + # id(disp1).send_command_printf("thermostat.a06.pic=49"); + # } else if (id(hvac_mode_global) == 1) { + # id(disp1).send_command_printf("home.a51.pic=65"); + # id(disp1).send_command_printf("thermostat.a51.pic=65"); + # id(disp1).set_component_value("thermostat.a10",1); + # } ############################################################# ##### CLOSE - DISPLAY START #####