Hier findet Ihr ein Beispiel, wie der Sonoff Touch (2-Kanal Variante) zum steuern eurer elektrischen Jalousiemotoren verwendet werden kann.
Alle Details zur Pinbelegung oder wie man den Wandschalter als einfachen Lichtschalter nutzen kann, könnt Ihr unter folgendem Link nachlesen:
/wiki/esphome/sonoff-touch-2-kanal-wandschalter-t0eu2c/
configuration.yaml
1esphome:
2 name: t0_schalter_Jalousie
3 platform: ESP8266
4 board: esp01_1m
5
6wifi:
7 ssid: !secret WLanSSID
8 password: !secret WLanPassword
9
10 ap:
11 ssid: "Sonoff T1 Ch2 Fallback Hotspot"
12 password: "123456789"
13
14captive_portal:
15
16logger:
17
18api:
19ota:
20
21binary_sensor:
22 - platform: gpio
23 pin:
24 number: GPIO0
25 mode: INPUT_PULLUP
26 inverted: True
27 id: button_1
28 on_press:
29 then:
30 - lambda: |
31 if (id(my_cover).current_operation == COVER_OPERATION_IDLE) {
32 id(my_cover).open();
33 } else {
34 id(my_cover).stop();
35 }
36
37
38 - platform: gpio
39 pin:
40 number: GPIO9
41 mode: INPUT_PULLUP
42 inverted: True
43 id: button_2
44 on_press:
45 then:
46 - lambda: |
47 if (id(my_cover).current_operation == COVER_OPERATION_IDLE) {
48 id(my_cover).close();
49 } else {
50 id(my_cover).stop();
51 }
52
53
54 - platform: status
55 name: "Jalousie Status"
56
57
58switch:
59 - platform: gpio
60 name: "Jalousie rauf"
61 pin: GPIO12
62 interlock: &interlock [open_cover, close_cover]
63 id: open_cover
64 on_turn_on:
65 - script.execute: switch_open_cover_off
66
67 - platform: gpio
68 name: "Jalousie runter"
69 pin: GPIO5
70 interlock: *interlock
71 id: close_cover
72 on_turn_on:
73 - script.execute: switch_close_cover_off
74
75cover:
76 - platform: time_based
77 name: "Jalousie"
78 id: my_cover
79 open_action:
80 - switch.turn_on: open_cover
81 open_duration: 22s
82 close_action:
83 - switch.turn_on: close_cover
84 close_duration: 20s
85 stop_action:
86 - switch.turn_off: open_cover
87 - switch.turn_off: close_cover
88
89
90status_led:
91 pin:
92 number: GPIO13
93 inverted: yes
94
95
96script:
97- id: switch_open_cover_off
98 mode: restart
99 then:
100 - delay: 1min
101 - switch.turn_off: open_cover
102
103- id: switch_close_cover_off
104 mode: restart
105 then:
106 - delay: 1min
107 - switch.turn_off: close_cover
