@@ -3308,6 +3308,8 @@ action:
|
|||||||
{%- elif states(last_click) == "pressbuttonpage04button06" -%} {{ entity30 }}
|
{%- elif states(last_click) == "pressbuttonpage04button06" -%} {{ entity30 }}
|
||||||
{%- elif states(last_click) == "pressbuttonpage04button07" -%} {{ entity31 }}
|
{%- elif states(last_click) == "pressbuttonpage04button07" -%} {{ entity31 }}
|
||||||
{%- elif states(last_click) == "pressbuttonpage04button08" -%} {{ entity32 }}
|
{%- elif states(last_click) == "pressbuttonpage04button08" -%} {{ entity32 }}
|
||||||
|
{%- elif states(last_click) == "pressbuttonleft" -%} {{ left_button_entity }}
|
||||||
|
{%- elif states(last_click) == "pressbuttonright" -%} {{ right_button_entity }}
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
|
||||||
##### Entity Name - Page Lightsettings #####
|
##### Entity Name - Page Lightsettings #####
|
||||||
@@ -3340,10 +3342,12 @@ action:
|
|||||||
{%- elif states(last_click) == "pressbuttonpage04button02" -%} {{ entity26_name }}
|
{%- elif states(last_click) == "pressbuttonpage04button02" -%} {{ entity26_name }}
|
||||||
{%- elif states(last_click) == "pressbuttonpage04button03" -%} {{ entity27_name }}
|
{%- elif states(last_click) == "pressbuttonpage04button03" -%} {{ entity27_name }}
|
||||||
{%- elif states(last_click) == "pressbuttonpage04button04" -%} {{ entity28_name }}
|
{%- elif states(last_click) == "pressbuttonpage04button04" -%} {{ entity28_name }}
|
||||||
{%- elif states(last_click) == "pressbuttonpage04button05" -%} {{ entity29_name}}
|
{%- elif states(last_click) == "pressbuttonpage04button05" -%} {{ entity29_name }}
|
||||||
{%- elif states(last_click) == "pressbuttonpage04button06" -%} {{ entity30_name }}
|
{%- elif states(last_click) == "pressbuttonpage04button06" -%} {{ entity30_name }}
|
||||||
{%- elif states(last_click) == "pressbuttonpage04button07" -%} {{ entity31_name }}
|
{%- elif states(last_click) == "pressbuttonpage04button07" -%} {{ entity31_name }}
|
||||||
{%- elif states(last_click) == "pressbuttonpage04button08" -%} {{ entity32_name }}
|
{%- elif states(last_click) == "pressbuttonpage04button08" -%} {{ entity32_name }}
|
||||||
|
{%- elif states(last_click) == "pressbuttonleft" -%} {{ left_button_name }}
|
||||||
|
{%- elif states(last_click) == "pressbuttonright" -%} {{ right_button_name }}
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
|
||||||
##### Entity - Page Lightsettings - Skip Back #####
|
##### Entity - Page Lightsettings - Skip Back #####
|
||||||
@@ -3380,6 +3384,8 @@ action:
|
|||||||
{%- elif states(last_click) == "pressbuttonpage04button06" -%} {{ "page buttonpage04" }}
|
{%- elif states(last_click) == "pressbuttonpage04button06" -%} {{ "page buttonpage04" }}
|
||||||
{%- elif states(last_click) == "pressbuttonpage04button07" -%} {{ "page buttonpage04" }}
|
{%- elif states(last_click) == "pressbuttonpage04button07" -%} {{ "page buttonpage04" }}
|
||||||
{%- elif states(last_click) == "pressbuttonpage04button08" -%} {{ "page buttonpage04" }}
|
{%- elif states(last_click) == "pressbuttonpage04button08" -%} {{ "page buttonpage04" }}
|
||||||
|
{%- elif states(last_click) == "pressbuttonleft" -%} {{ "page home" }}
|
||||||
|
{%- elif states(last_click) == "pressbuttonright" -%} {{ "page home" }}
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
|
||||||
########################################################################################################################
|
########################################################################################################################
|
||||||
|
|||||||
@@ -345,15 +345,11 @@ binary_sensor:
|
|||||||
inverted: true
|
inverted: true
|
||||||
on_click:
|
on_click:
|
||||||
- min_length: 50ms
|
- min_length: 50ms
|
||||||
max_length: 999ms
|
max_length: 1000ms
|
||||||
then:
|
then:
|
||||||
- binary_sensor.template.publish:
|
- binary_sensor.template.publish:
|
||||||
id: left_button_short
|
id: left_button_short
|
||||||
state: ON
|
state: ON
|
||||||
- delay: 500ms
|
|
||||||
- binary_sensor.template.publish:
|
|
||||||
id: left_button_short
|
|
||||||
state: OFF
|
|
||||||
- if:
|
- if:
|
||||||
condition:
|
condition:
|
||||||
and:
|
and:
|
||||||
@@ -369,16 +365,28 @@ binary_sensor:
|
|||||||
switch.is_on: relay_1
|
switch.is_on: relay_1
|
||||||
then:
|
then:
|
||||||
- lambda: id(disp1).send_command_printf("home.icon_top_01.pic=105");
|
- lambda: id(disp1).send_command_printf("home.icon_top_01.pic=105");
|
||||||
- min_length: 1000ms
|
|
||||||
max_length: 10000ms
|
|
||||||
then:
|
|
||||||
- binary_sensor.template.publish:
|
|
||||||
id: left_button_hold
|
|
||||||
state: ON
|
|
||||||
- delay: 500ms
|
- delay: 500ms
|
||||||
- binary_sensor.template.publish:
|
- binary_sensor.template.publish:
|
||||||
id: left_button_hold
|
id: left_button_short
|
||||||
state: OFF
|
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
|
- platform: template
|
||||||
name: ${device_name} Left Button
|
name: ${device_name} Left Button
|
||||||
@@ -386,11 +394,6 @@ binary_sensor:
|
|||||||
lambda: |-
|
lambda: |-
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
- platform: template
|
|
||||||
name: ${device_name} Left Button hold
|
|
||||||
id: left_button_hold
|
|
||||||
lambda: |-
|
|
||||||
return {};
|
|
||||||
|
|
||||||
##### RIGHT BUTTON BELOW DISPLAY TO TOGGLE RELAY #####
|
##### RIGHT BUTTON BELOW DISPLAY TO TOGGLE RELAY #####
|
||||||
- platform: gpio
|
- platform: gpio
|
||||||
@@ -401,15 +404,11 @@ binary_sensor:
|
|||||||
inverted: true
|
inverted: true
|
||||||
on_click:
|
on_click:
|
||||||
- min_length: 50ms
|
- min_length: 50ms
|
||||||
max_length: 999ms
|
max_length: 1000ms
|
||||||
then:
|
then:
|
||||||
- binary_sensor.template.publish:
|
- binary_sensor.template.publish:
|
||||||
id: right_button_short
|
id: right_button_short
|
||||||
state: ON
|
state: ON
|
||||||
- delay: 500ms
|
|
||||||
- binary_sensor.template.publish:
|
|
||||||
id: right_button_short
|
|
||||||
state: OFF
|
|
||||||
- if:
|
- if:
|
||||||
condition:
|
condition:
|
||||||
and:
|
and:
|
||||||
@@ -425,17 +424,28 @@ binary_sensor:
|
|||||||
switch.is_on: relay_2
|
switch.is_on: relay_2
|
||||||
then:
|
then:
|
||||||
- lambda: id(disp1).send_command_printf("home.icon_top_02.pic=106");
|
- lambda: id(disp1).send_command_printf("home.icon_top_02.pic=106");
|
||||||
|
|
||||||
- min_length: 1000ms
|
|
||||||
max_length: 10000ms
|
|
||||||
then:
|
|
||||||
- binary_sensor.template.publish:
|
|
||||||
id: right_button_hold
|
|
||||||
state: ON
|
|
||||||
- delay: 500ms
|
- delay: 500ms
|
||||||
- binary_sensor.template.publish:
|
- binary_sensor.template.publish:
|
||||||
id: right_button_hold
|
id: right_button_short
|
||||||
state: OFF
|
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
|
- platform: template
|
||||||
name: ${device_name} Right Button
|
name: ${device_name} Right Button
|
||||||
@@ -443,12 +453,6 @@ binary_sensor:
|
|||||||
lambda: |-
|
lambda: |-
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
- platform: template
|
|
||||||
name: ${device_name} Right Button hold
|
|
||||||
id: right_button_hold
|
|
||||||
lambda: |-
|
|
||||||
return {};
|
|
||||||
|
|
||||||
##### Restart NSPanel Button - Setting Page #####
|
##### Restart NSPanel Button - Setting Page #####
|
||||||
- platform: nextion
|
- platform: nextion
|
||||||
name: ${device_name} Restart
|
name: ${device_name} Restart
|
||||||
|
|||||||
Reference in New Issue
Block a user