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