Merge pull request #321 from deejaybeam/dev

upd: prep for release 3.1.1
This commit is contained in:
Chris
2023-02-10 20:58:29 +01:00
committed by GitHub
2 changed files with 495 additions and 438 deletions

View File

@@ -32,7 +32,7 @@ The goal was to create a version that allows everyone to use the NSpanel fully l
🎉 Roadmap Roadmap can be found here [Roadmap](https://github.com/Blackymas/NSPanel_HA_Blueprint/labels/roadmap)
Version: v.3.1.0
Version: v.3.1.1
'
@@ -256,6 +256,16 @@ The goal was to create a version that allows everyone to use the NSpanel fully l
text: {}
##### HARDWARE BUTTONS #####
hold_delay:
name: Delay for HW-Button hold in seconds
description: '* *Time in seconds to detect a hold*'
default: 1.0
selector:
number:
min: 1.0
max: 10.0
step: 1.0
unit_of_measurement: seconds
left_button_entity:
name: Left Button (Optional)
description: '* *Left Hardware Button - Select the entity that should be switched*'
@@ -285,6 +295,21 @@ The goal was to create a version that allows everyone to use the NSpanel fully l
description: '* *activate this to use left button to toggle relay 1 if display is offline* '
selector:
boolean:
left_button_hold_select:
name: Left button hold assignment (Optional)
description: '* *select what shold happen on hold*'
default: 'Default'
selector:
select:
options:
- Default
- Custom Action
left_button_hold_custom_action:
name: Left button custom hold action (Optional)
description: '* The action(s) to launch on hold**'
default: []
selector:
action:
right_button_entity:
name: Right Button (Optional)
description: '* *Right Hardware Button - Select the entity that should be switched*'
@@ -314,6 +339,21 @@ The goal was to create a version that allows everyone to use the NSpanel fully l
description: '* *activate this to use right button to toggle relay 2 if display is offline* '
selector:
boolean:
right_button_hold_select:
name: Right button hold assignment (Optional)
description: '* *select what shold happen on hold*'
default: 'Default'
selector:
select:
options:
- Default
- Custom Action
right_button_hold_custom_action:
name: Right button custom hold action (Optional)
description: '* The action(s) to launch on hold**'
default: []
selector:
action:
##### BUTTON Page Labels #####
button_page01_label:
@@ -2001,28 +2041,29 @@ trace:
#############################################################
trigger_variables:
nspanel_name_trigger: !input "nspanel_name"
last_click: "sensor.{{ nspanel_name_trigger }}_last_click"
last_click_lightsettings: "sensor.{{ nspanel_name_trigger }}_last_click_lightsettings"
last_click_coversettings: "sensor.{{ nspanel_name_trigger }}_last_click_coversettings"
last_click_climatesettings: "sensor.{{ nspanel_name_trigger }}_last_click_climatesettings"
left_button: "binary_sensor.{{ nspanel_name_trigger }}_left_button"
right_button: "binary_sensor.{{ nspanel_name_trigger }}_right_button"
weather_forcast_button: "binary_sensor.{{ nspanel_name_trigger }}_weather_forcast"
nextion_inited_trigger: "switch.{{ nspanel_name_trigger }}_nextion_inited"
# current_page: "sensor.{{ nspanel_name_trigger }}_current_page"
current_page: "sensor.{{ nspanel_name_trigger }}_currentpage"
nspanel_name: !input "nspanel_name"
last_click: "sensor.{{ nspanel_name }}_last_click"
last_click_lightsettings: "sensor.{{ nspanel_name }}_last_click_lightsettings"
last_click_coversettings: "sensor.{{ nspanel_name }}_last_click_coversettings"
last_click_climatesettings: "sensor.{{ nspanel_name }}_last_click_climatesettings"
left_button: "binary_sensor.{{ nspanel_name }}_left_button"
right_button: "binary_sensor.{{ nspanel_name }}_right_button"
weather_forcast_button: "binary_sensor.{{ nspanel_name }}_weather_forcast"
nextion_inited_trigger: "switch.{{ nspanel_name }}_nextion_inited"
# current_page: "sensor.{{ nspanel_name }}_current_page"
current_page: "sensor.{{ nspanel_name }}_currentpage"
hotwatercharge: !input "hotwatercharge"
heatingsystemflame: !input "heatingsystemflame"
display_target_temperature: "sensor.{{ nspanel_name_trigger }}_display_target_temperature"
relay01_entity: "switch.{{ nspanel_name_trigger }}_relay_1"
relay02_entity: "switch.{{ nspanel_name_trigger }}_relay_2"
nspaneltemp: "sensor.{{ nspanel_name_trigger }}_temperature"
display_target_temperature: "sensor.{{ nspanel_name }}_display_target_temperature"
relay01_entity: "switch.{{ nspanel_name }}_relay_1"
relay02_entity: "switch.{{ nspanel_name }}_relay_2"
nspaneltemp: "sensor.{{ nspanel_name }}_temperature"
settings_entity: "sensor.{{ nspanel_name }}_settings_entity"
##### notification Trigger #####
notification_unread: "switch.{{ nspanel_name_trigger }}_notification_unread"
notification_text: "sensor.{{ nspanel_name_trigger }}_notification_text"
notification_label: "sensor.{{ nspanel_name_trigger }}_notification_label"
notification_unread: "switch.{{ nspanel_name }}_notification_unread"
notification_text: "sensor.{{ nspanel_name }}_notification_text"
notification_label: "sensor.{{ nspanel_name }}_notification_label"
##### WEATHER Trigger #####
weather: !input "weather"
@@ -2031,13 +2072,12 @@ trigger_variables:
variables:
##### GENERAL #####
blueprint_version: "3.1.0"
nspanel_name: !input "nspanel_name"
blueprint_version: "3.1.1"
time: "{{ (as_timestamp(now()) | timestamp_custom('%H:%M')) }}"
language: !input "language"
notification_sound: "switch.{{ nspanel_name_trigger }}_notification_sound"
confirmation_message: "switch.{{ nspanel_name_trigger }}_confirmation_message"
notification_sound: "switch.{{ nspanel_name }}_notification_sound"
confirmation_message: "switch.{{ nspanel_name }}_confirmation_message"
##### PUSH TO NEXTION DISPLAY #####
command_text_printf: "esphome.{{ nspanel_name }}_send_command_text_printf"
@@ -2049,6 +2089,7 @@ variables:
command_notification_show: "esphome.{{ nspanel_name }}_notification_show"
command_notification_clear: "esphome.{{ nspanel_name }}_notification_clear"
command_play_rtttl: "esphome.{{ nspanel_name }}_play_rtttl"
command_set_settings_entity: "esphome.{{ nspanel_name }}_set_settings_entity"
###### SYNC SETTINGS #####
delay_boot: !input "delay"
@@ -2079,6 +2120,8 @@ variables:
left_button_name: !input "left_button_name"
right_button_entity: !input "right_button_entity"
right_button_name: !input "right_button_name"
left_button_hold_select: !input "left_button_hold_select"
right_button_hold_select: !input "right_button_hold_select"
##### NEXTION PIC MAPPING #####
button_light_off: "62"
@@ -2883,8 +2926,17 @@ trigger:
##### Reboot - Trigger "nspanel_boot_init" #####
- platform: template
value_template: '{{ states(nextion_inited_trigger) is match "on" }}'
for:
seconds: 1
id: nspanel_boot_init
##### settings_entity - Trigger "settings_entity" #####
- platform: event
event_type: state_changed
event_data:
entity_id: "{{ settings_entity }}"
id: settings_entity
##### Automation reload
- platform: event
event_type: automation_reloaded
@@ -3271,122 +3323,24 @@ trigger:
#############################################################
##### START - Action #####
#############################################################
condition: '{{ states(relay01_entity) != "unavailable" and states(relay02_entity) != "unavailable" }}'
#condition: '{{ states(relay01_entity) != "unavailable" and states(relay02_entity) != "unavailable" }}'
condition: '{{ states(nextion_inited_trigger) == "on" }}'
action:
- variables:
##### Entity - Page Lightsettings #####
settings_entity_value: '{{ states(settings_entity) }}'
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) == "pressbuttonleft" -%} {{ left_button_entity }}
{%- elif states(last_click) == "pressbuttonright" -%} {{ right_button_entity }}
{%- if settings_entity_value != "unknown" -%} {{ settings_entity_value.split(',')[0] }}
{%- else -%} unknown
{%- endif -%}
##### Entity Name - Page Lightsettings #####
entity_long_name: >-
{%- if states(last_click) == "pressbuttonpage01button01" -%} {{ entity01_name }}
{%- elif states(last_click) == "pressbuttonpage01button02" -%} {{ entity02_name }}
{%- elif states(last_click) == "pressbuttonpage01button03" -%} {{ entity03_name }}
{%- elif states(last_click) == "pressbuttonpage01button04" -%} {{ entity04_name }}
{%- elif states(last_click) == "pressbuttonpage01button05" -%} {{ entity05_name }}
{%- elif states(last_click) == "pressbuttonpage01button06" -%} {{ entity06_name }}
{%- elif states(last_click) == "pressbuttonpage01button07" -%} {{ entity07_name }}
{%- elif states(last_click) == "pressbuttonpage01button08" -%} {{ entity08_name }}
{%- elif states(last_click) == "pressbuttonpage02button01" -%} {{ entity09_name }}
{%- elif states(last_click) == "pressbuttonpage02button02" -%} {{ entity10_name }}
{%- elif states(last_click) == "pressbuttonpage02button03" -%} {{ entity11_name }}
{%- elif states(last_click) == "pressbuttonpage02button04" -%} {{ entity12_name }}
{%- elif states(last_click) == "pressbuttonpage02button05" -%} {{ entity13_name }}
{%- elif states(last_click) == "pressbuttonpage02button06" -%} {{ entity14_name }}
{%- elif states(last_click) == "pressbuttonpage02button07" -%} {{ entity15_name }}
{%- elif states(last_click) == "pressbuttonpage02button08" -%} {{ entity16_name }}
{%- elif states(last_click) == "pressbuttonpage03button01" -%} {{ entity17_name }}
{%- elif states(last_click) == "pressbuttonpage03button02" -%} {{ entity18_name }}
{%- elif states(last_click) == "pressbuttonpage03button03" -%} {{ entity19_name }}
{%- elif states(last_click) == "pressbuttonpage03button04" -%} {{ entity20_name }}
{%- elif states(last_click) == "pressbuttonpage03button05" -%} {{ entity21_name }}
{%- elif states(last_click) == "pressbuttonpage03button06" -%} {{ entity22_name }}
{%- elif states(last_click) == "pressbuttonpage03button07" -%} {{ entity23_name }}
{%- elif states(last_click) == "pressbuttonpage03button08" -%} {{ entity24_name }}
{%- elif states(last_click) == "pressbuttonpage04button01" -%} {{ entity25_name }}
{%- elif states(last_click) == "pressbuttonpage04button02" -%} {{ entity26_name }}
{%- elif states(last_click) == "pressbuttonpage04button03" -%} {{ entity27_name }}
{%- elif states(last_click) == "pressbuttonpage04button04" -%} {{ entity28_name }}
{%- elif states(last_click) == "pressbuttonpage04button05" -%} {{ entity29_name }}
{%- elif states(last_click) == "pressbuttonpage04button06" -%} {{ entity30_name }}
{%- elif states(last_click) == "pressbuttonpage04button07" -%} {{ entity31_name }}
{%- elif states(last_click) == "pressbuttonpage04button08" -%} {{ entity32_name }}
{%- elif states(last_click) == "pressbuttonleft" -%} {{ left_button_name }}
{%- elif states(last_click) == "pressbuttonright" -%} {{ right_button_name }}
{%- if settings_entity_value != "unknown" -%} {{ settings_entity_value.split(',')[2] }}
{%- else -%} unknown
{%- endif -%}
entity_back: >-
{%- if settings_entity_value != "unknown" -%} {{ settings_entity_value.split(',')[1] }}
{%- else -%} unknown
{%- 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) == "pressbuttonleft" -%} {{ "page home" }}
{%- elif states(last_click) == "pressbuttonright" -%} {{ "page home" }}
{%- endif -%}
########################################################################################################################
@@ -3658,7 +3612,7 @@ action:
##### Update home-buttons on automation-reload only #####
- if:
- condition: template
value_template: '{{ states(current_page) == page_home }}'
value_template: '{{ trigger.id == "automation_reloaded" and states(current_page) == page_home }}'
then:
###### QR Code - Icon ######
- if:
@@ -3694,10 +3648,34 @@ action:
data:
cmd: "homebt06_pic.pic={{ home_button_blank }}"
##### NSPanel Left Button Name #####
- if:
- condition: template
value_template: '{{ left_button_name |length > 0 }}'
then:
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}"
data:
component: home.left_bt_text
message: "{{ left_button_name }}"
##### NSPanel Right Button Name #####
- if:
- condition: template
value_template: '{{ right_button_name |length > 0 }}'
then:
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}"
data:
component: home.right_bt_text
message: "{{ right_button_name }}"
##### NSPanel boot init only #####
- if:
- condition: template
value_template: '{{ trigger.id == "nspanel_boot_init" }}'
value_template: '{{ trigger.id == "nspanel_boot_init" and states(current_page) != page_home }}'
then:
###### INIT Notify ######
- service: "{{ command_notification_clear }}"
@@ -4145,7 +4123,8 @@ action:
##### LIGHTSETTINGS PAGE - LIGHT Entity #####
- conditions:
- condition: template
value_template: '{{ entity_long is match "light." }}'
# value_template: '{{ entity_long is match "light." }}' TODO
value_template: '{{ states(current_page) == page_lightsettings }}'
sequence:
- choose:
##### LIGHT ON / OFF
@@ -4265,7 +4244,8 @@ action:
##### COVERSETTINGS PAGE - COVER Entity #####
- conditions:
- condition: template
value_template: '{{ entity_long is match "cover." }}'
# value_template: '{{ entity_long is match "cover." }}' TODO
value_template: '{{ states(current_page) == page_coversettings }}'
sequence:
##### COVER OPEN #####
- choose:
@@ -4538,179 +4518,85 @@ action:
- condition: trigger
id: long_press
sequence:
- choose:
##### LONG Press - LIGHT Entity #####
- conditions:
- condition: template
value_template: '{{ entity_long is match "light." }}'
sequence:
##### LIGHT Generel Values #####
- service: "{{ command_printf }}"
data:
cmd: page lightsettings
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}"
data:
component: lightsettings.light_name
message: '{{ entity_long_name }}'
- delay:
milliseconds: "{{ delay_value }}"
- if:
- condition: template
value_template: "{{ state_attr(entity_long, 'brightness') != none }}"
then:
- service: "{{ command_value }}"
data:
component: lightsettings.lightslider
message: '{{ (state_attr(entity_long, "brightness") | int ) |round(0) }}'
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}"
data:
component: lightsettings.light_value
message: '{{ (state_attr(entity_long, "brightness") | int * 100 /255) | round(0) }}%'
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}"
data:
component: lightsettings.light_value_2
message: '{{ (state_attr(entity_long, "brightness") | int * 100 /255) | round(0) }}%'
else:
- service: "{{ command_value }}"
data:
component: lightsettings.lightslider
message: '0'
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}"
data:
component: lightsettings.light_value
message: '0 %'
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}"
data:
component: lightsettings.light_value_2
message: '0 %'
##### LIGHT Check Color_Temp Value is available when yes send some current Values #####
- if:
- condition: template
value_template: "{{ state_attr(entity_long, 'color_temp') != none }}"
then:
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}"
data:
component: lightsettings.temp_value
message: '{{ (state_attr(entity_long, "color_temp") | int ) |round(0) }}'
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}"
data:
component: lightsettings.temp_value_2
message: '{{ (state_attr(entity_long, "color_temp") | int ) |round(0) }}'
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_value }}"
data:
component: lightsettings.tempslider
message: '{{ (state_attr(entity_long, "color_temp") | int ) |round(0) }}'
##### LIGHT ON / OFF #####
- choose:
##### LIGHT PIC - ON #####
- conditions:
- condition: template
value_template: '{{ states(entity_long) == "on" }}'
sequence:
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_printf }}"
data:
cmd: lightsettings.light_status.pic={{ light_pic_on }}
##### LIGHT PIC - OFF #####
- conditions:
- condition: template
value_template: '{{ states(entity_long) == "off" }}'
sequence:
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_printf }}"
data:
cmd: lightsettings.light_status.pic={{ light_pic_off }}
##### LONG Press - COVER Entity #####
- conditions:
- condition: template
value_template: '{{ entity_long is match "cover." }}'
sequence:
##### COVER Generel Values #####
- service: "{{ command_printf }}"
data:
cmd: page coversettings
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_value }}"
data:
component: coversettings.coverslider
message: '{{ (state_attr(entity_long, "current_position") | int ) |round(0) }}'
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}"
data:
component: coversettings.cover_value
message: '{{ (state_attr(entity_long, "current_position") | int ) |round(0) }} %'
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}"
data:
component: coversettings.cover_name
message: '{{ entity_long_name }}'
##### COVER Battery ICON Yes / NO #####
- if:
- condition: template
value_template: "{{ state_attr(entity_long, 'battery') != none }}"
then:
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}"
data:
component: coversettings.battery_value
message: '{{ (state_attr(entity_long, "battery") | int ) |round(0) }} %'
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_printf }}"
data:
cmd: coversettings.battery_icon.pic={{ battery_icon }}
- variables:
##### Long Press Entity #####
entity_long: >-
{%- if trigger.to_state.state == "pressbuttonpage01button01" -%} {{ entity01 }}
{%- elif trigger.to_state.state == "pressbuttonpage01button02" -%} {{ entity02 }}
{%- elif trigger.to_state.state == "pressbuttonpage01button03" -%} {{ entity03 }}
{%- elif trigger.to_state.state == "pressbuttonpage01button04" -%} {{ entity04 }}
{%- elif trigger.to_state.state == "pressbuttonpage01button05" -%} {{ entity05 }}
{%- elif trigger.to_state.state == "pressbuttonpage01button06" -%} {{ entity06 }}
{%- elif trigger.to_state.state == "pressbuttonpage01button07" -%} {{ entity07 }}
{%- elif trigger.to_state.state == "pressbuttonpage01button08" -%} {{ entity08 }}
{%- elif trigger.to_state.state == "pressbuttonpage02button01" -%} {{ entity09 }}
{%- elif trigger.to_state.state == "pressbuttonpage02button02" -%} {{ entity10 }}
{%- elif trigger.to_state.state == "pressbuttonpage02button03" -%} {{ entity11 }}
{%- elif trigger.to_state.state == "pressbuttonpage02button04" -%} {{ entity12 }}
{%- elif trigger.to_state.state == "pressbuttonpage02button05" -%} {{ entity13 }}
{%- elif trigger.to_state.state == "pressbuttonpage02button06" -%} {{ entity14 }}
{%- elif trigger.to_state.state == "pressbuttonpage02button07" -%} {{ entity15 }}
{%- elif trigger.to_state.state == "pressbuttonpage02button08" -%} {{ entity16 }}
{%- elif trigger.to_state.state == "pressbuttonpage03button01" -%} {{ entity17 }}
{%- elif trigger.to_state.state == "pressbuttonpage03button02" -%} {{ entity18 }}
{%- elif trigger.to_state.state == "pressbuttonpage03button03" -%} {{ entity19 }}
{%- elif trigger.to_state.state == "pressbuttonpage03button04" -%} {{ entity20 }}
{%- elif trigger.to_state.state == "pressbuttonpage03button05" -%} {{ entity21 }}
{%- elif trigger.to_state.state == "pressbuttonpage03button06" -%} {{ entity22 }}
{%- elif trigger.to_state.state == "pressbuttonpage03button07" -%} {{ entity23 }}
{%- elif trigger.to_state.state == "pressbuttonpage03button08" -%} {{ entity24 }}
{%- elif trigger.to_state.state == "pressbuttonpage04button01" -%} {{ entity25 }}
{%- elif trigger.to_state.state == "pressbuttonpage04button02" -%} {{ entity26 }}
{%- elif trigger.to_state.state == "pressbuttonpage04button03" -%} {{ entity27 }}
{%- elif trigger.to_state.state == "pressbuttonpage04button04" -%} {{ entity28 }}
{%- elif trigger.to_state.state == "pressbuttonpage04button05" -%} {{ entity29 }}
{%- elif trigger.to_state.state == "pressbuttonpage04button06" -%} {{ entity30 }}
{%- elif trigger.to_state.state == "pressbuttonpage04button07" -%} {{ entity31 }}
{%- elif trigger.to_state.state == "pressbuttonpage04button08" -%} {{ entity32 }}
{%- endif -%}
##### COVER OPEN / CLOSE
- choose:
##### COVER PIC - open #####
- conditions:
- condition: template
value_template: '{{ states(entity_long) == "open" }}'
sequence:
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_printf }}"
data:
cmd: coversettings.cover_status.pic={{ cover_pic_open }}
##### COVER PIC - Closed
- conditions:
- condition: template
value_template: '{{ states(entity_long) == "closed" }}'
sequence:
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_printf }}"
data:
cmd: coversettings.cover_status.pic={{ cover_pic_closed }}
##### Long Press Entity Name #####
entity_long_name: >-
{%- if trigger.to_state.state == "pressbuttonpage01button01" -%} {{ entity01_name }}
{%- elif trigger.to_state.state == "pressbuttonpage01button02" -%} {{ entity02_name }}
{%- elif trigger.to_state.state == "pressbuttonpage01button03" -%} {{ entity03_name }}
{%- elif trigger.to_state.state == "pressbuttonpage01button04" -%} {{ entity04_name }}
{%- elif trigger.to_state.state == "pressbuttonpage01button05" -%} {{ entity05_name }}
{%- elif trigger.to_state.state == "pressbuttonpage01button06" -%} {{ entity06_name }}
{%- elif trigger.to_state.state == "pressbuttonpage01button07" -%} {{ entity07_name }}
{%- elif trigger.to_state.state == "pressbuttonpage01button08" -%} {{ entity08_name }}
{%- elif trigger.to_state.state == "pressbuttonpage02button01" -%} {{ entity09_name }}
{%- elif trigger.to_state.state == "pressbuttonpage02button02" -%} {{ entity10_name }}
{%- elif trigger.to_state.state == "pressbuttonpage02button03" -%} {{ entity11_name }}
{%- elif trigger.to_state.state == "pressbuttonpage02button04" -%} {{ entity12_name }}
{%- elif trigger.to_state.state == "pressbuttonpage02button05" -%} {{ entity13_name }}
{%- elif trigger.to_state.state == "pressbuttonpage02button06" -%} {{ entity14_name }}
{%- elif trigger.to_state.state == "pressbuttonpage02button07" -%} {{ entity15_name }}
{%- elif trigger.to_state.state == "pressbuttonpage02button08" -%} {{ entity16_name }}
{%- elif trigger.to_state.state == "pressbuttonpage03button01" -%} {{ entity17_name }}
{%- elif trigger.to_state.state == "pressbuttonpage03button02" -%} {{ entity18_name }}
{%- elif trigger.to_state.state == "pressbuttonpage03button03" -%} {{ entity19_name }}
{%- elif trigger.to_state.state == "pressbuttonpage03button04" -%} {{ entity20_name }}
{%- elif trigger.to_state.state == "pressbuttonpage03button05" -%} {{ entity21_name }}
{%- elif trigger.to_state.state == "pressbuttonpage03button06" -%} {{ entity22_name }}
{%- elif trigger.to_state.state == "pressbuttonpage03button07" -%} {{ entity23_name }}
{%- elif trigger.to_state.state == "pressbuttonpage03button08" -%} {{ entity24_name }}
{%- elif trigger.to_state.state == "pressbuttonpage04button01" -%} {{ entity25_name }}
{%- elif trigger.to_state.state == "pressbuttonpage04button02" -%} {{ entity26_name }}
{%- elif trigger.to_state.state == "pressbuttonpage04button03" -%} {{ entity27_name }}
{%- elif trigger.to_state.state == "pressbuttonpage04button04" -%} {{ entity28_name }}
{%- elif trigger.to_state.state == "pressbuttonpage04button05" -%} {{ entity29_name }}
{%- elif trigger.to_state.state == "pressbuttonpage04button06" -%} {{ entity30_name }}
{%- elif trigger.to_state.state == "pressbuttonpage04button07" -%} {{ entity31_name }}
{%- elif trigger.to_state.state == "pressbuttonpage04button08" -%} {{ entity32_name }}
{%- endif -%}
##### Current Page #####
entity_back: '{{ states(current_page) }}'
- service: '{{ command_set_settings_entity }}'
data:
entity: '{{ entity_long }},{{ entity_back }},{{ entity_long_name }}'
##### LASTCLICK_LIGHTSETTINGS - Changes on page Light-Settings #####
- conditions:
- condition: trigger
@@ -4776,9 +4662,12 @@ action:
- condition: template
value_template: '{{ trigger.event.data.new_state.state == "releaselightsettingsclose" }}'
sequence:
- service: '{{ command_set_settings_entity }}'
data:
entity: 'unknown'
- service: "{{ command_printf }}"
data:
cmd: "{{ entity_back }}"
cmd: "page {{ entity_back }}"
##### LASTCLICK_COVERSETTINGS - Changes on page Cover-Settings #####
- conditions:
@@ -4840,9 +4729,12 @@ action:
- condition: template
value_template: '{{ trigger.event.data.new_state.state == "releasecoversettingsclose" }}'
sequence:
- service: '{{ command_set_settings_entity }}'
data:
entity: 'unknown'
- service: "{{ command_printf }}"
data:
cmd: "{{ entity_back }}"
cmd: "page {{ entity_back }}"
##### LASTCLICK_CLIMATESETTINGS - Changes on page Climate-Settings #####
- conditions:
@@ -4998,36 +4890,59 @@ action:
##### Left button press #####
- conditions:
- condition: trigger
id: left_button_press
- condition: template
value_template: '{{ left_button_entity |length > 0 }}'
id: left_button_press
sequence:
- service: >-
{% if left_button_entity is match 'light.' %}
light.toggle
{% elif left_button_entity is match 'switch.' %}
switch.toggle
{% elif left_button_entity is match 'cover.' %}
cover.toggle
{% elif left_button_entity is match 'input_boolean.' %}
input_boolean.toggle
{% elif left_button_entity is match 'automation.' %}
automation.toggle
{% elif left_button_entity is match 'button.' %}
button.press
{% elif left_button_entity is match 'input_button.' %}
input_button.press
{% elif left_button_entity is match 'scene.' %}
scene.turn_on
{% elif left_button_entity is match 'script.' %}
script.turn_on
{% elif left_button_entity is match 'fan.' %}
fan.toggle
{% endif %}
data:
entity_id: "{{ left_button_entity }}"
- delay:
milliseconds: "{{ delay_value }}"
- wait_template: "{{ is_state(left_button, 'off') }}"
timeout: !input hold_delay
continue_on_timeout: true
- if:
- condition: template
value_template: "{{ not wait.completed }}"
then: # Hold
- choose:
- conditions: '{{ left_button_hold_select == "Default" and left_button_entity |length > 0 }}'
sequence:
- variables:
entity_long: '{{ left_button_entity }}'
entity_long_name: >-
{%- if left_button_name |length > 0 -%} {{ left_button_name }}
{%- elif states(left_button_entity) == 'unavailable' -%} {{ left_button_entity }}
{%- else -%} {{ state_attr(left_button_entity, "friendly_name")| default('no name') }}
{%- endif -%}
entity_back: '{{ page_home }}'
- service: '{{ command_set_settings_entity }}'
data:
entity: '{{ entity_long }},{{ entity_back }},{{ entity_long_name }}'
- conditions: '{{ left_button_hold_select == "Custom Action" }}'
sequence: !input left_button_hold_custom_action
else: # Single Click
- condition: template
value_template: '{{ left_button_entity |length > 0 }}'
- service: >-
{% if left_button_entity is match 'light.' %}
light.toggle
{% elif left_button_entity is match 'switch.' %}
switch.toggle
{% elif left_button_entity is match 'cover.' %}
cover.toggle
{% elif left_button_entity is match 'input_boolean.' %}
input_boolean.toggle
{% elif left_button_entity is match 'automation.' %}
automation.toggle
{% elif left_button_entity is match 'button.' %}
button.press
{% elif left_button_entity is match 'input_button.' %}
input_button.press
{% elif left_button_entity is match 'scene.' %}
scene.turn_on
{% elif left_button_entity is match 'script.' %}
script.turn_on
{% elif left_button_entity is match 'fan.' %}
fan.toggle
{% endif %}
data:
entity_id: "{{ left_button_entity }}"
##### Left button State #####
- conditions:
@@ -5052,33 +4967,59 @@ action:
- conditions:
- condition: trigger
id: right_button_press
- condition: template
value_template: '{{ right_button_entity |length > 0 }}'
sequence:
- service: >-
{% if right_button_entity is match 'light.' %}
light.toggle
{% elif right_button_entity is match 'switch.' %}
switch.toggle
{% elif right_button_entity is match 'cover.' %}
cover.toggle
{% elif right_button_entity is match 'input_boolean.' %}
input_boolean.toggle
{% elif right_button_entity is match 'automation.' %}
automation.toggle
{% elif right_button_entity is match 'button.' %}
button.press
{% elif right_button_entity is match 'input_button.' %}
input_button.press
{% elif right_button_entity is match 'scene.' %}
scene.turn_on
{% elif right_button_entity is match 'script.' %}
script.turn_on
{% elif right_button_entity is match 'fan.' %}
fan.toggle
{% endif %}
data:
entity_id: "{{ right_button_entity }}"
- wait_template: "{{ is_state(right_button, 'off') }}"
timeout: !input hold_delay
continue_on_timeout: true
- if:
- condition: template
value_template: "{{ not wait.completed }}"
then: # Hold
- choose:
- conditions: '{{ right_button_hold_select == "Default" and right_button_entity |length > 0 }}'
sequence:
- variables:
entity_long: '{{ right_button_entity }}'
entity_long_name: >-
{%- if right_button_name |length > 0 -%} {{ right_button_name }}
{%- elif states(right_button_entity) == 'unavailable' -%} {{ right_button_entity }}
{%- else -%} {{ state_attr(right_button_entity, "friendly_name")| default('no name') }}
{%- endif -%}
entity_back: '{{ page_home }}'
- service: '{{ command_set_settings_entity }}'
data:
entity: '{{ entity_long }},{{ entity_back }},{{ entity_long_name }}'
- conditions: '{{ right_button_hold_select == "Custom Action" }}'
sequence: !input right_button_hold_custom_action
else: # Single Click
- condition: template
value_template: '{{ right_button_entity |length > 0 }}'
- service: >-
{% if right_button_entity is match 'light.' %}
light.toggle
{% elif right_button_entity is match 'switch.' %}
switch.toggle
{% elif right_button_entity is match 'cover.' %}
cover.toggle
{% elif right_button_entity is match 'input_boolean.' %}
input_boolean.toggle
{% elif right_button_entity is match 'automation.' %}
automation.toggle
{% elif right_button_entity is match 'button.' %}
button.press
{% elif right_button_entity is match 'input_button.' %}
input_button.press
{% elif right_button_entity is match 'scene.' %}
scene.turn_on
{% elif right_button_entity is match 'script.' %}
script.turn_on
{% elif right_button_entity is match 'fan.' %}
fan.toggle
{% endif %}
data:
entity_id: "{{ right_button_entity }}"
##### Right button State #####
- conditions:
@@ -6802,10 +6743,158 @@ action:
## PAGE LIGHTSETTUNGS ##
- conditions: '{{ trigger.event.data.new_state.state == page_lightsettings }}'
sequence:
- service: "{{ command_text_printf }}"
data:
component: lightsettings.light_name
message: '{{ entity_long_name }}'
- delay:
milliseconds: "{{ delay_value }}"
- if:
- condition: template
value_template: "{{ state_attr(entity_long, 'brightness') != none }}"
then:
- service: "{{ command_value }}"
data:
component: lightsettings.lightslider
message: '{{ (state_attr(entity_long, "brightness") | int ) |round(0) }}'
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}"
data:
component: lightsettings.light_value
message: '{{ (state_attr(entity_long, "brightness") | int * 100 /255) | round(0) }}%'
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}"
data:
component: lightsettings.light_value_2
message: '{{ (state_attr(entity_long, "brightness") | int * 100 /255) | round(0) }}%'
else:
- service: "{{ command_value }}"
data:
component: lightsettings.lightslider
message: '0'
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}"
data:
component: lightsettings.light_value
message: '0 %'
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}"
data:
component: lightsettings.light_value_2
message: '0 %'
##### LIGHT Check Color_Temp Value is available when yes send some current Values #####
- if:
- condition: template
value_template: "{{ state_attr(entity_long, 'color_temp') != none }}"
then:
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}"
data:
component: lightsettings.temp_value
message: '{{ (state_attr(entity_long, "color_temp") | int ) |round(0) }}'
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}"
data:
component: lightsettings.temp_value_2
message: '{{ (state_attr(entity_long, "color_temp") | int ) |round(0) }}'
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_value }}"
data:
component: lightsettings.tempslider
message: '{{ (state_attr(entity_long, "color_temp") | int ) |round(0) }}'
##### LIGHT ON / OFF #####
- choose:
##### LIGHT PIC - ON #####
- conditions:
- condition: template
value_template: '{{ states(entity_long) == "on" }}'
sequence:
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_printf }}"
data:
cmd: lightsettings.light_status.pic={{ light_pic_on }}
##### LIGHT PIC - OFF #####
- conditions:
- condition: template
value_template: '{{ states(entity_long) == "off" }}'
sequence:
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_printf }}"
data:
cmd: lightsettings.light_status.pic={{ light_pic_off }}
## PAGE COVERSETTINGS ##
- conditions: '{{ trigger.event.data.new_state.state == page_coversettings }}'
sequence:
- service: "{{ command_value }}"
data:
component: coversettings.coverslider
message: '{{ (state_attr(entity_long, "current_position") | int ) |round(0) }}'
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}"
data:
component: coversettings.cover_value
message: '{{ (state_attr(entity_long, "current_position") | int ) |round(0) }} %'
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}"
data:
component: coversettings.cover_name
message: '{{ entity_long_name }}'
##### COVER Battery ICON Yes / NO #####
- if:
- condition: template
value_template: "{{ state_attr(entity_long, 'battery') != none }}"
then:
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_text_printf }}"
data:
component: coversettings.battery_value
message: '{{ (state_attr(entity_long, "battery") | int ) |round(0) }} %'
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_printf }}"
data:
cmd: coversettings.battery_icon.pic={{ battery_icon }}
##### COVER OPEN / CLOSE
- choose:
##### COVER PIC - open #####
- conditions:
- condition: template
value_template: '{{ states(entity_long) == "open" }}'
sequence:
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_printf }}"
data:
cmd: coversettings.cover_status.pic={{ cover_pic_open }}
##### COVER PIC - Closed
- conditions:
- condition: template
value_template: '{{ states(entity_long) == "closed" }}'
sequence:
- delay:
milliseconds: "{{ delay_value }}"
- service: "{{ command_printf }}"
data:
cmd: coversettings.cover_status.pic={{ cover_pic_closed }}
## PAGE BUTTONPAGE01 ##
- conditions: '{{ trigger.event.data.new_state.state == page_buttonpage01 }}'
@@ -7325,6 +7414,26 @@ action:
data:
cmd: home.icon_top_03.pic={{ top_menu_climate }}
##### Settings Entity changed -> open settings-page #####
- conditions:
- condition: trigger
id: settings_entity
- condition: template
value_template: "{{ trigger.event.data.new_state.state != 'unknown' }}"
sequence:
- choose:
- conditions: '{{ entity_long is match "light." }}'
sequence:
- service: "{{ command_printf }}"
data:
cmd: "page {{ page_lightsettings }}"
- conditions: '{{ entity_long is match "cover." }}'
sequence:
- service: "{{ command_printf }}"
data:
cmd: "page {{ page_coversettings }}"
- conditions: '{{ entity_long is match "climate." }}'
sequence: []
#############################################################

