Hi all ![]()
Very new to ESPHome so please be gentle ![]()
I’m creating a 3D-printed model of my house and will be inserting seven 4-digit 7-segment displays into different parts of the model to give readouts of things like the Tesla Powerwall battery percentage, the cumulative power generation from the two banks of solar panels, etc.
I’ve relied heavily on ChatGPT to write YAML code for my Home Assistant system so far, and whilst I’ve been amazed how much I’ve been able to create with ChatGPT’s help, it seems to have struggled a lot with ESPHome.
I’m using one of these ESP32-S3-DevKit boards, and I’ve managed to produce the following code. This allows me to send text and brightness commands from Home Assistant via ‘Developer tools’ → ‘Actions’ → ‘.esphome.model_house_show_text’ to one 7-segment display:
esphome:
name: model-house
friendly_name: Model House
esp32:
board: esp32-s3-devkitc-1
framework:
type: esp-idf
logger:
api:
ota:
platform: esphome
password: XXX
wifi:
ssid: XXX
password: XXX
manual_ip:
static_ip: 192.168.1.88
gateway: 192.168.1.1
subnet: 255.255.255.0
dns1: 192.168.1.1
ap:
ssid: "Model-House Fallback Hotspot"
password: XXX
# =========================
# Home Assistant inputs
# =========================
text:
- platform: template
name: "Yellow 1 Text"
id: yellow_1_text
mode: text
optimistic: true
max_length: 4
initial_value: "0000"
number:
- platform: template
name: "Yellow 1 Brightness"
id: yellow_1_brightness
optimistic: true
min_value: 0
max_value: 7
step: 1
initial_value: 5
# =========================
# TM1637 display
# =========================
display:
- platform: tm1637
id: yellow_1
clk_pin: 5
dio_pin: 6
length: 4
update_interval: 1s
lambda: |-
it.set_intensity((int) id(yellow_1_brightness).state);
it.print(id(yellow_1_text).state.c_str());
The idea is to duplicate the ‘text’, ‘number’ and ‘display’ blocks of code with different IDs for each of the seven 7-segment displays: yellow_1, yellow_2, green, red, blue, white_1, white_2.
1. Firstly, I was wondering if this is the best code to use for this application?
2. Secondly, I’m having quite a few problems with the board disconnecting from my WiFi network – please see some screenshots of the logs below.
I’m using a Deco XE75 mesh WiFi network, and from previous logs I’ve seen, I think the board can see multiple instances of the same ‘Nova’ network … I’m wondering if it’s getting confused and trying to switch between multiple networks which is causing it to drop the connection?
3. Lastly, I would be grateful if you could suggest what code I can use to start sending automatically-updating data to the seven different displays, based on sensors in Home Assistant?
Many thanks for your help!
David

