Mercurial > code > home > repos > homeauto
annotate espNode/theater_lcd.yaml @ 1754:92999dfbf321 default tip
add shelly support
author | drewp@bigasterisk.com |
---|---|
date | Tue, 04 Jun 2024 13:03:43 -0700 |
parents | 2bed2f68243c |
children |
rev | line source |
---|---|
802
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
1 esphome: |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
2 name: theater_lcd |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
3 platform: ESP32 |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
4 board: esp32cam |
1716 | 5 includes: |
6 - component/keypad.h | |
802
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
7 |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
8 wifi: |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
9 ssid: !secret wifi_ssid |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
10 password: !secret wifi_password |
1716 | 11 domain: "" |
12 use_address: "10.2.0.39" | |
802
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
13 |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
14 mqtt: |
1716 | 15 broker: "10.2.0.1" |
802
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
16 port: 1883 |
1716 | 17 username: "" |
18 password: "" | |
19 | |
802
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
20 logger: |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
21 baud_rate: 115200 |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
22 level: DEBUG |
1716 | 23 |
802
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
24 ota: |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
25 |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
26 # image: |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
27 # - file: "colorscape.png" |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
28 # id: colorscape |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
29 # type: RGB24 |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
30 |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
31 font: |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
32 - file: "bluefish-scratched/BLUEFISH BLACK SCRATCHED_Demo.ttf" |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
33 id: font_bluefish_big |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
34 size: 120 |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
35 glyphs: "0123456789ms " |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
36 - file: "Teko/Teko-Regular.ttf" |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
37 id: font_teko_small |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
38 size: 60 |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
39 glyphs: "+-_.:0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ " |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
40 |
1716 | 41 custom_component: |
42 - lambda: |- | |
43 auto my_custom = new KeypadComponent(); | |
44 return {my_custom}; | |
45 | |
46 # set these to input for KeypadComponent | |
47 # binary_sensor: | |
48 # - { platform: gpio, pin: GPIO36, name: "input36" } | |
49 # - { platform: gpio, pin: GPIO39, name: "input39" } | |
50 # - { platform: gpio, pin: GPIO34, name: "input34" } | |
51 # - { platform: gpio, pin: GPIO35, name: "input35" } | |
52 | |
53 | |
54 # for keyboard: | |
55 # GPIO23 col1 orn | |
56 # GPIO36 rowA yel (input only gpio) | |
57 # GPIO39 rowB grn (input only gpio) | |
58 # GPIO34 rowC blu (input only gpio) | |
59 # GPIO35 rowD brn (input only gpio) | |
60 # GPIO22 col0 gry | |
61 | |
802
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
62 display: |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
63 - platform: ili9486_8bit |
1716 | 64 model: "TFT_3.5" |
802
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
65 id: lcd |
1716 | 66 cs_pin: GPIO16 # wh |
67 dc_pin: GPIO17 # gy | |
68 wr_pin: GPIO5 # pu | |
69 rd_pin: GPIO18 # bk | |
802
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
70 data_pins: |
1716 | 71 - GPIO33 # gy |
72 - GPIO32 # bk | |
73 - GPIO13 # pu | |
74 - GPIO12 # bl | |
75 - GPIO14 # gn | |
76 - GPIO27 # ye | |
77 - GPIO26 # or | |
78 - GPIO25 # re | |
802
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
79 rotation: 90 |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
80 lambda: |- |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
81 it.clear(); // may be cheaper to get text extent and fill that box only |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
82 { |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
83 const std::string line = id(line1).state; |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
84 const char color_letter = line[0]; |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
85 const char* text = line.c_str() + (line.size() > 1 ? 1 : 0); |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
86 Color color; |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
87 switch(color_letter) { |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
88 // from https://coolors.co/e75d18-48a8a8-ededca-ac162a-550589-ed787f |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
89 case 'o': color = Color(0xe75d18);break; |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
90 case 'b': color = Color(0x48a8a8);break; |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
91 case 'y': color = Color(0xededca);break; |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
92 case 'r': color = Color(0xac162a);break; |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
93 case 'i': color = Color(0x550589);break; |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
94 case 'p': color = Color(0xed787f);break; |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
95 default: color = COLOR_WHITE; |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
96 } |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
97 it.print(0, 0, id(font_bluefish_big), color, text); |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
98 } |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
99 { |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
100 const std::string line = id(line2).state; |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
101 const char color_letter = line[0]; |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
102 const char* text = line.c_str() + (line.size() > 1 ? 1 : 0); |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
103 Color color; |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
104 switch(color_letter) { |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
105 case 'o': color = Color(0xe75d18);break; |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
106 case 'b': color = Color(0x48a8a8);break; |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
107 case 'y': color = Color(0xededca);break; |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
108 case 'r': color = Color(0xac162a);break; |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
109 case 'i': color = Color(0x550589);break; |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
110 case 'p': color = Color(0xed787f);break; |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
111 default: color = COLOR_WHITE; |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
112 } |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
113 it.print(0, 150, id(font_teko_small), color, text); |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
114 |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
115 } |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
116 |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
117 text_sensor: |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
118 - platform: mqtt_subscribe |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
119 name: "line1" |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
120 id: line1 |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
121 topic: theater_lcd/line1 |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
122 on_value: |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
123 then: |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
124 - component.update: lcd |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
125 - platform: mqtt_subscribe |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
126 name: "line2" |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
127 id: line2 |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
128 topic: theater_lcd/line2 |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
129 on_value: |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
130 then: |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
131 - component.update: lcd |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
132 # ili9486 setup |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
133 # http://www.lcdwiki.com/3.5inch_Arduino_Display-UNO |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
134 # (https://www.aliexpress.com/item/4000055026873.html $12) |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
135 # and https://circuits4you.com/wp-content/uploads/2018/12/ESP32-Pinout.jpg |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
136 # |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
137 # GND - GND Power ground |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
138 # 5V - 5V 5V power input |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
139 # NC - 3V3 3.3V power input, this pin can be disconnected |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
140 # GND - LCD_RST LCD bus reset signal, low level reset |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
141 # |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
142 # GPIO16 - LCD_CS LCD bus chip select signal, low level enable |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
143 # |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
144 # GPIO17 - LCD_RS LCD bus command / data selection signal, low level: command, high level: data |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
145 # GPIO5 - LCD_WR LCD bus write signal |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
146 # GPIO18 - LCD_RD LCD bus read signal |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
147 |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
148 # GPIO33 - LCD_D0 LCD 8-bit data Bit0 |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
149 # GPIO32 - LCD_D1 LCD 8-bit data Bit1 |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
150 # GPIO13 - LCD_D2 LCD 8-bit data Bit2 |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
151 # GPIO12 - LCD_D3 LCD 8-bit data Bit3 |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
152 # GPIO14 - LCD_D4 LCD 8-bit data Bit4 |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
153 # GPIO27 - LCD_D5 LCD 8-bit data Bit5 |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
154 # GPIO26 - LCD_D6 LCD 8-bit data Bit6 |
d88085f35745
theater_lcd displays lines from mqtt on an ili9486 display in 8-bit mode
drewp@bigasterisk.com
parents:
diff
changeset
|
155 # GPIO25 - LCD_D7 LCD 8-bit data Bit7 |