View File

@@ -161,7 +161,7 @@ api:
- lambda: 'id(disp1).set_component_value(component.c_str(), message);'
##### Service to send a command "hide componente" directly to the display #####
- service: send_command_hide
- service: send_command_hide ### unused ###
variables:
component: string
then:
@@ -170,7 +170,7 @@ api:
- lambda: 'id(disp1).hide_component(component.c_str());'
##### Service to send a command "show componente" directly to the display #####
- service: send_command_show
- service: send_command_show ### unused ###
variables:
component: string
then:
@@ -229,6 +229,16 @@ api:
id(notification_text).publish_state("");
- switch.turn_off: notification_unread
##### Service to set entity-information for settings-page(s)
- service: set_settings_entity
variables:
entity: string
then:
- wait_until:
switch.is_on: nextion_init
- lambda: |-
id(settings_entity).publish_state(entity.c_str());
##### Service to play a rtttl tones #####
# Example tones : https://codebender.cc/sketch:109888#RTTTL%20Songs.ino
- service: play_rtttl
@@ -338,18 +348,13 @@ binary_sensor:
###### LEFT BUTTON BELOW DISPLAY TO TOGGLE RELAY#####
- platform: gpio
# name: ${device_name} Left Button
name: ${device_name} Left Button
id: left_button
pin:
number: 14
inverted: true
on_click:
- min_length: 50ms
max_length: 1000ms
then:
- binary_sensor.template.publish:
id: left_button_short
state: ON
- if:
condition:
and:
@@ -365,50 +370,17 @@ binary_sensor:
switch.is_on: relay_1
then:
- lambda: id(disp1).send_command_printf("home.icon_top_01.pic=105");
- delay: 500ms
- binary_sensor.template.publish:
id: left_button_short
state: OFF
on_press:
then:
- lambda: |-
if (id(disp1_currentpage).state == "lightsettings" or id(disp1_currentpage).state == "coversettings") {
ESP_LOGD("nspanel", "settingspage -> no press");
} else {
// ESP_LOGD("nspanel", "release button");
id(disp1_lastclick_general).set_state("pressbuttonleft",true,true);
}
on_release:
then:
- lambda: |-
if (id(disp1_currentpage).state == "lightsettings" or id(disp1_currentpage).state == "coversettings") {
ESP_LOGD("nspanel", "settingspage -> no release");
} else {
// ESP_LOGD("nspanel", "release button");
id(disp1_lastclick_general).set_state("releasebuttonleft",true,true);
}
- platform: template
name: ${device_name} Left Button
id: left_button_short
lambda: |-
return {};
##### RIGHT BUTTON BELOW DISPLAY TO TOGGLE RELAY #####
- platform: gpio
# name: ${device_name} Right Button
name: ${device_name} Right Button
id: right_button
pin:
number: 27
inverted: true
on_click:
- min_length: 50ms
max_length: 1000ms
then:
- binary_sensor.template.publish:
id: right_button_short
state: ON
- if:
condition:
and:
@@ -424,34 +396,6 @@ binary_sensor:
switch.is_on: relay_2
then:
- lambda: id(disp1).send_command_printf("home.icon_top_02.pic=106");
- delay: 500ms
- binary_sensor.template.publish:
id: right_button_short
state: OFF
on_press:
then:
- lambda: |-
if (id(disp1_currentpage).state == "lightsettings" or id(disp1_currentpage).state == "coversettings") {
ESP_LOGD("nspanel", "settingspage -> no press");
} else {
// ESP_LOGD("nspanel", "release button");
id(disp1_lastclick_general).set_state("pressbuttonright",true,true);
}
on_release:
then:
- lambda: |-
if (id(disp1_currentpage).state == "lightsettings" or id(disp1_currentpage).state == "coversettings") {
ESP_LOGD("nspanel", "settingspage -> no release");
} else {
// ESP_LOGD("nspanel", "release button");
id(disp1_lastclick_general).set_state("releasebuttonright",true,true);
}
- platform: template
name: ${device_name} Right Button
id: right_button_short
lambda: |-
return {};
##### Restart NSPanel Button - Setting Page #####
- platform: nextion
@@ -616,6 +560,10 @@ text_sensor:
name: ${device_name} Notification Text
id: notification_text
- platform: template
name: ${device_name} Settings Entity
id: settings_entity
##### last click sensor, the main action variable - push to HA #####
- platform: nextion
nextion_id: disp1
@@ -950,11 +898,11 @@ display:
on_setup:
then:
- lambda: id(disp1).send_command_printf("page 8");
- lambda: id(disp1).set_component_text_printf("boot.esph_version", "%s", "3.1.0"); ### esphome-version ###
- lambda: id(disp1).set_component_text_printf("boot.esph_version", "%s", "3.1.1"); ### esphome-version ###
- wait_until:
api.connected
- lambda: id(disp1).set_component_text_printf("boot.ip_addr", "%s", id(ip_address).state.c_str());
- delay: 0.5s
- delay: 1s
- number.set:
id: display_brightness
value: !lambda 'return id(display_brightness_global);'
@@ -967,7 +915,7 @@ display:
- 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", id(sleep_modus_global) == 1);
- delay: 0.5s
- delay: 1s
- switch.template.publish:
id: nextion_init
state: on