current Version blueprint and esphome

This commit is contained in:
Blackymas
2022-10-27 15:17:29 +02:00
parent 498451ba6d
commit f76a111c22
2 changed files with 15010 additions and 129 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -4,13 +4,13 @@
substitutions: substitutions:
##### GENEREL CONFIG ############################################################################################# ##### GENEREL CONFIG #############################################################################################
node_name: nspanel-buero # $node_name node_name: nspanel-buero # $node_name
device_name: NSPanel Büro # $device_name device_name: NSPanel Buero # $device_name
wifi_ssid: !secret wifi_ssid # add in your esphome secrets file. wifi_ssid: !secret wifi_ssid # add in your esphome secrets file.
wifi_password: !secret wifi_password # 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. 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. # nextion_update_url: !secret nextion_update_url_buero # add in your esphome secrets file.
nextion_update_url: "http://192.168.4.250:8123/local/nspanel/buero/nspanel_buero.tft"
###### EDIT THE BELOW ENTITIES FOR YOURS... ####################################################################### ###### EDIT THE BELOW ENTITIES FOR YOURS... #######################################################################
#ha_weekday: sensor.wochentag ##### Sensor Wochentag generiert in HA (custom_configuration -> nspanel) ##### #ha_weekday: sensor.wochentag ##### Sensor Wochentag generiert in HA (custom_configuration -> nspanel) #####
@@ -174,6 +174,36 @@ api:
switch.is_on: nextion_init switch.is_on: nextion_init
- lambda: 'id(disp1).set_component_value(component.c_str(), message);' - lambda: 'id(disp1).set_component_value(component.c_str(), message);'
##### Service to send a command "component_value (Dualstate Button)" directly to the display. Useful for testing #####
- service: send_command_hide
variables:
component: string
then:
- wait_until:
switch.is_on: nextion_init
- lambda: 'id(disp1).hide_component(component.c_str());'
##### Service to send a command "component_value (Dualstate Button)" directly to the display. Useful for testing #####
- service: send_command_font_color
variables:
component: string
message: int
then:
- wait_until:
switch.is_on: nextion_init
- lambda: 'id(disp1).set_component_font_color(component.c_str(), message);'
##### Service to send a command "component_value (Dualstate Button)" directly to the display. Useful for testing #####
- service: send_command_background_color
variables:
component: string
message: int
then:
- wait_until:
switch.is_on: nextion_init
- lambda: 'id(disp1).set_component_background_color(component.c_str(), message);'
######################################### #########################################
# #
# #
@@ -266,8 +296,8 @@ binary_sensor:
pin: pin:
number: 14 number: 14
inverted: true inverted: true
on_click: # on_click:
- switch.toggle: relay_1 # - switch.toggle: relay_1
##### RIGHT BUTTON BELOW DISPLAY TO TOGGLE RELAY ##### ##### RIGHT BUTTON BELOW DISPLAY TO TOGGLE RELAY #####
- platform: gpio - platform: gpio
@@ -275,14 +305,14 @@ binary_sensor:
pin: pin:
number: 27 number: 27
inverted: true inverted: true
on_click: # on_click:
- switch.toggle: relay_2 # - switch.toggle: relay_2
##### THERMOSTAT - BUTTON DECREASES CLIMATE TARGET TEMPERATURE IN HA ##### ##### THERMOSTAT - BUTTON DECREASES CLIMATE TARGET TEMPERATURE IN HA #####
- platform: nextion - platform: nextion
name: $device_name Climate Target DOWN name: $device_name Climate Target DOWN
page_id: 6 page_id: 6
component_id: 14 component_id: 13
internal: true internal: true
on_click: on_click:
- homeassistant.service: - homeassistant.service:
@@ -295,7 +325,7 @@ binary_sensor:
- platform: nextion - platform: nextion
name: $device_name Climate Target UP name: $device_name Climate Target UP
page_id: 6 page_id: 6
component_id: 15 component_id: 14
internal: true internal: true
on_click: on_click:
- homeassistant.service: - homeassistant.service:
@@ -309,68 +339,68 @@ binary_sensor:
name: $device_name Heating Room State name: $device_name Heating Room State
id: heating_room_state id: heating_room_state
page_id: 6 page_id: 6
component_id: 17 component_id: 16
internal: true internal: true
on_click: on_click:
- switch.toggle: hvac_mode - switch.toggle: hvac_mode
##### Display Brightness - BUTTON DECREASES Brightness ##### ##### Display Brightness - BUTTON DECREASES Brightness #####
- platform: nextion # - platform: nextion
name: $device_name Brightness DOWN # name: $device_name Brightness DOWN
page_id: 7 # page_id: 7
component_id: 12 # component_id: 12
internal: true # internal: true
on_click: # on_click:
- number.set: # - number.set:
id: display_brightness # id: display_brightness
value: !lambda return id(display_brightness_global) - 1; # 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).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)); # - lambda: id(disp1).send_command_printf("settings.brightslider.val=%i", id(display_brightness_global));
##### Display Brightness - BUTTON INCREASES Brightness ##### ##### Display Brightness - BUTTON INCREASES Brightness #####
- platform: nextion # - platform: nextion
name: $device_name Brightness UP # name: $device_name Brightness UP
page_id: 7 # page_id: 7
component_id: 13 # component_id: 13
internal: true # internal: true
on_click: # on_click:
- number.set: # - number.set:
id: display_brightness # id: display_brightness
value: !lambda return id(display_brightness_global) + 1; # 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).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)); # - lambda: id(disp1).send_command_printf("settings.brightslider.val=%i", id(display_brightness_global));
##### Display DIM Brightness - BUTTON DECREASES Brightness ##### ##### Display DIM Brightness - BUTTON DECREASES Brightness #####
- platform: nextion # - platform: nextion
name: $device_name Brightness DIM DOWN # name: $device_name Brightness DIM DOWN
page_id: 7 # page_id: 7
component_id: 14 # component_id: 14
internal: true # internal: true
on_click: # on_click:
- number.set: # - number.set:
id: display_dim_brightness # id: display_dim_brightness
value: !lambda return id(display_dim_brightness_global) - 1; # 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).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)); # - lambda: id(disp1).send_command_printf("settings.dimslider.val=%i", id(display_dim_brightness_global));
##### Display DIM Brightness - BUTTON INCREASES Brightness ##### ##### Display DIM Brightness - BUTTON INCREASES Brightness #####
- platform: nextion # - platform: nextion
name: $device_name Brightness DIM UP # name: $device_name Brightness DIM UP
page_id: 7 # page_id: 7
component_id: 15 # component_id: 15
internal: true # internal: true
on_click: # on_click:
- number.set: # - number.set:
id: display_dim_brightness # id: display_dim_brightness
value: !lambda return id(display_dim_brightness_global) + 1; # 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).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)); # - lambda: id(disp1).send_command_printf("settings.dimslider.val=%i", id(display_dim_brightness_global));
##### Restart NSPanel Button ##### ##### Restart NSPanel Button #####
- platform: nextion - platform: nextion
name: $device_name Restart name: $device_name Restart
page_id: 7 page_id: 7
component_id: 11 component_id: 10
internal: true internal: true
on_click: on_click:
- button.press: restart_nspanel - button.press: restart_nspanel
@@ -379,7 +409,7 @@ binary_sensor:
- platform: nextion - platform: nextion
name: $device_name Sleep Modus name: $device_name Sleep Modus
page_id: 7 page_id: 7
component_id: 6 component_id: 5
internal: true internal: true
on_click: on_click:
- switch.toggle: sleep_modus - switch.toggle: sleep_modus
@@ -388,7 +418,7 @@ binary_sensor:
- platform: nextion - platform: nextion
name: $device_name Hotwater Charge name: $device_name Hotwater Charge
page_id: 6 page_id: 6
component_id: 22 component_id: 21
on_click: on_click:
- homeassistant.service: - homeassistant.service:
service: switch.toggle service: switch.toggle
@@ -806,9 +836,9 @@ text_sensor:
- wait_until: - wait_until:
switch.is_on: nextion_init switch.is_on: nextion_init
- lambda: |- - lambda: |-
int symbol=60; // 60 is a blank image 30x30 int symbol=53; // 53 is a blank image 20x20
if (id(heating_system).state == "on") { if (id(heating_system).state == "on") {
symbol=61; symbol=64;
} }
id(disp1).send_command_printf("home.a50.pic=%i", symbol); id(disp1).send_command_printf("home.a50.pic=%i", symbol);
id(disp1).send_command_printf("thermostat.a50.pic=%i", symbol); id(disp1).send_command_printf("thermostat.a50.pic=%i", symbol);
@@ -836,50 +866,50 @@ text_sensor:
# } # }
##### WEATHER SYMBOL FROM HA WEATHER ENTITY ##### ##### WEATHER SYMBOL FROM HA WEATHER ENTITY #####
- platform: homeassistant # - platform: homeassistant
id: weather_symbol # id: weather_symbol
entity_id: weather.home_wetter # entity_id: weather.home_wetter
on_value: # on_value:
then: # then:
- wait_until: # - wait_until:
switch.is_on: nextion_init # switch.is_on: nextion_init
- lambda: |- # - lambda: |-
int symbol=1; // 1 is a empty box. # int symbol=1; // 1 is a empty box.
if (id(weather_symbol).state == "sunny") { # if (id(weather_symbol).state == "sunny") {
symbol=2; # symbol=2;
} else if (id(weather_symbol).state == "cloudy") { # } else if (id(weather_symbol).state == "cloudy") {
symbol=3; # symbol=3;
if (id(sun_sun).state == "below_horizon") { # if (id(sun_sun).state == "below_horizon") {
symbol=3; # symbol=3;
} # }
} else if (id(weather_symbol).state == "rainy") { # } else if (id(weather_symbol).state == "rainy") {
symbol=4; # symbol=4;
} else if (id(weather_symbol).state == "pouring") { # } else if (id(weather_symbol).state == "pouring") {
symbol=5; # symbol=5;
} else if (id(weather_symbol).state == "snowy") { # } else if (id(weather_symbol).state == "snowy") {
symbol=6; # symbol=6;
} else if (id(weather_symbol).state == "hail" || id(weather_symbol).state == "snowy-rainy") { # } else if (id(weather_symbol).state == "hail" || id(weather_symbol).state == "snowy-rainy") {
symbol=7; # symbol=7;
} else if (id(weather_symbol).state == "fog") { # } else if (id(weather_symbol).state == "fog") {
symbol=8; # symbol=8;
} else if (id(weather_symbol).state == "windy" || id(weather_symbol).state == "windy-variant") { # } else if (id(weather_symbol).state == "windy" || id(weather_symbol).state == "windy-variant") {
symbol=9; # symbol=9;
} else if (id(weather_symbol).state == "lightning") { # } else if (id(weather_symbol).state == "lightning") {
symbol=10; # symbol=10;
} else if (id(weather_symbol).state == "partlycloudy") { # } else if (id(weather_symbol).state == "partlycloudy") {
symbol=11; # symbol=11;
if (id(sun_sun).state == "below_horizon") { # if (id(sun_sun).state == "below_horizon") {
symbol=12; # symbol=12;
} # }
} else if (id(weather_symbol).state == "lightning-rainy" || id(weather_symbol).state == "exceptional") { # } else if (id(weather_symbol).state == "lightning-rainy" || id(weather_symbol).state == "exceptional") {
symbol=13; # symbol=13;
if (id(sun_sun).state == "below_horizon") { # if (id(sun_sun).state == "below_horizon") {
symbol=14; # symbol=14;
} # }
} else if (id(weather_symbol).state == "clear-night") { # } else if (id(weather_symbol).state == "clear-night") {
symbol=15; # symbol=15;
} # }
id(disp1).send_command_printf("home.a05.pic=%i", symbol); # id(disp1).send_command_printf("home.a05.pic=%i", symbol);
######################################### #########################################
# #
@@ -941,19 +971,19 @@ switch:
- lambda: |- - lambda: |-
if (id(hvac_mode_global) == 0) if (id(hvac_mode_global) == 0)
{ {
id(disp1).send_command_printf("thermostat.a06.pic=51"); id(disp1).send_command_printf("thermostat.a06.pic=49");
} else if (id(hvac_mode_global) == 1) { } else if (id(hvac_mode_global) == 1) {
id(disp1).send_command_printf("thermostat.a06.pic=52"); id(disp1).send_command_printf("thermostat.a06.pic=50");
} }
- lambda: id(disp1).send_command_printf("home.a52.pic=60"); - lambda: id(disp1).send_command_printf("home.a52.pic=53");
- lambda: id(disp1).send_command_printf("thermostat.a52.pic=60"); - lambda: id(disp1).send_command_printf("thermostat.a52.pic=53");
on_turn_on: on_turn_on:
- globals.set: - globals.set:
id: heating_room_global id: heating_room_global
value: '1' value: '1'
- lambda: id(disp1).send_command_printf("thermostat.a06.pic=53"); - lambda: id(disp1).send_command_printf("thermostat.a06.pic=51");
- lambda: id(disp1).send_command_printf("home.a52.pic=63"); - lambda: id(disp1).send_command_printf("home.a52.pic=66");
- lambda: id(disp1).send_command_printf("thermostat.a52.pic=63"); - lambda: id(disp1).send_command_printf("thermostat.a52.pic=66");
##### Switch Climate HVAC Mode ##### ##### Switch Climate HVAC Mode #####
- platform: template - platform: template
@@ -973,9 +1003,9 @@ switch:
data_template: data_template:
entity_id: $ha_climate_thermostat entity_id: $ha_climate_thermostat
hvac_mode: 'off' hvac_mode: 'off'
- lambda: id(disp1).send_command_printf("thermostat.a06.pic=51"); - lambda: id(disp1).send_command_printf("thermostat.a06.pic=49");
- lambda: id(disp1).send_command_printf("home.a51.pic=60"); - lambda: id(disp1).send_command_printf("home.a51.pic=53");
- lambda: id(disp1).send_command_printf("thermostat.a51.pic=60"); - lambda: id(disp1).send_command_printf("thermostat.a51.pic=53");
on_turn_on: on_turn_on:
- lambda: id(disp1).set_component_value("thermostat.a10",1); - lambda: id(disp1).set_component_value("thermostat.a10",1);
- globals.set: - globals.set:
@@ -989,12 +1019,12 @@ switch:
- lambda: |- - lambda: |-
if (id(heating_room_global) == 0) if (id(heating_room_global) == 0)
{ {
id(disp1).send_command_printf("thermostat.a06.pic=52"); id(disp1).send_command_printf("thermostat.a06.pic=50");
} else if (id(heating_room_global) == 1) { } else if (id(heating_room_global) == 1) {
id(disp1).send_command_printf("thermostat.a06.pic=53"); id(disp1).send_command_printf("thermostat.a06.pic=51");
} }
- lambda: id(disp1).send_command_printf("home.a51.pic=62"); - lambda: id(disp1).send_command_printf("home.a51.pic=65");
- lambda: id(disp1).send_command_printf("thermostat.a51.pic=62"); - lambda: id(disp1).send_command_printf("thermostat.a51.pic=65");
##### DISPLAY ALWAYS ON ##### ##### DISPLAY ALWAYS ON #####
- platform: gpio - platform: gpio
@@ -1143,26 +1173,26 @@ display:
id(disp1).set_component_value("settings.a02",1); id(disp1).set_component_value("settings.a02",1);
} }
- lambda: |- - lambda: |-
id(disp1).send_command_printf("home.a50.pic=60"); id(disp1).send_command_printf("home.a50.pic=53");
id(disp1).send_command_printf("thermostat.a50.pic=60"); id(disp1).send_command_printf("thermostat.a50.pic=53");
id(disp1).send_command_printf("thermostat.a06.pic=52"); id(disp1).send_command_printf("thermostat.a06.pic=50");
if (id(heating_room_global) == 1) if (id(heating_room_global) == 1)
{ {
id(disp1).send_command_printf("home.a52.pic=63"); id(disp1).send_command_printf("home.a52.pic=66");
id(disp1).send_command_printf("thermostat.a52.pic=63"); id(disp1).send_command_printf("thermostat.a52.pic=66");
id(disp1).send_command_printf("thermostat.a06.pic=53"); id(disp1).send_command_printf("thermostat.a06.pic=51");
} }
- lambda: |- - lambda: |-
if (id(hvac_mode_global) == 0) { if (id(hvac_mode_global) == 0) {
id(disp1).send_command_printf("home.a51.pic=60"); id(disp1).send_command_printf("home.a51.pic=53");
id(disp1).send_command_printf("thermostat.a51.pic=60"); id(disp1).send_command_printf("thermostat.a51.pic=53");
id(disp1).send_command_printf("thermostat.a06.pic=51"); id(disp1).send_command_printf("thermostat.a06.pic=49");
} else if (id(hvac_mode_global) == 1) { } else if (id(hvac_mode_global) == 1) {
id(disp1).send_command_printf("home.a51.pic=62"); id(disp1).send_command_printf("home.a51.pic=65");
id(disp1).send_command_printf("thermostat.a51.pic=62"); id(disp1).send_command_printf("thermostat.a51.pic=65");
id(disp1).set_component_value("thermostat.a10",1); id(disp1).set_component_value("thermostat.a10",1);
} }
############################################################# #############################################################
##### CLOSE - DISPLAY START ##### ##### CLOSE - DISPLAY START #####
############################################################# #############################################################