Got it working with this code for ESPHome. Haven’t messed with it after that!
esphome:
name: funhouse
friendly_name: Funhouse
esp32:
board: esp32-s2-saola-1
framework:
type: arduino
# Enable logging
logger:
time:
- platform: sntp
id: sntp_time
# Enable Home Assistant API
#https://github.com/kbx81/esphome-configs/blob/95cd3053c8b3950216a7cc923de7705e7384c34a/dev/esp-funhouse.yaml
i2s_audio:
#below might be wrong
i2s_lrclk_pin: GPIO43
speaker:
- platform: i2s_audio
dac_type: external
i2s_dout_pin: GPIO42
color:
- id: kbx_red
red: 100%
green: 0%
blue: 0%
- id: kbx_yellow
red: 100%
green: 100%
blue: 0%
- id: kbx_green
red: 0%
green: 100%
blue: 0%
- id: kbx_blue
red: 0%
green: 0%
blue: 100%
- id: kbx_gray
red: 50%
green: 50%
blue: 50%
- id: kbx_white
red: 90%
green: 90%
blue: 90%
output:
- platform: ledc
id: funhouse_backlight_pwm
pin: GPIO21
light:
- platform: monochromatic
id: funhouse_backlight
name: Funhouse Backlight
output: funhouse_backlight_pwm
restore_mode: ALWAYS_ON
- platform: fastled_spi
name: Funhouse LEDS
chipset: DOTSTAR
data_pin: GPIO14
clock_pin: GPIO15
num_leds: 5
rgb_order: BGR
binary_sensor:
- platform: status
name: Funhouse Status
id: funhouse_status
- platform: gpio
id: funhouse_motion_sense
name: Funhouse Motion Detection
pin:
number: GPIO16
i2c:
id: i2c_bus
frequency: 400kHz
scl: 33
sda: 34
scan: true
spi:
clk_pin: GPIO36
mosi_pin: GPIO35
sensor:
- platform: aht10
temperature:
id: funhouse_aht20_temperature
name: FunhouseAHT20 Temperature
filters:
- offset: -8.044
humidity:
id: funhouse_aht20_humidity
name: Funhouse AHT20 Humidity
update_interval: 15s
- platform: dps310
temperature:
id: funhouse_dps310_temperature
name: Funhouse DPS310 Temperature
filters:
- offset: -8.75
pressure:
id: funhouse_dps310_pressure
name: Funhouse DPS310 Pressure
update_interval: 15s
- platform: wifi_signal # Reports the WiFi signal strength/RSSI in dB
name: "WiFi Signal dB"
id: wifi_signal_db
update_interval: 60s
entity_category: "diagnostic"
- platform: copy # Reports the WiFi signal strength in %
source_id: wifi_signal_db
name: "WiFi Signal Percent"
filters:
- lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
unit_of_measurement: "Signal %"
entity_category: "diagnostic"
device_class: ""
display:
- platform: st7789v
id: main_lcd
model: Adafruit Funhouse 240x240
rotation: 180
eightbitcolor: true
cs_pin: GPIO40
dc_pin: GPIO39
reset_pin: GPIO41
update_interval: 15 seconds
pages:
- id: page1
lambda: |-
const uint8_t header_height = 20;
const uint8_t vert_spacing_offset = 45;
const uint8_t vert_center = ((it.get_height() - header_height) / 2) + header_height;
it.rectangle(0, 0, it.get_width(), it.get_height(), id(kbx_blue));
it.rectangle(0, header_height, it.get_width(), it.get_height(), id(kbx_blue)); // header bar
it.print(5, 5, id(rfont), id(kbx_yellow), TextAlign::TOP_LEFT, "ESPHome");
if (id(funhouse_status).state) {
it.print(235, 5, id(rfont), id(kbx_green), TextAlign::TOP_RIGHT, "Online");
}
else {
it.print(235, 5, id(rfont), id(kbx_red), TextAlign::TOP_RIGHT, "Offline");
}
it.printf(it.get_width() / 2, vert_center - vert_spacing_offset, id(rfont), id(kbx_gray), TextAlign::BOTTOM_CENTER, "%.1f%%", id(funhouse_aht20_humidity).state);
it.printf(it.get_width() / 2, vert_center, id(rfont), id(kbx_white), TextAlign::CENTER, "%.1f°", id(funhouse_aht20_temperature).state * 1.8 + 32);
it.printf(it.get_width() / 2, vert_center + vert_spacing_offset, id(rfont), id(kbx_gray), TextAlign::TOP_CENTER, "%.1f hPa", id(funhouse_dps310_pressure).state);
font:
- file: "gfonts://Roboto"
id: rfont
size: 20