Files
esphome-configs/mcu-clock-1.yaml
T
randy bb76912023 Set framework.advanced.flash_chip on ESP32 devices to save IRAM
Values come from ESPHome's own hint in the log of each online device
("Set flash_chip: ... to save IRAM"). Devices that were off got the value of
an identical board (ESP32-PICO-D4 ATOM/Stamp Pico: gd, JC3248W535: generic,
POW Elite: gd), marked as not read from the device.
2026-09-30 11:57:30 +02:00

167 lines
3.8 KiB
YAML

---
# Hardware: M5Stack M5Stamp C3
# Pinout:
# GPIO0 I2C SCL
# GPIO1 I2C SDA, BUTTON
# GPIO2 RGB
# GPIO4 DISPLAY CLOCK -> tm1637_display (display tm1637 clk_pin)
# GPIO5 DISPLAY DIO -> tm1637_display (display tm1637 dio_pin)
# GPIO6 GPIO
# GPIO7 GPIO
# GPIO8 GPIO
# GPIO9 GPIO (BUZZER?) -> rtttl_out (output ledc)
# GPIO10 GPIO
# GPIO20 UART RX
# GPIO21 UART TX
substitutions:
device: clock-1
name: Clock 1
area: Office R
comment: Clock
esphome:
name: mcu-${device}
friendly_name: ${name}
area: ${area}
comment: ${comment}
platformio_options:
board_build.flash_mode: dio
esp32:
variant: esp32c3
toolchain: esp-idf
framework:
advanced:
flash_chip: generic
type: esp-idf
# version: 5.4.2
# platform_version: 54.03.21
packages:
common: !include common/common.yaml
ipv6_only: !include common/ipv6_only.yaml
# https://github.com/granadaxronos/120-SONG_NOKIA_RTTTL_RINGTONE_PLAYER_FOR_ARDUINO_UNO/blob/master/RTTTL_PLAYER/songs.h
api:
actions:
- action: play_rtttl
variables:
song: string
then:
- rtttl.play:
rtttl: !lambda 'return song;'
# light:
# - platform: neopixelbus
# type: GRB
# pin: 2
# variant: WS2812
# method: ESP8266_UART1
# num_leds: 1
# name: "${name} Light"
# id: neo
# effects:
# # Use default parameters:
# - random:
# # Customize parameters
# - random:
# name: "My Slow Random Effect"
# transition_length: 30s
# update_interval: 30s
# - random:
# name: "My Fast Random Effect"
# transition_length: 4s
# update_interval: 5s
# - strobe:
# - strobe:
# name: Strobe Effect With Custom Values
# colors:
# - state: True
# brightness: 100%
# red: 100%
# green: 90%
# blue: 0%
# duration: 500ms
# - state: False
# duration: 250ms
# - state: True
# brightness: 100%
# red: 0%
# green: 100%
# blue: 0%
# duration: 500ms
# - flicker:
# - flicker:
# name: Flicker Effect With Custom Values
# alpha: 95%
# intensity: 1.5%
# - addressable_rainbow:
# - addressable_rainbow:
# name: Rainbow Effect With Custom Values
# speed: 10
# width: 50
# - addressable_scan:
# - addressable_scan:
# name: Scan Effect With Custom Values
# move_interval: 100ms
globals:
- id: alarm_id
type: bool
restore_value: no
initial_value: "false"
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);
}
}
output:
- platform: ledc
pin: 9
id: rtttl_out
rtttl:
output: rtttl_out
sensor:
- platform: homeassistant
id: temperature
entity_id: sensor.zigbee_outside_temperature
switch:
- platform: template
name: Alarm
optimistic: true
turn_on_action:
- globals.set:
id: alarm_id
value: 'true'
turn_off_action:
- globals.set:
id: alarm_id
value: 'false'