-
Notifications
You must be signed in to change notification settings - Fork 1
/
mcu-eworkbench.yaml
169 lines (156 loc) · 3.24 KB
/
mcu-eworkbench.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
substitutions:
device: eworkbench
name: Electronics Workbench
comment: "Office R: Electronics Workbench"
esphome:
name: mcu-${device}
comment: ${comment}
platformio_options:
board_build.flash_mode: dio
esp32:
board: esp32-c3-devkitm-1
variant: esp32c3
framework:
type: esp-idf
version: 5.1.2
platform_version: 6.5.0
packages:
common: !include common/common.yaml
# GPIO20 UART RX, LOGGER
# GPIO21 UART TX, LOGGER
# GPIO9 GPIO
#
# GPIO0 I2C SCL
# GPIO1 I2C SDA
# GPIO2 RGB
# GPIO1 BUTTON
# GPIO4 GPIO
# GPIO5 GPIO
# GPIO6 GPIO
# GPIO7 GPIO
# GPIO8 GPIO
# GPIO10 GPIO
# GPIO18 UART RX
# GPIO19 UART TX
i2c:
- id: i2c_grove
sda: 1
scl: 0
scan: true
uart:
- id: uart_log
rx_pin: 20
tx_pin: 21
baud_rate: 115200
- id: uart_hdmi_switch
rx_pin: 18
tx_pin: 19
baud_rate: 9600
binary_sensor:
- platform: gpio
id: rotary_encoder_button
pin:
number: 6
# mode: INPUT_PULLUP
inverted: true
filters:
- delayed_on: 30ms
- delayed_off: 30ms
on_press:
- display_menu.enter:
display:
- platform: lcd_pcf8574
id: my_lcd
dimensions: 20x4
address: 0x27
user_characters:
- position: 0
data: # mark_back symbol
- 0b00100
- 0b01000
- 0b11110
- 0b01001
- 0b00101
- 0b00001
- 0b11110
- 0b00000
lambda: |-
id(my_lcd_menu).draw();
if (!id(my_lcd_menu).is_active())
it.print("Menu is not active");
lcd_menu:
id: my_lcd_menu
display_id: my_lcd
active: true
mode: rotary
mark_back: 0x08
mark_selected: 0x3e
mark_editing: 0x2a
mark_submenu: 0x7e
items:
- type: back
text: 'Back'
- type: label
text: 'Label 1'
- type: label
text: !lambda |-
return "Templated label";
select:
- platform: template
id: hdmi_switch
optimistic: true
options:
- PC1
- PC2
- PC3
- PC4
initial_option: PC1
# set_action:
# - logger.log:
# format: "Chosen option: %s (index %d)"
# args: ["x.c_str()", "i"]
# - uart.write:
# id: uart_hdmi_switch
# data: [0x47, 0x30, 0x31, 0x67, 0x41, 0x00]
sensor:
- platform: rotary_encoder
id: rotary_encoder_sensor
pin_a: 4
pin_b: 5
filters:
debounce: 30ms
on_anticlockwise:
- display_menu.up:
on_clockwise:
- display_menu.down:
time:
- platform: homeassistant
id: ha_time
timezone: Europe/Bratislava
# display:
# - platform: tm1637
# id: tm1637_display
# clk_pin: 4
# dio_pin: 5
# update_interval: 500ms
# # intensity: 0
# lambda: |-
# static int i = 0;
# i++;
# if (id(alarm_id)) {
# if ((i % 2) == 0)
# it.print("8 8 ");
# else
# it.print(" 8 8");
# } else {
# if (((i / 10) % 2) == 0) {
# //it.set_intensity(7);
# if ((i % 2) == 0)
# it.strftime("%H.%M", id(ha_time).now());
# else
# it.strftime("%H%M", id(ha_time).now());
# } else {
# //it.set_intensity(1);
# it.printf("%.0f~C", id(temperature).state);
# }
# }