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
|
|
22
|
|
23 ota:
|
|
24
|
|
25 #dallas:
|
|
26 # - pin: GPIO16
|
|
27 #sensor:
|
|
28 # - platform: dallas
|
|
29 # index: 0
|
|
30 # name: temperature
|
|
31
|
|
32 switch:
|
|
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
|
|
37 output:
|
|
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
|
|
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
|
|
52 i2c:
|
|
53 sda: 4
|
|
54 scl: 15
|
|
55
|
|
56 font:
|
|
57 - file: "/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf"
|
|
58 id: font_vera
|
|
59 size: 12
|
|
60 glyphs: "+-_.:0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz"
|
|
61
|
|
62 text_sensor:
|
|
63 - platform: wifi_info
|
|
64 ip_address:
|
|
65 name: wifi_ip
|
|
66 id: wifi_ip
|
|
67 ssid:
|
|
68 name: wifi_ssid
|
|
69 bssid:
|
|
70 name: wifi_bssid
|
|
71
|
|
72 sensor:
|
|
73 - platform: wifi_signal
|
|
74 id: my_wifi_signal
|
|
75 name: wifi_signal
|
|
76 update_interval: 4s
|
|
77 internal: true # no mqtt
|
|
78
|
|
79 display:
|
|
80 - platform: ssd1306_i2c
|
|
81 model: "SSD1306 128x64"
|
|
82 reset_pin: 16
|
|
83 address: 0x3C
|
|
84 lambda: |-
|
|
85 it.print(0, 0, id(font_vera), "bed 2: running");
|
|
86 it.printf(0, 20, id(font_vera), "wifi %s %.2f", id(wifi_ip).state.c_str(), id(my_wifi_signal).state);
|
|
87
|