esphome_configs/kitchen-speaker.yaml

60 lines
2.4 KiB
YAML

substitutions:
name: home-assistant-voice-0972ec
friendly_name: Kitchen Speaker
weather_entity: weather.pirateweather
light_group_entity: light.kitchen_lights
packages:
Nabu Casa.Home Assistant Voice PE: github://esphome/home-assistant-voice-pe/home-assistant-voice.yaml
grove-i2c: github://esphome/home-assistant-voice-pe/modules/grove-i2c.yaml
voice_pe_clock_base: !include
file: packages/voice_pe_clock_base.yaml
esphome:
name: ${name}
name_add_mac_suffix: false
friendly_name: ${friendly_name}
api:
encryption:
key: !secret ha_voice_pe_kitchen_enc
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
display:
- platform: ssd1306_i2c
id: the_display
model: "SSD1306 128x64"
i2c_id: grove_i2c
flip_y: false
flip_x: false
contrast: "100%"
address: 0x3C
pages:
- id: page_time
lambda: |-
// it.strftime(110, 0, id(font_time), TextAlign::TOP_RIGHT, ((id(the_time).now().second % 4 < 2) ? "%l:%M" : "%l %M"), id(the_time).now());
// it.strftime(110, 0, id(font_time), TextAlign::TOP_RIGHT, ((id(the_time).now().second % 4 < 2) ? "%l:%M %P" : "%l %M %P"), id(the_time).now());
it.strftime(64, 0, id(font_time), TextAlign::TOP_CENTER, "%l:%M %P", id(the_time).now());
// it.printf(it.get_width()-2, 36, id(font_smaller), TextAlign::BOTTOM_RIGHT, "%c", id(the_time).now().strftime("%P")[0]);
if (id(show_weather).state) {
it.printf(0, 38, id(font_smaller),"%s%3.0f°", id(weather_icon_map)[id(weather_condition).state.c_str()].c_str(), id(weather_temp).state);
}
if (id(va).is_continuous()) {
it.print(80, 40, id(font_smaller), "\ue029");
} else if (id(va).is_running()) {
it.print(80, 40, id(font_smaller), "\uf5d1");
}
if (!id(va).get_timers().empty()) {
it.print(60, 40, id(font_smaller), "\ue425");
}
- id: page_timer
lambda: |-
int minutes = 0;
int seconds = 0;
auto timers = id(va).get_timers();
if (!timers.empty()) {
auto timer = timers.begin()->second;
minutes = timer.seconds_left / 60;
seconds = timer.seconds_left % 60;
it.print(0, 40, id(font_smaller), timer.name.c_str());
}
it.printf(it.get_width(), 0, id(font_time), TextAlign::TOP_RIGHT, "%d:%02d", minutes, seconds);