Update nspanel_esphome.yaml

Add relay local fallback
This commit is contained in:
danwright87
2023-01-23 21:16:23 +00:00
committed by GitHub
parent 147cf0f497
commit ad26272524

View File

@@ -341,6 +341,22 @@ binary_sensor:
pin:
number: 14
inverted: true
on_click:
if:
condition:
and:
- switch.is_on: relay1_fallback
- not:
api.connected:
then:
- switch.toggle: relay_1
- lambda: id(disp1).send_command_printf("home.icon_top_01.pic=51");
- lambda: id(disp1).send_command_printf("home.left_bt_pic.pic=98");
- if:
condition:
switch.is_on: relay_1
then:
- lambda: id(disp1).send_command_printf("home.icon_top_01.pic=105");
##### RIGHT BUTTON BELOW DISPLAY TO TOGGLE RELAY #####
- platform: gpio
@@ -348,6 +364,22 @@ binary_sensor:
pin:
number: 27
inverted: true
on_click:
if:
condition:
and:
- switch.is_on: relay2_fallback
- not:
api.connected:
then:
- switch.toggle: relay_2
- lambda: id(disp1).send_command_printf("home.icon_top_02.pic=51");
- lambda: id(disp1).send_command_printf("home.right_bt_pic.pic=98");
- if:
condition:
switch.is_on: relay_2
then:
- lambda: id(disp1).send_command_printf("home.icon_top_02.pic=106");
##### Restart NSPanel Button - Setting Page #####
- platform: nextion
@@ -718,6 +750,20 @@ switch:
value: '1'
- lambda: id(disp1).set_component_value("settings.a02",1);
##### Relay Local control Fallback #####
- platform: template
name: ${device_name} Relay 1 Local Fallback
id: relay1_fallback
entity_category: config
restore_state: true
optimistic: true
- platform: template
name: ${device_name} Relay 2 Local Fallback
id: relay2_fallback
entity_category: config
restore_state: true
optimistic: true
##### START - NUMBER CONFIGURATION #####
number: