773
|
1 # https://cdn.hackaday.io/files/269911154782944/Heltec_WIFI-LoRa-32_DiagramPinout.jpg
|
|
2
|
|
3 esphome:
|
|
4 name: bed
|
|
5 platform: ESP32
|
|
6 board: lolin32
|
|
7
|
|
8 wifi:
|
|
9 ssid: !secret wifi_ssid
|
|
10 password: !secret wifi_password
|
|
11 domain: ''
|
|
12
|
|
13 mqtt:
|
|
14 broker: '10.2.0.1'
|
|
15 port: 1883
|
|
16 username: ''
|
|
17 password: ''
|
|
18
|
|
19 logger:
|
|
20 baud_rate: 115200
|
|
21 level: DEBUG
|
1737
|
22
|
773
|
23 ota:
|
1737
|
24
|
773
|
25 #dallas:
|
|
26 # - pin: GPIO16
|
|
27 #sensor:
|
|
28 # - platform: dallas
|
|
29 # index: 0
|
|
30 # name: temperature
|
|
31
|
|
32 switch:
|
1737
|
33 - { platform: gpio, pin: { mode: INPUT_PULLUP, number: 2, inverted: yes }, name: red_button }
|
|
34 - { platform: gpio, pin: { mode: INPUT_PULLUP, number: 15, inverted: yes }, name: green_button }
|
|
35 - { platform: gpio, pin: GPIO16, name: pir }
|
|
36
|
773
|
37 output:
|
1737
|
38 - { platform: ledc, pin: GPIO19, id: headboard_w }
|
|
39 - { platform: ledc, pin: GPIO23, id: headboard_r }
|
|
40 - { platform: ledc, pin: GPIO18, id: headboard_g }
|
|
41 - { platform: ledc, pin: GPIO17, id: headboard_b }
|
|
42
|
773
|
43 light:
|
|
44 - platform: rgbw
|
|
45 name: headboard
|
|
46 red: headboard_r
|
|
47 green: headboard_g
|
|
48 blue: headboard_b
|
|
49 white: headboard_w
|
|
50
|
|
51 i2c:
|
|
52 sda: 4
|
|
53 scl: 15
|
|
54
|
|
55 font:
|
|
56 - file: "/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf"
|
|
57 id: font_vera
|
|
58 size: 12
|
|
59 glyphs: "+-_.:0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz"
|
|
60
|
|
61 text_sensor:
|
|
62 - platform: wifi_info
|
|
63 ip_address:
|
|
64 name: wifi_ip
|
|
65 id: wifi_ip
|
|
66 ssid:
|
|
67 name: wifi_ssid
|
|
68 bssid:
|
|
69 name: wifi_bssid
|
|
70
|
|
71 sensor:
|
|
72 - platform: wifi_signal
|
|
73 id: my_wifi_signal
|
|
74 name: wifi_signal
|
|
75 update_interval: 4s
|
|
76 internal: true # no mqtt
|
1737
|
77
|
773
|
78 display:
|
|
79 - platform: ssd1306_i2c
|
|
80 model: "SSD1306 128x64"
|
|
81 reset_pin: 16
|
|
82 address: 0x3C
|
|
83 lambda: |-
|
|
84 it.print(0, 0, id(font_vera), "bed 2: running");
|
|
85 it.printf(0, 20, id(font_vera), "wifi %s %.2f", id(wifi_ip).state.c_str(), id(my_wifi_signal).state);
|