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
|
||||
on_click:
|
||||
if:
|
||||
# mcu-patio online -> toggle its lights; otherwise (no API or relay_2 cut its power) the relay
|
||||
condition:
|
||||
api.connected:
|
||||
and:
|
||||
- api.connected:
|
||||
- binary_sensor.is_on: patio_status
|
||||
then:
|
||||
- homeassistant.action:
|
||||
action: light.toggle
|
||||
@@ -169,6 +172,10 @@ binary_sensor:
|
||||
else:
|
||||
- switch.toggle: relay_2
|
||||
|
||||
- platform: homeassistant
|
||||
id: patio_status
|
||||
entity_id: binary_sensor.patio_status
|
||||
|
||||
switch:
|
||||
- platform: gpio
|
||||
name: Outside Light Back
|
||||
|
||||
Reference in new issue
Block a user