mirror of
https://github.com/randybb/esphome-configs.git
synced 2026-10-14 08:35:12 +02:00
nspanel-patio: right button toggles the relay unless mcu-patio is online
This commit is contained in:
1 parent
dd508aec99
commit
7ee975875a
1 file changed
+8
-1
@@ -156,8 +156,11 @@ binary_sensor:
|
|||||||
inverted: true
|
inverted: true
|
||||||
on_click:
|
on_click:
|
||||||
if:
|
if:
|
||||||
|
# mcu-patio online -> toggle its lights; otherwise (no API or relay_2 cut its power) the relay
|
||||||
condition:
|
condition:
|
||||||
api.connected:
|
and:
|
||||||
|
- api.connected:
|
||||||
|
- binary_sensor.is_on: patio_status
|
||||||
then:
|
then:
|
||||||
- homeassistant.action:
|
- homeassistant.action:
|
||||||
action: light.toggle
|
action: light.toggle
|
||||||
@@ -169,6 +172,10 @@ binary_sensor:
|
|||||||
else:
|
else:
|
||||||
- switch.toggle: relay_2
|
- switch.toggle: relay_2
|
||||||
|
|
||||||
|
- platform: homeassistant
|
||||||
|
id: patio_status
|
||||||
|
entity_id: binary_sensor.patio_status
|
||||||
|
|
||||||
switch:
|
switch:
|
||||||
- platform: gpio
|
- platform: gpio
|
||||||
name: Outside Light Back
|
name: Outside Light Back
|
||||||
|
|||||||
Reference in new issue
Block a user