Edit esp-officeduallights.yaml
This commit is contained in:
@@ -233,11 +233,6 @@ mqtt:
|
|||||||
payload: !lambda |-
|
payload: !lambda |-
|
||||||
return id(relay_2).state ? "${mqtt_command_on}" : "${mqtt_command_off}";
|
return id(relay_2).state ? "${mqtt_command_on}" : "${mqtt_command_off}";
|
||||||
retain: true
|
retain: true
|
||||||
- mqtt.publish:
|
|
||||||
topic: "${mqtt_shared_overhead_status_topic}"
|
|
||||||
payload: !lambda |-
|
|
||||||
return id(relay_2).state ? "${mqtt_command_on}" : "${mqtt_command_off}";
|
|
||||||
retain: true
|
|
||||||
|
|
||||||
on_message:
|
on_message:
|
||||||
- topic: "${mqtt_local_command1_topic}"
|
- topic: "${mqtt_local_command1_topic}"
|
||||||
@@ -361,28 +356,6 @@ mqtt:
|
|||||||
then:
|
then:
|
||||||
- light.turn_off: light_2
|
- light.turn_off: light_2
|
||||||
|
|
||||||
# Mirror shared overhead status from esp-officelights onto light_2. This handles the
|
|
||||||
# case where the main lightswitch's overhead timer finishes and turns off the overhead.
|
|
||||||
# State guards prevent ping-pong with the command topic handlers above.
|
|
||||||
- topic: "${mqtt_shared_overhead_status_topic}"
|
|
||||||
payload: "${mqtt_command_on}"
|
|
||||||
then:
|
|
||||||
- if:
|
|
||||||
condition:
|
|
||||||
lambda: "return !id(relay_2).state;"
|
|
||||||
then:
|
|
||||||
- light.turn_on: light_2
|
|
||||||
|
|
||||||
- topic: "${mqtt_shared_overhead_status_topic}"
|
|
||||||
payload: "${mqtt_command_off}"
|
|
||||||
then:
|
|
||||||
- script.stop: relay_2_timer_script
|
|
||||||
- if:
|
|
||||||
condition:
|
|
||||||
lambda: "return id(relay_2).state;"
|
|
||||||
then:
|
|
||||||
- light.turn_off: light_2
|
|
||||||
|
|
||||||
#:########################################################################################:#
|
#:########################################################################################:#
|
||||||
# SCRIPT COMPONENT:
|
# SCRIPT COMPONENT:
|
||||||
# Independent per-relay timer scripts
|
# Independent per-relay timer scripts
|
||||||
@@ -494,10 +467,6 @@ switch:
|
|||||||
topic: "${mqtt_local_status2_topic}"
|
topic: "${mqtt_local_status2_topic}"
|
||||||
payload: "On"
|
payload: "On"
|
||||||
retain: true
|
retain: true
|
||||||
- mqtt.publish:
|
|
||||||
topic: "${mqtt_shared_overhead_status_topic}"
|
|
||||||
payload: "On"
|
|
||||||
retain: true
|
|
||||||
- if:
|
- if:
|
||||||
condition:
|
condition:
|
||||||
switch.is_off: relay_1
|
switch.is_off: relay_1
|
||||||
@@ -510,10 +479,6 @@ switch:
|
|||||||
topic: "${mqtt_local_status2_topic}"
|
topic: "${mqtt_local_status2_topic}"
|
||||||
payload: "Off"
|
payload: "Off"
|
||||||
retain: true
|
retain: true
|
||||||
- mqtt.publish:
|
|
||||||
topic: "${mqtt_shared_overhead_status_topic}"
|
|
||||||
payload: "Off"
|
|
||||||
retain: true
|
|
||||||
- if:
|
- if:
|
||||||
condition:
|
condition:
|
||||||
switch.is_off: relay_1
|
switch.is_off: relay_1
|
||||||
|
|||||||
Reference in New Issue
Block a user