Standardize yaml
To improve readability. No changes in the code.
This commit is contained in:
@@ -122,13 +122,13 @@ uart:
|
|||||||
##### START - BUTTON CONFIGURATION #####
|
##### START - BUTTON CONFIGURATION #####
|
||||||
button:
|
button:
|
||||||
###### REBOOT BUTTON #####
|
###### REBOOT BUTTON #####
|
||||||
- platform: restart
|
- name: ${device_name} Restart
|
||||||
name: ${device_name} Restart
|
platform: restart
|
||||||
id: restart_nspanel
|
id: restart_nspanel
|
||||||
|
|
||||||
##### UPDATE TFT DISPLAY #####
|
##### UPDATE TFT DISPLAY #####
|
||||||
- platform: template
|
- name: ${device_name} Update TFT display
|
||||||
name: ${device_name} Update TFT display
|
platform: template
|
||||||
icon: mdi:file-sync
|
icon: mdi:file-sync
|
||||||
id: tft_update
|
id: tft_update
|
||||||
entity_category: config
|
entity_category: config
|
||||||
@@ -138,8 +138,8 @@ button:
|
|||||||
- lambda: id(disp1).upload_tft();
|
- lambda: id(disp1).upload_tft();
|
||||||
|
|
||||||
##### EXIT REPARSE TFT DISPLAY #####
|
##### EXIT REPARSE TFT DISPLAY #####
|
||||||
- platform: template
|
- name: ${device_name} Exit reparse
|
||||||
name: ${device_name} Exit reparse
|
platform: template
|
||||||
icon: mdi:file-sync
|
icon: mdi:file-sync
|
||||||
id: tft_reparse_off
|
id: tft_reparse_off
|
||||||
entity_category: config
|
entity_category: config
|
||||||
@@ -419,8 +419,8 @@ globals:
|
|||||||
binary_sensor:
|
binary_sensor:
|
||||||
|
|
||||||
###### LEFT BUTTON BELOW DISPLAY TO TOGGLE RELAY#####
|
###### LEFT BUTTON BELOW DISPLAY TO TOGGLE RELAY#####
|
||||||
- platform: gpio
|
- name: ${device_name} Left Button
|
||||||
name: ${device_name} Left Button
|
platform: gpio
|
||||||
id: left_button
|
id: left_button
|
||||||
pin:
|
pin:
|
||||||
number: 14
|
number: 14
|
||||||
@@ -445,10 +445,9 @@ binary_sensor:
|
|||||||
- lambda: id(disp1).send_command_printf("home.left_bt_pic.pic=77");
|
- lambda: id(disp1).send_command_printf("home.left_bt_pic.pic=77");
|
||||||
- lambda: id(disp1).send_command_printf("home.icon_top_01","\U0000FFFF");
|
- lambda: id(disp1).send_command_printf("home.icon_top_01","\U0000FFFF");
|
||||||
|
|
||||||
|
|
||||||
##### RIGHT BUTTON BELOW DISPLAY TO TOGGLE RELAY #####
|
##### RIGHT BUTTON BELOW DISPLAY TO TOGGLE RELAY #####
|
||||||
- platform: gpio
|
- name: ${device_name} Right Button
|
||||||
name: ${device_name} Right Button
|
platform: gpio
|
||||||
id: right_button
|
id: right_button
|
||||||
pin:
|
pin:
|
||||||
number: 27
|
number: 27
|
||||||
@@ -474,8 +473,8 @@ binary_sensor:
|
|||||||
- lambda: id(disp1).send_command_printf("home.icon_top_02","\U0000FFFF");
|
- lambda: id(disp1).send_command_printf("home.icon_top_02","\U0000FFFF");
|
||||||
|
|
||||||
##### JUMP PAGE TO SETTING PAGE #####
|
##### JUMP PAGE TO SETTING PAGE #####
|
||||||
- platform: nextion
|
- name: $device_name setting page
|
||||||
name: $device_name setting page
|
platform: nextion
|
||||||
page_id: 0
|
page_id: 0
|
||||||
component_id: 52
|
component_id: 52
|
||||||
internal: true
|
internal: true
|
||||||
@@ -486,8 +485,8 @@ binary_sensor:
|
|||||||
- lambda: 'id(disp1).send_command_printf("page settings");'
|
- lambda: 'id(disp1).send_command_printf("page settings");'
|
||||||
|
|
||||||
##### Restart NSPanel Button - Setting Page #####
|
##### Restart NSPanel Button - Setting Page #####
|
||||||
- platform: nextion
|
- name: ${device_name} Restart
|
||||||
name: ${device_name} Restart
|
platform: nextion
|
||||||
page_id: 7
|
page_id: 7
|
||||||
component_id: 13
|
component_id: 13
|
||||||
internal: true
|
internal: true
|
||||||
@@ -495,8 +494,8 @@ binary_sensor:
|
|||||||
- button.press: restart_nspanel
|
- button.press: restart_nspanel
|
||||||
|
|
||||||
##### Restart NSPanel Button - Boot Page #####
|
##### Restart NSPanel Button - Boot Page #####
|
||||||
- platform: nextion
|
- name: ${device_name} Restart
|
||||||
name: ${device_name} Restart
|
platform: nextion
|
||||||
page_id: 8
|
page_id: 8
|
||||||
component_id: 4
|
component_id: 4
|
||||||
internal: true
|
internal: true
|
||||||
@@ -504,8 +503,8 @@ binary_sensor:
|
|||||||
- button.press: restart_nspanel
|
- button.press: restart_nspanel
|
||||||
|
|
||||||
##### Sleep Modus NSPanel Button #####
|
##### Sleep Modus NSPanel Button #####
|
||||||
- platform: nextion
|
- name: ${device_name} Sleep Modus
|
||||||
name: ${device_name} Sleep Modus
|
platform: nextion
|
||||||
page_id: 7
|
page_id: 7
|
||||||
component_id: 14
|
component_id: 14
|
||||||
internal: true
|
internal: true
|
||||||
@@ -516,13 +515,13 @@ binary_sensor:
|
|||||||
sensor:
|
sensor:
|
||||||
|
|
||||||
##### Uptime #####
|
##### Uptime #####
|
||||||
- platform: uptime
|
- name: ${device_name} uptime
|
||||||
name: ${device_name} uptime
|
platform: uptime
|
||||||
disabled_by_default: true
|
disabled_by_default: true
|
||||||
|
|
||||||
##### WIFI Signal stregth
|
##### WIFI Signal stregth
|
||||||
- platform: wifi_signal
|
- name: ${device_name} RSSI
|
||||||
name: ${device_name} RSSI
|
platform: wifi_signal
|
||||||
update_interval: 60s
|
update_interval: 60s
|
||||||
on_value:
|
on_value:
|
||||||
- if:
|
- if:
|
||||||
@@ -534,22 +533,22 @@ sensor:
|
|||||||
- lambda: id(disp1).set_component_text_printf("home.wifi_icon", "%s", "\U0000FFFF");
|
- lambda: id(disp1).set_component_text_printf("home.wifi_icon", "%s", "\U0000FFFF");
|
||||||
|
|
||||||
##### INTERNAL TEMPERATURE SENSOR, ADC VALUE #####
|
##### INTERNAL TEMPERATURE SENSOR, ADC VALUE #####
|
||||||
- platform: adc
|
- id: ntc_source
|
||||||
id: ntc_source
|
platform: adc
|
||||||
pin: 38
|
pin: 38
|
||||||
update_interval: 60s
|
update_interval: 60s
|
||||||
attenuation: 11db
|
attenuation: 11db
|
||||||
|
|
||||||
##### INTERNAL TEMPERATURE SENSOR, adc reading converted to resistance (calculation)#####
|
##### INTERNAL TEMPERATURE SENSOR, adc reading converted to resistance (calculation)#####
|
||||||
- platform: resistance
|
- id: resistance_sensor
|
||||||
id: resistance_sensor
|
platform: resistance
|
||||||
sensor: ntc_source
|
sensor: ntc_source
|
||||||
configuration: DOWNSTREAM
|
configuration: DOWNSTREAM
|
||||||
resistor: 11.2kOhm
|
resistor: 11.2kOhm
|
||||||
|
|
||||||
##### INTERNAL TEMPERATURE SENSOR, resistance to temperature (calculation) #####
|
##### INTERNAL TEMPERATURE SENSOR, resistance to temperature (calculation) #####
|
||||||
- platform: ntc
|
- name: ${device_name} Temperature
|
||||||
name: ${device_name} Temperature
|
platform: ntc
|
||||||
id: temp_nspanel
|
id: temp_nspanel
|
||||||
sensor: resistance_sensor
|
sensor: resistance_sensor
|
||||||
calibration:
|
calibration:
|
||||||
@@ -566,16 +565,16 @@ sensor:
|
|||||||
# - lambda: id(disp1).set_component_text_printf("climate.current_temp", "%.1f", id(temp_nspanel).state);
|
# - lambda: id(disp1).set_component_text_printf("climate.current_temp", "%.1f", id(temp_nspanel).state);
|
||||||
|
|
||||||
##### current value of page-climate target_temp #####
|
##### current value of page-climate target_temp #####
|
||||||
- platform: template
|
- name: ${device_name} Display Target Temperature
|
||||||
name: ${device_name} Display Target Temperature
|
platform: template
|
||||||
id: display_target_temp
|
id: display_target_temp
|
||||||
lambda: return {};
|
lambda: return {};
|
||||||
update_interval: 10s
|
update_interval: 10s
|
||||||
|
|
||||||
###### Display Brightness GET VALUE FROM NSPanel SLIDER #####
|
###### Display Brightness GET VALUE FROM NSPanel SLIDER #####
|
||||||
- platform: nextion
|
- name: ${device_name} brightness Slider
|
||||||
|
platform: nextion
|
||||||
id: brightslider
|
id: brightslider
|
||||||
name: ${device_name} brightness Slider
|
|
||||||
variable_name: brightslider
|
variable_name: brightslider
|
||||||
internal: true
|
internal: true
|
||||||
on_value:
|
on_value:
|
||||||
@@ -589,9 +588,9 @@ sensor:
|
|||||||
- 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));
|
||||||
|
|
||||||
###### Display DIM Brightness GET VALUE FROM NSPanel SLIDER #####
|
###### Display DIM Brightness GET VALUE FROM NSPanel SLIDER #####
|
||||||
- platform: nextion
|
- name: ${device_name} dim brightness slider
|
||||||
|
platform: nextion
|
||||||
id: dimslider
|
id: dimslider
|
||||||
name: ${device_name} dim brightness slider
|
|
||||||
variable_name: dimslider
|
variable_name: dimslider
|
||||||
internal: true
|
internal: true
|
||||||
on_value:
|
on_value:
|
||||||
@@ -624,22 +623,22 @@ text_sensor:
|
|||||||
name: ${device_name} BSSID
|
name: ${device_name} BSSID
|
||||||
disabled_by_default: true
|
disabled_by_default: true
|
||||||
|
|
||||||
- platform: template
|
- name: ${device_name} Notification Label
|
||||||
name: ${device_name} Notification Label
|
platform: template
|
||||||
id: notification_label
|
id: notification_label
|
||||||
|
|
||||||
- platform: template
|
- name: ${device_name} Notification Text
|
||||||
name: ${device_name} Notification Text
|
platform: template
|
||||||
id: notification_text
|
id: notification_text
|
||||||
|
|
||||||
- platform: template
|
- name: ${device_name} Settings Entity
|
||||||
name: ${device_name} Settings Entity
|
platform: template
|
||||||
id: settings_entity
|
id: settings_entity
|
||||||
|
|
||||||
##### NSPanel event sensor, the main action sensor - push to HA #####
|
##### NSPanel event sensor, the main action sensor - push to HA #####
|
||||||
- platform: nextion
|
- name: ${device_name} NSPanel event
|
||||||
|
platform: nextion
|
||||||
nextion_id: disp1
|
nextion_id: disp1
|
||||||
name: ${device_name} NSPanel event
|
|
||||||
id: disp1_nspanel_event
|
id: disp1_nspanel_event
|
||||||
component_name: nspanelevent
|
component_name: nspanelevent
|
||||||
internal: false
|
internal: false
|
||||||
@@ -654,10 +653,10 @@ text_sensor:
|
|||||||
id(page_timer)->execute(int(id(page_timeout).state));
|
id(page_timer)->execute(int(id(page_timeout).state));
|
||||||
|
|
||||||
##### touchevent sensor, Reset the page timeout #####
|
##### touchevent sensor, Reset the page timeout #####
|
||||||
- platform: nextion
|
- id: disp1_touchevent
|
||||||
|
platform: nextion
|
||||||
nextion_id: disp1
|
nextion_id: disp1
|
||||||
#name: ${device_name} touchevent
|
#name: ${device_name} touchevent
|
||||||
id: disp1_touchevent
|
|
||||||
component_name: touchevent
|
component_name: touchevent
|
||||||
internal: true
|
internal: true
|
||||||
filters:
|
filters:
|
||||||
@@ -674,8 +673,8 @@ text_sensor:
|
|||||||
switch:
|
switch:
|
||||||
|
|
||||||
##### global variable to keep track on whether the Nextion display is ready or not. Delays initial info from HA to the display #####
|
##### 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
|
||||||
name: ${device_name} Nextion inited
|
platform: template
|
||||||
id: nextion_init
|
id: nextion_init
|
||||||
entity_category: config
|
entity_category: config
|
||||||
restore_state: false
|
restore_state: false
|
||||||
@@ -683,46 +682,46 @@ switch:
|
|||||||
optimistic: true
|
optimistic: true
|
||||||
|
|
||||||
##### Notification unread #####
|
##### Notification unread #####
|
||||||
- platform: template
|
- name: ${device_name} Notification unread
|
||||||
name: ${device_name} Notification unread
|
platform: template
|
||||||
id: notification_unread
|
id: notification_unread
|
||||||
entity_category: config
|
entity_category: config
|
||||||
restore_state: true
|
restore_state: true
|
||||||
optimistic: true
|
optimistic: true
|
||||||
|
|
||||||
##### Notification sound #####
|
##### Notification sound #####
|
||||||
- platform: template
|
- name: ${device_name} Notification sound
|
||||||
name: ${device_name} Notification sound
|
platform: template
|
||||||
id: notification_sound
|
id: notification_sound
|
||||||
entity_category: config
|
entity_category: config
|
||||||
restore_state: true
|
restore_state: true
|
||||||
optimistic: true
|
optimistic: true
|
||||||
|
|
||||||
##### Confirmation Message #####
|
##### Confirmation Message #####
|
||||||
- platform: template
|
- name: ${device_name} Confirmation Message
|
||||||
name: ${device_name} Confirmation Message
|
platform: template
|
||||||
id: confirmation_message
|
id: confirmation_message
|
||||||
entity_category: config
|
entity_category: config
|
||||||
restore_state: false
|
restore_state: false
|
||||||
optimistic: true
|
optimistic: true
|
||||||
|
|
||||||
##### PHYSICAL SWITCH 1 #####
|
##### PHYSICAL SWITCH 1 #####
|
||||||
- platform: gpio
|
- name: ${device_name} Relay 1
|
||||||
name: ${device_name} Relay 1
|
platform: gpio
|
||||||
id: relay_1
|
id: relay_1
|
||||||
pin:
|
pin:
|
||||||
number: 22
|
number: 22
|
||||||
|
|
||||||
##### PHYSICAL SWITCH 2 ######
|
##### PHYSICAL SWITCH 2 ######
|
||||||
- platform: gpio
|
- name: ${device_name} Relay 2
|
||||||
name: ${device_name} Relay 2
|
platform: gpio
|
||||||
id: relay_2
|
id: relay_2
|
||||||
pin:
|
pin:
|
||||||
number: 19
|
number: 19
|
||||||
|
|
||||||
##### DISPLAY ALWAYS ON #####
|
##### DISPLAY ALWAYS ON #####
|
||||||
- platform: gpio
|
- name: ${device_name} Screen Power
|
||||||
name: ${device_name} Screen Power
|
platform: gpio
|
||||||
id: screen_power
|
id: screen_power
|
||||||
entity_category: config
|
entity_category: config
|
||||||
pin:
|
pin:
|
||||||
@@ -732,9 +731,9 @@ switch:
|
|||||||
internal: true
|
internal: true
|
||||||
|
|
||||||
##### Switch Display Sleep Modus #####
|
##### Switch Display Sleep Modus #####
|
||||||
- platform: template
|
- name: ${device_name} Sleep Modus
|
||||||
|
platform: template
|
||||||
device_class: switch
|
device_class: switch
|
||||||
name: ${device_name} Sleep Modus
|
|
||||||
id: sleep_modus
|
id: sleep_modus
|
||||||
entity_category: config
|
entity_category: config
|
||||||
restore_state: true
|
restore_state: true
|
||||||
@@ -754,15 +753,15 @@ switch:
|
|||||||
- lambda: id(disp1).set_component_value("settings.bt1",1);
|
- lambda: id(disp1).set_component_value("settings.bt1",1);
|
||||||
|
|
||||||
##### Relay Local control Fallback #####
|
##### Relay Local control Fallback #####
|
||||||
- platform: template
|
- name: ${device_name} Relay 1 Local Fallback
|
||||||
name: ${device_name} Relay 1 Local Fallback
|
platform: template
|
||||||
id: relay1_fallback
|
id: relay1_fallback
|
||||||
entity_category: config
|
entity_category: config
|
||||||
restore_state: true
|
restore_state: true
|
||||||
optimistic: true
|
optimistic: true
|
||||||
|
|
||||||
- platform: template
|
- name: ${device_name} Relay 2 Local Fallback
|
||||||
name: ${device_name} Relay 2 Local Fallback
|
platform: template
|
||||||
id: relay2_fallback
|
id: relay2_fallback
|
||||||
entity_category: config
|
entity_category: config
|
||||||
restore_state: true
|
restore_state: true
|
||||||
@@ -839,8 +838,8 @@ number:
|
|||||||
|
|
||||||
##### START - DISPLAY START CONFIGURATION #####
|
##### START - DISPLAY START CONFIGURATION #####
|
||||||
display:
|
display:
|
||||||
- platform: nextion
|
- id: disp1
|
||||||
id: disp1
|
platform: nextion
|
||||||
uart_id: tf_uart
|
uart_id: tf_uart
|
||||||
tft_url: ${nextion_update_url}
|
tft_url: ${nextion_update_url}
|
||||||
on_setup:
|
on_setup:
|
||||||
|
|||||||
Reference in New Issue
Block a user