Situatie:
- bedrade deurbel op trafo 8V wisselspanning
- tutorial gevolgd van Frenck op https://frenck.dev/diy-smart-doorbell-for-just-2-dollar/ met afgebogen pin GPIO2
- ESP-01S + ESP-01S Relay v1.0
- Firmware succesvol geflashed en Wifi-verbinding succesvol wanneer vervolgens via de FTDI aangesloten met enkel 3.3V op 3V3 + CH-EN, en GND naar GND
- Geen Wifi-verbinding wanneer vervolgens met een USB-lader 5V wordt gezet op het Relay bordje met de ESP. Tenminste... wanneer ik de spanning erop laat staan, en de ESP er een aantal keer af haal en terugzet, lukt het uiteindelijk wel... tot een reboot.
- Met een testmotortje aangesloten op NO en CON van het Relay reageert deze alleen wel precies omgekeerd op het maken van contact op GPIO2. Klopt dit wel?
- Is de condensator echt nodig, moet dit eigenlijk niet worden afgevangen via de mode INPUT_PULLUP?
- In dat topic wordt ook de optie genoemd om GPIO3 te gebruiken. Lijkt een mooi alternatief. Wat is dan de mode die gebruikt moet worden?
- Of ben ik beter af met een Wemos D1 o.i.d.?
- En anders kan ik nog altijd via een Shelly1 proberen, maar dit geknutsel is toch wel leuk...
YAML:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
| substitutions: name: deurbel esphome: name: ${name} platform: ESP8266 board: esp01_1m wifi: ssid: '###' password: '###' manual_ip: # Set this to the IP of the ESP static_ip: 192.168.0.105 # Set this to the IP address of the router. Often ends with .1 gateway: 192.168.0.1 # The subnet of the network. 255.255.255.0 works for most home networks. subnet: 255.255.255.0 # Enable logging logger: # Enable Web server web_server: port: 80 # Enable Home Assistant API api: password: '###' ota: password: '###' # Sync time with Home Assistant. time: - platform: homeassistant id: homeassistant_time timezone: Europe/Amsterdam # Text sensors with general information. text_sensor: # Expose ESPHome version as sensor. - platform: version name: ${name}_ESPHome Version # Expose WiFi information as sensors. - platform: wifi_info ip_address: name: ${name}_IP ssid: name: ${name}_SSID bssid: name: ${name}_BSSID # Sensors with general information. sensor: # Uptime sensor. - platform: uptime name: ${name}_Uptime # WiFi Signal sensor. - platform: wifi_signal name: ${name}_Wifi Signal update_interval: 60s # Global to store the on/off state of the chime globals: - id: chime type: bool restore_value: true initial_value: 'true' # Exposed switches. switch: # Switch to restart the doorbell. - platform: restart name: ${name}_Restart # Switch to turn on/off the chime. - platform: gpio id: relay inverted: true name: ${name}_Chime pin: GPIO0 # Switch to turn on/off chime when # doorbell button is pushed. # # It creates a "virtual" switch based # on a global variable. - platform: template name: ${name}_Chime Active id: chime_active restore_state: false turn_on_action: - globals.set: id: chime value: 'true' turn_off_action: - globals.set: id: chime value: 'false' lambda: |- return id(chime); # Binary sensor representing the # Doorbell button push. binary_sensor: - platform: gpio id: button name: ${name}_Button pin: # Connected to GPIO on the ESP-01S. number: GPIO2 mode: INPUT_PULLUP inverted: true filters: # Small filter, to debounce the button press. - delayed_on: 25ms - delayed_off: 25ms on_press: # Only turn on the chime when it is active. then: if: condition: - switch.is_on: chime_active then: - switch.turn_on: relay on_release: # On release, turn of the chime. - switch.turn_off: relay |