596
|
1 substitutions:
|
|
2 location: display1
|
|
3 board: d1_mini
|
773
|
4 wifi_addr: 10.2.0.97
|
|
5
|
596
|
6 <<: !include esp8266_nightlight.yaml
|
|
7
|
|
8 i2c:
|
|
9 sda: D6
|
|
10 scl: D5
|
|
11
|
|
12 font:
|
773
|
13 - file: "Oswald-Regular.ttf"
|
|
14 id: font_20
|
|
15 size: 20
|
|
16 glyphs: ' .ASacdegiknorstuwDpCf'
|
|
17 - file: "Oswald-Regular.ttf"
|
|
18 id: font_13
|
|
19 size: 13
|
|
20 glyphs: 'CLOUcdeklnopsD. '
|
|
21 - file: "Oswald-Regular.ttf"
|
|
22 id: font_10
|
|
23 size: 10
|
|
24 glyphs: ' %0123456789.:NekortwDpnb-dB'
|
596
|
25
|
|
26 text_sensor:
|
|
27 - platform: mqtt_subscribe
|
773
|
28 name: "line1"
|
|
29 id: line1
|
|
30 topic: frontwindow/line1
|
|
31 on_value:
|
|
32 then:
|
|
33 - component.update: my_display
|
|
34 - platform: mqtt_subscribe
|
|
35 name: "line2"
|
|
36 id: line2
|
|
37 topic: frontwindow/line2
|
|
38 on_value:
|
|
39 then:
|
|
40 - component.update: my_display
|
596
|
41 - platform: mqtt_subscribe
|
773
|
42 name: "line3"
|
|
43 id: line3
|
|
44 topic: frontwindow/line3
|
|
45 on_value:
|
|
46 then:
|
|
47 - component.update: my_display
|
|
48 - platform: mqtt_subscribe
|
|
49 name: "line4"
|
|
50 id: line4
|
|
51 topic: frontwindow/line4
|
|
52 on_value:
|
|
53 then:
|
|
54 - component.update: my_display
|
|
55
|
|
56 sensor:
|
|
57 - platform: wifi_signal
|
|
58 name: "WiFi Signal Sensor"
|
|
59 update_interval: 10s
|
|
60 id: wifi_db
|
596
|
61
|
|
62 display:
|
|
63 - platform: ssd1306_i2c
|
773
|
64 id: my_display
|
596
|
65 model: "SSD1306 128x64"
|
|
66 address: 0x3c
|
|
67 lambda: |-
|
|
68 it.rectangle(0, 0, 127, 63);
|
773
|
69 it.printf(64, 3, id(font_20), TextAlign::TOP_CENTER, id(line1).state.c_str());
|
|
70 it.printf(30, 28, id(font_13), TextAlign::TOP_CENTER, id(line2).state.c_str());
|
|
71 it.printf(103, 28, id(font_13), TextAlign::TOP_CENTER, id(line3).state.c_str());
|
|
72 it.printf(64, 63 - 5, id(font_10), TextAlign::BOTTOM_CENTER, "Network: %d dB", static_cast<int8_t>(id(wifi_db).state));
|
|
73
|
596
|
74 spi:
|
|
75 clk_pin: D4
|
|
76 miso_pin: D1
|
|
77 mosi_pin: D2
|
|
78
|
|
79 pn532:
|
|
80 cs_pin: D3
|
|
81 update_interval: 1s
|
|
82 on_tag:
|
|
83 then:
|
|
84 - mqtt.publish:
|
|
85 topic: frontwindow/tag
|
773
|
86 retain: false
|
596
|
87 payload: !lambda 'return x;'
|
|
88
|