Hier findet Ihr ein Beispiel für einen ESPHome Code passend für einen Sonoff 4-Kanal Schalter.
Danke @derrodi für das bereitstellen des Codes!
Hier findet Ihr den Sonoff 4-CH
[asa2 id=“6424″/]
configuration.yaml
1esphome:
2 name: sonoff_4ch_pro # Name of the Node.
3 platform: ESP8266 # Even if the chip is a ESP8285, they have the same family.
4 board: esp01_1m
5 on_boot:
6 priority: -100
7 then:
8 light.turn_on:
9 id: status_led
10
11wifi:
12 ssid: WLAN
13 password: PASSWORT
14
15api:
16
17logger:
18
19ota:
20
21# Enable Web server
22web_server:
23 port: 80
24
25binary_sensor:
26 - platform: gpio
27 on_press:
28 then:
29 - switch.toggle: button_1
30 pin:
31 number: GPIO0
32 mode: INPUT_PULLUP
33 inverted: True
34 name: "Sonoff 4CH Button 1"
35 - platform: gpio
36 on_press:
37 then:
38 - switch.toggle: button_2
39 pin:
40 number: GPIO9
41 mode: INPUT_PULLUP
42 inverted: True
43 name: "Sonoff 4CH Button 2"
44 - platform: gpio
45 on_press:
46 then:
47 - switch.toggle: button_3
48 pin:
49 number: GPIO10
50 mode: INPUT_PULLUP
51 inverted: True
52 name: "Sonoff 4CH Button 3"
53 - platform: gpio
54 on_press:
55 then:
56 - switch.toggle: button_4
57 pin:
58 number: GPIO14
59 mode: INPUT_PULLUP
60 inverted: True
61 name: "Sonoff 4CH Button 4"
62 - platform: status
63 name: "Sonoff 4CH Status"
64
65switch:
66 - platform: gpio
67 id: button_1
68 name: "Sonoff 4CH Relay 1"
69 pin: GPIO12
70 - platform: gpio
71 id: button_2
72 name: "Sonoff 4CH Relay 2"
73 pin: GPIO5
74 - platform: gpio
75 id: button_3
76 name: "Sonoff 4CH Relay 3"
77 pin: GPIO4
78 - platform: gpio
79 id: button_4
80 name: "Sonoff 4CH Relay 4"
81 pin: GPIO15
82
83output:
84 - platform: esp8266_pwm
85 id: blue_led
86 pin: GPIO13
87 inverted: True
88
89light:
90 - platform: monochromatic
91 id: status_led
92 name: "Sonoff 4CH Blue LED"
93 output: blue_led
