forked from landonr/homeThing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfireremote.yaml
executable file
·195 lines (182 loc) · 4.41 KB
/
fireremote.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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
esphome:
name: fireremote
platform: ESP32
board: m5stack-fire
includes:
- esphomeRemote/MenuGlobals.h
- esphomeRemote/MenuTitle.h
- esphomeRemote/FriendlyNameEntity.h
- esphomeRemote/TextHelpers.h
- esphomeRemote/esphomeRemotePlayer.h
- esphomeRemote/esphomeRemoteService.h
- esphomeRemote/esphomeRemoteLight.h
- esphomeRemote/esphomeRemoteSwitch.h
- esphomeRemote/esphomeRemoteSensor.h
- esphomeRemote/DisplayUpdateInterface.h
- esphomeRemote/esphomeRemote.h
- esphomeRemote/esphomeRemoteNowPlayingMenu.h
- esphomeRemote/esphomeRemote3Button.h
- esphomeRemote/esphomeRemoteFireLight.h
substitutions:
boot_name: '"Fire Remote <3"'
friendly_name: "M5Fire Remote"
wifi_ssid: !secret wifi_ssid
wifi_password: !secret wifi_password
wifi_fallback_password: !secret wifi_fallback_password
large_font_size: "24"
medium_font_size: "20"
small_font_size: "18"
icon_size: "24"
icon_size_large: "28"
header_height: "24"
margin_size: "8"
scroll_bar_width: "8"
bottom_bar_margin: "42"
now_playing_max_lines: "5"
draw_now_playing_menu: "true"
draw_battery_level: "true"
draw_volume_level: "false"
draw_shuffle_disabled: "false"
draw_header_time: "true"
color_accent_primary_red: 86%
color_accent_primary_green: 10%
color_accent_primary_blue: 20%
display_timeout: "16"
sleep_after: "7200"
menu_rollover_on: "false"
sync_active_player: "true"
dark_mode: "true"
<<: !include esphomeRemote/sharedRemoteConfig.yaml
external_components:
- source:
type: git
url: https://github.com/ssieb/custom_components
components: [ ip5306 ]
i2c:
sda: 21
scl: 22
scan: True
ip5306:
battery_level:
name: ${friendly_name} Battery Percent
id: batteryPercent
on_value :
then:
- lambda: |-
if(id(batteryPercent).state > previousBatteryLevel && !charging) {
charging = true;
} else if(id(batteryPercent).state <= previousBatteryLevel && charging) {
charging = false;
}
previousBatteryLevel = id(batteryPercent).state;
charger_connected:
internal: true
id: connected
on_press:
then:
- lambda: |-
ESP_LOGD("TEST", "charging");
if (charging == false) {
charging = true;
}
on_release:
then:
- lambda: |-
ESP_LOGD("TEST", "not charging");
if (charging == true) {
charging = false;
}
charge_full:
id: full
internal: true
on_press:
then:
- lambda: ESP_LOGD("TEST", "fully charged");
on_release:
then:
- lambda: ESP_LOGD("TEST", "still charging");
deep_sleep:
id: deep_sleep_fire
wakeup_pin: 39
wakeup_pin_mode: INVERT_WAKEUP
binary_sensor:
- platform: gpio
id: M5_BtnA
pin:
number: 39
inverted: true
on_click:
then:
- lambda: |-
buttonPressLeft();
- platform: gpio
id: M5_BtnB
pin:
number: 38
inverted: true
on_click:
then:
- lambda: |-
buttonPressSelect();
- platform: gpio
id: M5_BtnC
pin:
number: 37
inverted: true
on_click:
then:
- lambda: |-
buttonPressRight();
# We can still control the backlight independently
switch:
- platform: template
name: ${friendly_name} Sleep Toggle
id: sleep_toggle
optimistic: true
on_turn_on:
then:
- deep_sleep.enter:
id: deep_sleep_fire
- platform: gpio
pin: 32
name: ${friendly_name} Backlight
id: backlight
restore_mode: ALWAYS_ON
internal: true
light:
- platform: fastled_clockless
chipset: SK6812
pin: GPIO15
num_leds: 10
rgb_order: GRB
id: side_light
name: ${friendly_name} Remote Light"
restore_mode: ALWAYS_OFF
default_transition_length: 0s
effects:
- addressable_rainbow:
name: Rainbow Effect
speed: 20
width: 15
spi:
clk_pin: 18
mosi_pin: 23
miso_pin: 19
display:
- platform: ili9341
model: M5STACK
cs_pin: 14
dc_pin: 27
led_pin: 32 ### see note below ###
reset_pin: 33
id: my_display
update_interval: 10s
lambda: |-
manageLight();
if (idleTime < 0) {
ESP_LOGD("drawing menu", "turning on");
id(backlight).turn_on();
idleTime = 0;
}
drawMenu();
return;