Skip to content

Instantly share code, notes, and snippets.

@luis-guilherme
Last active December 1, 2025 11:55
Show Gist options
  • Select an option

  • Save luis-guilherme/9849b38cdc99415ab17d58c79738cb1a to your computer and use it in GitHub Desktop.

Select an option

Save luis-guilherme/9849b38cdc99415ab17d58c79738cb1a to your computer and use it in GitHub Desktop.
ESPhome on GEEKMAGIC Smart Weather Clock (smalltv/pro)
#ultratv
#Taylor Dall shared this file. Want to do more with it?
#https://www.youtube.com/watch?v=S1Q9PZ95SDM
#https://community.home-assistant.io/t/installing-esphome-on-geekmagic-smart-weather-clock-smalltv-pro/618029/164
esphome:
name: geekmagic
friendly_name: Mini Display TV
esp8266:
board: esp01_1m
external_components:
- source:
type: git
url: https://github.com/rletendu/esphome.git
ref: st7789_nobuffer_202312
# refresh: 0s
components: [st7789v]
# Enable logging
logger:
# Enable Home Assistant API
api:
web_server:
port: 80
ota:
- platform: esphome
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Mini-Display-Tv"
password: "12345678"
captive_portal:
# -- First time install:
# ---- Use this file as a template for a new device ('Import from File') in the ESPHome Builder
# ---- Delete everything below these comments
# ---- Select 'INSTALL' then 'Manual download'
# ---- Flash the downloaded .bin file to the device via the GeekMagic web portal
# ---- The now-ESPHome device should become 'ONLINE' in the ESPHome Builder
# ---- YAML updates can now be deployed OTA ('INSTALL' -> 'Wirelessly')
spi:
clk_pin: GPIO14
mosi_pin: GPIO13
interface: hardware
id: spihwd
# status_led:
# pin: GPIO2
output:
- platform: esp8266_pwm
pin: GPIO05
frequency: 20 Hz
id: pwm_output
light:
- platform: monochromatic
output: pwm_output
name: "Backlight"
font:
- file: "gfonts://Stack+Sans+Notch"
id: font_small
size: 12
- file: "gfonts://Stack+Sans+Notch"
id: font_large
size: 24
color:
- id: color_green
red: 0%
green: 100%
blue: 0%
display:
- platform: st7789v
model: "Custom"
spi_id: spihwd
height: 240
width: 240
offset_height: 0
offset_width: 0
# dc_pin: GPIO02
# reset_pin: GPIO04
dc_pin: GPIO00
reset_pin: GPIO02
#backlight_pin: GPIO25
eightbitcolor: True
#update_interval: never
update_interval: 60s
id: disp
spi_mode: mode3
lambda: |-
it.fill(Color::BLACK);
it.printf(10, 5, id(font_large), Color::WHITE, "Solar:");
it.printf(130, 5, id(font_large), Color(0, 255, 0), "%.0f W", id(solar).state);
it.printf(10, 35, id(font_large), Color::WHITE, "Grid:");
it.printf(130, 35, id(font_large), Color(255, 0, 0), "%.0f W", id(usage).state);
it.printf(10, 60, id(font_large), Color::WHITE, "Excess:");
it.printf(130, 60, id(font_large), Color(0, 0, 255), "%.0f W", id(excess).state);
it.printf(10, 100, id(font_large), Color::WHITE, "P1S:");
std::string raw = id(p1s_state).state;
std::string p1s_info = "Unknown";
if (raw == "idle") p1s_info = "Idle";
else if (raw == "prepare") p1s_info = "Preparing...";
else if (raw == "init") p1s_info = "Initialising";
else if (raw == "pause") p1s_info = "Paused";
else if (raw == "running") p1s_info = "Printing...";
else if (raw == "slicing") p1s_info = "Slicing...";
else if (raw == "finish") p1s_info = "Finished";
else if (raw == "failed") p1s_info = "Failed";
else if (raw == "offline") p1s_info = "Offline";
it.printf(80, 100, id(font_large), Color(255, 255, 255), "%s", p1s_info.c_str());
it.rectangle(10, 145, 140, 5);
it.filled_rectangle(10, 145, 1.4*id(p1s_pc).state, 5, Color(0, 255, 255));
it.printf(170, 131, id(font_large), Color(255, 255, 255), "%.0f %%", id(p1s_pc).state);
it.printf(10, 165, id(font_large), Color::WHITE, "A1M:");
std::string raw2 = id(a1m_state).state;
std::string a1m_info = "Unknown";
if (raw2 == "idle") a1m_info = "Idle";
else if (raw2 == "prepare") a1m_info = "Preparing...";
else if (raw2 == "init") a1m_info = "Initialising";
else if (raw2 == "pause") a1m_info = "Paused";
else if (raw2 == "running") a1m_info = "Printing...";
else if (raw2 == "slicing") a1m_info = "Slicing...";
else if (raw2 == "finish") a1m_info = "Finished";
else if (raw2 == "failed") a1m_info = "Failed";
else if (raw2 == "offline") a1m_info = "Offline";
it.printf(80, 165, id(font_large), Color(255, 255, 255), "%s", a1m_info.c_str());
it.rectangle(10, 210, 140, 5);
it.filled_rectangle(10, 210, 1.4*id(a1m_pc).state, 5, Color(0, 255, 255));
it.printf(170, 196, id(font_large), Color(255, 255, 255), "%.0f %%", id(a1m_pc).state);
sensor:
- platform: homeassistant
id: solar
entity_id: sensor.inverter_2_71_callander
- platform: homeassistant
id: usage
entity_id: sensor.frient_grid_meter_power
- platform: homeassistant
id: excess
entity_id: sensor.net_power_export
- platform: homeassistant
id: p1s_pc
entity_id: sensor.p1s_01p00a411800520_print_progress
- platform: homeassistant
id: a1m_pc
entity_id: sensor.a1mini_0309ea490200160_print_progress
text_sensor:
- platform: homeassistant
id: p1s_state
entity_id: sensor.p1s_01p00a411800520_print_status
- platform: homeassistant
id: a1m_state
entity_id: sensor.a1mini_0309ea490200160_print_status
time:
- platform: homeassistant
id: current_time
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment