Skip to content

Commit 3823b0f

Browse files
author
Xavier Berger
committed
feat: Add physical activation buttons
1 parent bba73e3 commit 3823b0f

2 files changed

Lines changed: 34 additions & 0 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
binary_sensor:
2+
- platform: gpio
3+
pin:
4+
number: ${activate_pin}
5+
mode: INPUT_PULLUP
6+
name: "Activate Button"
7+
on_press:
8+
- switch.toggle: activate

solar_router/activate_switch.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
esphome:
2+
on_boot:
3+
priority: -100
4+
then:
5+
- if:
6+
condition:
7+
binary_sensor.is_on: activate_switch
8+
then:
9+
- switch.turn_on: activate
10+
else:
11+
- switch.turn_off: activate
12+
13+
binary_sensor:
14+
- platform: gpio
15+
pin:
16+
number: ${activate_pin}
17+
mode: INPUT_PULLUP
18+
name: "Activate Switch"
19+
id: activate_switch
20+
on_state:
21+
then:
22+
- switch.turn_on: activate
23+
on_state_not:
24+
then:
25+
- switch.turn_off: activate
26+

0 commit comments

Comments
 (0)