-
Notifications
You must be signed in to change notification settings - Fork 1
/
octo_mini_ihd.yaml
149 lines (119 loc) · 3.86 KB
/
octo_mini_ihd.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
esphome:
name: octo-mini
friendly_name: Octo_mini
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "uY7jqgA2P1eWkRumnvpKxcg/75XZTkJoldC4T9W+QUE="
ota:
password: "f0a4cb41ba92f1e66b4e224d075703ac"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Octo-Mini Fallback Hotspot"
password: "y9WKwfFiCSUC"
# Example configuration entry
font:
- file: 'fonts/Roboto-Regular.ttf'
id: font1
size: 40
- file: 'fonts/Roboto-Regular.ttf'
id: font2
size: 20
image:
- file: 'images/home_mini_banner_color.png'
id: mini
- file: mdi:lightning-bolt
id: elec
resize: 40x40
- file: mdi:fire
id: gas
resize: 40x40
- file: mdi:currency-gbp
id: pound
resize: 40x40
- file: mdi:battery-50
id: batt
resize: 40x40
- file: mdi:percent-outline
id: percent
resize: 30x30
time:
- platform: sntp
id: esptime
sensor:
- platform: homeassistant
id: elec_use
entity_id: sensor.octopus_energy_electricity_21l4147332_1012619597689_current_accumulative_consumption
internal: true
- platform: homeassistant
id: gas_use
entity_id: sensor.octopus_energy_gas_e6s13326232161_3023327309_current_accumulative_consumption
internal: true
- platform: homeassistant
id: elec_cost
entity_id: sensor.octopus_energy_electricity_21l4147332_1012619597689_current_accumulative_cost
internal: true
- platform: homeassistant
id: gas_cost
entity_id: sensor.octopus_energy_gas_e6s13326232161_3023327309_current_accumulative_cost
internal: true
- platform: homeassistant
id: soc
entity_id: sensor.victron_system_battery_soc
internal: true
# Pins for Waveshare ePaper ESP Board
spi:
clk_pin: GPIO13
mosi_pin: GPIO14
# Now render everything on the ePaper screen.
display:
- platform: waveshare_epaper
id: eink_display
cs_pin: GPIO15
dc_pin: GPIO27
busy_pin: GPIO25
reset_pin: GPIO26
reset_duration: 200ms
model: 2.90inv2
update_interval: 1min
# If everything works, try to set full_update_every to 30 or 60
full_update_every: 1
rotation: 90°
lambda: |-
//it.image(0, 0, id(mini));
if (id(soc).has_state()) {
// Print time in HH:MM format
it.strftime(187, 35, id(font1), TextAlign::BASELINE_LEFT, "%H:%M", id(esptime).now());
it.image(0, 0, id(batt));
it.image(87, 10, id(percent));
it.printf(45, 35, id(font1), TextAlign::BASELINE_LEFT ,"%.0f", id(soc).state);
}
if (id(elec_use).has_state()) {
it.printf(120, 55, id(font2), "kWh");
it.image(0, 45, id(elec));
it.printf(40, 75, id(font1), TextAlign::BASELINE_LEFT ,"%.1f", id(elec_use).state);
}
if (id(gas_use).has_state()) {
it.printf(120, 100, id(font2), "kWh");
it.image(0, 85, id(gas));
it.printf(40, 120, id(font1), TextAlign::BASELINE_LEFT ,"%.1f", id(gas_use).state);
}
if (id(elec_use).has_state()) {
it.printf(210, 75, id(font1), TextAlign::BASELINE_LEFT ,"%.2f", id(elec_cost).state);
it.image(165, 40, id(pound));
}
if (id(gas_use).has_state()) {
it.image(165, 85, id(pound));
it.printf(210, 120, id(font1), TextAlign::BASELINE_LEFT ,"%.2f", id(gas_cost).state);
}
captive_portal: