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