Installing ESPhome on GEEKMAGIC Smart Weather Clock (smalltv/pro)

Code example for the Small GeekMagic (non-Pro, running on ESP8266) display using mipi_spi

esp8266:
  board: esp01_1m

spi:
  clk_pin: GPIO14
  mosi_pin: GPIO13
  interface: hardware
  id: spihwd
  
display:
  - id: disp
	platform: mipi_spi
	model: ST7789V      
	spi_id: spihwd
	
	dimensions:
	  height: 240
	  width: 240
	  offset_height: 0 
	  offset_width: 0

	dc_pin: GPIO00
	reset_pin: GPIO02
	
	buffer_size: 12.5%
	invert_colors: true
	color_depth: 16
	color_order: BGR
	spi_mode: mode3
	data_rate: 40000000
	
	rotation: 0°
	auto_clear_enabled: False
	update_interval: never 
	lambda: |-
	  it.fill(Color(0, 0, 0));

Hi all,
I’m building a small “Mini TV” style device: ESP32 (WROOM) + ST7789V 240x240 display running ESPHome 2026.x (ESP-IDF). The case/board has a capacitive touch electrode (copper pad) with only a single wire going to a touch-capable pin.

What I’ve confirmed:

  • ESPHome clearly detects the touch channel as T8 = GPIO33 (log shows: Touch Pad 'Mini TV Touch' (T8): ...).​
  • Raw readings sit around ~2320–2440 and barely change when touching—still within the same jitter/noise range.​
  • Because of that, a fixed threshold is not reliable; docs state that touching should cause a significant change in logged values so you can pick a threshold between “touched” and “not touched”.​
  • I tried setting noise_threshold, but ESPHome complains that if you set one of those filtering parameters you must set the whole group (error: “Must specify either none or all of debounce_count, filter_mode, noise_threshold, jitter_step, smooth_mode.”).​

Current simplified config:

text

esp32_touch:
  setup_mode: true

binary_sensor:
  - platform: esp32_touch
    name: "Mini TV Touch"
    pin: GPIO33
    threshold: 1000

(Threshold is just a placeholder since touch/no-touch isn’t separating.)​

Questions:

  1. Does anyone have this Mini TV/SmallTV/ST7789V board (or similar “single-wire touch pad”) working out of the box with ESPHome?
  2. Any known fixes when touch readings barely move (need a ground reference, second electrode/foil, cable routing, power supply differences USB vs PSU, etc.)?
  3. If you have it working: which touch pin/channel and what threshold values do you use?

Thanks!

esp32_touch:

binary_sensor:
  - platform: esp32_touch
    name: "Touch Pad"
    disabled_by_default: True
    internal: True
    pin: GPIO32
    threshold: 1500
    id: my_touch_pad

This is on the “pro” version. Use this button almost every day, works very consistently.

1 Like

Thanks a lot — your tip helped. I kept the original device name (mini-tv) so OTA/mDNS keeps working, then added an ESP32 touch pad on GPIO32 and use it as a “page button” to cycle page 1→2→3→1.

text

# Touch as a page-button (ESP32-S2/S3 style values: touch goes UP)
esp32_touch:
  setup_mode: false

binary_sensor:
  - platform: esp32_touch
    id: touch_page
    name: "Touch Page Button"
    pin: GPIO32       
    threshold: 1300  
    internal: true
    disabled_by_default: true

    on_press:
      then:
        - lambda: |-
            int p = id(page) + 1;
            if (p > 3) p = 1;
            id(page) = p;
        - component.update: tv
1 Like

I flashed a firmware onto the device, and actually got it discovered into HAOS. When I tried to edit the YAML to make a display on it, it would not recognize the simple OTA password that I programmed into the firmware, and at this point, I think I may have bricked it.

I know the password is right.

I even tried it with no password as GPT suggested:

Hi @Touk,

Your post, showing the added button on the ESP2866 immediately caught my interest and I’m wondering, why nobody else ever asked you dozens of questions about it…
So far, I was of the impression that an additional button would only be possible via a dedicated TTP IC. As I’d also love to add a button to cycle through my HA pages on the cube, could you kindly elaborate a bit on how you achieved this?

Thank you and best regards,
Jay

If you install esphome on it one of options is touch sensor i mentioned above (mounted under top part):

This way you don’t need drilling, you won’t see nothing but touching on the top you’ll be able to switch pages. You connect-solder it to any free available pin.

Disclaimer: This only works on certain ESP32 models. Check the data sheets and which GPIO pins work.

What do you mean? You probably mean built-in touch function in some esp’s, that ‘s not what i suggested. The one i mentioned is standalone touch sensor board, by touching it you get 3.3V on the output pin. It’s compatible with any esp, any avr, any pic… so you just connect it to any free pin available and program it as binary sensor.

Yeah of course, which part ? Code is here : geekmagicTV-Ultra.yaml · master · N3G / ESPHome · GitLab and for soldering things I think pictures could be enough informations, what do you need ?

2 Likes

@pplucky

I also have the gm32-n16 n4xx Pro version.

How did you get esphome on this device ?

I compiled a very minimum version

esphome:
  name: espminidisplay2
  friendly_name: ESP MiniDisplay 2

esp32:
  board: esp32dev
  framework:
    type: esp-idf

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password  

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Fallback Hotspot"
    password: "00000000000000"

captive_portal:


#enable HA API
api:

ota:
  - platform: esphome

#enable logger
logger:

instead of esp-idf I also tried arduino as recommended by an other user, but no difference

I tried the OTA and the factory version to upload via the original webinterface.
For the OTA version, its rebooting but only with the original firmware. With the Factory version, the ESP is doing nothing.

Connecting via cable does not work.

Now I got it working, you have to flash it with the UART adapter, I found the pinout on this side

PINs on header (verified with multimeter, WROOM module pin number in parens):

    1 GND square
    2 TX (35)
    3 RX (34)
    4 3V3
    5 GPIO0 (25) - must be held low on reset
    6 RST (3)

To let the programmer automatically reset the board: Connect pad 1 (GND) to pad 5 (GPIO0).

flashed with ESPHome Webinstaller:
https://web.esphome.io/

When connecting to the PC, you need to connect GPIO0 to GND and then click on Prepare for first use. After that, you can disconnect it from GND again—basically as soon as you see that the firmware is being written.

Wi-Fi was a bit tricky; I had to connect several times because otherwise the error
An error occurred. Improv Wi-Fi Serial not detected
kept appearing.

After that, the device was discovered in Home Assistant and I was able to add it. It was also found in ESPHome, where I could add it as usual.

So, now it’s time to get down to the real work.

Did you manage to resolve this? I can’t seem to get factory firmware to boot, I can install it like I would ESPHome but when I upload factory firmware os, it install I reset and nothing happens

Because of this thread, i bought such a gadget
“FREENOVE FNK0112 Bitcoin Miner Solo Lottery Miner Mini ESP32 TV” and tried to flash it with a firmaware from

hoping thet the pins are the same! But no luck, in the logs there is a error regarding the display:

[19:14:48.267][C][logger:339]:   Level for 'template.number': ERROR
[19:14:48.288][C][spi:066]: SPI bus:
[19:14:48.288][C][spi:152]:   CLK Pin: GPIO18
[19:14:48.288][C][spi:152]:   SDI Pin: 
[19:14:48.288][C][spi:152]:   SDO Pin: GPIO23
[19:14:48.292][C][spi:074]:   Using HW SPI: SPI2_HOST
[19:14:48.310][C][ili9xxx:089]: ili9xxx
[19:14:48.310][C][ili9xxx:089]:   Rotations: 0 °
[19:14:48.310][C][ili9xxx:089]:   Dimensions: 240px x 240px
[19:14:48.310][C][ili9xxx:090]:   Width Offset: 0
[19:14:48.310][C][ili9xxx:090]:   Height Offset: 0
[19:14:48.313][C][ili9xxx:099]:   Color mode: 16bit
[19:14:48.313][C][ili9xxx:108]:   Data rate: 20MHz
[19:14:48.313][C][ili9xxx:152]:   Reset Pin: GPIO4
[19:14:48.319][C][ili9xxx:152]:   DC Pin: GPIO2
[19:14:48.319][C][ili9xxx:114]:   Color order: BGR
[19:14:48.319][C][ili9xxx:114]:   Swap_xy: NO
[19:14:48.319][C][ili9xxx:114]:   Mirror_x: NO
[19:14:48.319][C][ili9xxx:114]:   Mirror_y: NO
[19:14:48.319][C][ili9xxx:114]:   Invert colors: YES
[19:14:48.319][C][ili9xxx:124]:   => Failed to init Memory: YES!
[19:14:48.325][C][ili9xxx:452]:   Update Interval: 1.0s
[19:14:48.325][E][component:226]:   display is marked FAILED: unspecified
[19:14:48.326][C][light:091]: Light 'Display Backlight'
[19:14:48.330][C][light:094]:   Default Transition Length: 1.0s
[19:14:48.330][C][light:094]:   Gamma Correct: 2.80
[19:14:48.345][C][esp32_touch:019]: Config for ESP32 Touch Hub:
[19:14:48.345][C][esp32_touch:019]:   Meas cycle: 8.19ms
[19:14:48.345][C][esp32_touch:019]:   Sleep cycle: 27.31ms
[19:14:48.345][C][esp32_touch:019]:   Low Voltage Reference: 0.5V
[19:14:48.345][C][esp32_touch:019]:   High Voltage Reference: 2.7V
[19:14:48.345][C][esp32_touch:019]:   Voltage Attenuation: 0V
[19:14:48.345][C][esp32_touch:019]:   Release Timeout: 100ms
[19:14:48.345][C][esp32_touch:078]:   IIR Filter DISABLED
[19:14:48.365][C][captive_portal:128]: Captive Portal:

After setting the color_palette: 8Bit the init memory error is gone, but still only a blank screen
So my question is, can someone tell me the right pinout?
Regards
Christoph


So, after some digging the display shows the result!!
At first, Freenove sent me a Schematic of the Mini TV, so i could extract the right pinout.
After that i had to set the pin vor VDD to high on boot and this is the resulting yaml:

substitutions:
  device_name: "freenove-esp32-mini-tv"

esphome:
  name: ${device_name}
  friendly_name: "Freenove ESP32 Mini TV"
  on_boot: 
    - priority: 200
      then:
        - output.turn_on: output_vdd
      
esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:
  level: VERBOSE
  baud_rate: 0 #no hardware serial connected to USB - unless using the internal programming header
  logs:
    #lvgl.component: VERBOSE
    light.component: ERROR
    light.output: ERROR
    number.component: ERROR
    ledc.output: ERROR
    template.number: ERROR

select:
  - platform: logger
    name: "Logger select"

# Enable Home Assistant API
api:
  encryption:
    key: "tZIPmmDJTeSM1yGv1iAO5Kr+P3pZ8H0zemll16veeVU="

ota:
  - platform: esphome

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: ${device_name}

captive_portal:

# external_components:
#  - source: github://clydebarrow/esphome@lvgl
#    components: [ lvgl ]

# Define a PWM output on the ESP32
output:
  - platform: ledc
    pin: GPIO19 #GPIO05
    inverted: True
    id: backlight_pwm

  - platform: gpio
    pin: GPIO21 
    id: output_vdd
    inverted: True

# Define a monochromatic, dimmable light for the backlight
light:
  - platform: monochromatic
    output: backlight_pwm
    name: "Display Backlight"
    id: back_light
    restore_mode: ALWAYS_ON
    on_turn_on:
      - light.turn_on:
          id: back_light
          brightness: 100%  # Set initial brightness to 100% on power up

esp32_touch:
  setup_mode: False

binary_sensor:
  - platform: esp32_touch
    name: "ESP32 Touch Pad"
    pin: GPIO32
    threshold: 1400

spi:
  clk_pin: GPIO14
  mosi_pin: GPIO13
  interface: hardware
  id: spihwd

color:
  - id: my_red
    red: 100%
    green: 0%
    blue: 0%
  - id: my_orange
    red: 100%
    green: 50%
    blue: 0%
  - id: my_yellow
    red: 100%
    green: 100%
    blue: 0%
  - id: my_green
    red: 0%
    green: 100%
    blue: 0%
  - id: my_blue
    red: 0%
    green: 0%
    blue: 100%
  - id: my_teal
    red: 0%
    green: 100%
    blue: 100%
  - id: my_gray
    red: 70%
    green: 70%
    blue: 70%
  - id: my_white
    red: 100%
    green: 100%
    blue: 100%
  - id: my_black
    red: 0%
    green: 0%
    blue: 0%

font:
  - file: "gfonts://Roboto"
    id: font_48
    size: 48
  - file: "gfonts://Roboto"
    id: font_36
    size: 36
  - file: "gfonts://Roboto"
    id: font_24
    size: 24
  - file: "gfonts://Roboto"
    id: font_12
    size: 12

display:
  - platform: ili9xxx
    id: lcd_display
    model: st7789v
    spi_id: spihwd
    data_rate: 20MHz #oringal device uses 20mhz - 40 is default and works - does not work at 80mhz
    cs_pin: GPIO15 #CS pin is connected to gnd I believe
    dc_pin: GPIO02
    #reset_pin: GPIO04
    #spi_mode: MODE3   #since no cs pin default is mode0
    dimensions:
      width: 240
      height: 240
      offset_height: 0
      offset_width: 0
    invert_colors: true
    color_palette: 8BIT
    #update_interval: never
    #auto_clear_enabled: false
    lambda: |-
      it.rectangle(0,  0, it.get_width(), it.get_height(), id(my_blue));
      it.rectangle(0, 20, it.get_width(), it.get_height(), id(my_blue));   // header bar
      
      //it.print(5, 5, id(font_12), id(my_yellow), TextAlign::TOP_LEFT, "ESPHome");
      it.strftime(5, 5, id(font_12), id(my_yellow), TextAlign::TOP_LEFT, "%H:%M:%S", id(time_comp).now());
      
      it.print((it.get_width() / 2), (240 / 6.5) * 1 - 8, id(font_12), id(my_yellow), TextAlign::CENTER, "Testing");
      it.printf((it.get_width() / 2), (240 / 6.5) * 1 + 9, id(font_24), id(my_yellow), TextAlign::CENTER, "%.2fC", 0.000);
      it.line(0, (240 / 6.5) * 1 + 18, it.get_width(), (240 / 6.5) * 1 + 18, id(my_blue));
    
      it.print((it.get_width() / 2), (240 / 6.5) * 2 - 8, id(font_12), id(my_green), TextAlign::CENTER, "Testing 1");
      it.printf((it.get_width() / 2), (240 / 6.5) * 2 + 9, id(font_24), id(my_green), TextAlign::CENTER, "%.2fC", "1.111");
      it.line(0, (240 / 6.5) * 2 + 18, it.get_width(), (240 / 6.5) * 2 + 18, id(my_blue));
      
      it.print((it.get_width() / 2), (240 / 6.5) * 3 - 8, id(font_12), id(my_orange), TextAlign::CENTER, "Testing 2");
      it.printf((it.get_width() / 2), (240 / 6.5) * 3 + 9, id(font_24), id(my_orange), TextAlign::CENTER, "%.2fC", 2.222);
      it.line(0, (240 / 6.5) * 3 + 18, it.get_width(), (240 / 6.5) * 3 + 18, id(my_blue));
      
      it.print((it.get_width() / 2), (240 / 6.5) * 4 - 8, id(font_12), id(my_gray), TextAlign::CENTER, "Testing 3");
      it.printf((it.get_width() / 2), (240 / 6.5) * 4 + 9, id(font_24), id(my_gray), TextAlign::CENTER, "%.2fC", "3.333");
      it.line(0, (240 / 6.5) * 4 + 18, it.get_width(), (240 / 6.5) * 4 + 18, id(my_blue));
      
      it.print((it.get_width() / 2), (240 / 6.5) * 5 - 8, id(font_12), id(my_teal), TextAlign::CENTER, "Testing 4");
      it.printf((it.get_width() / 2), (240 / 6.5) * 5 + 9, id(font_24), id(my_teal), TextAlign::CENTER, "%.2fC", 4.444);
      it.line(0, (240 / 6.5) * 5 + 18, it.get_width(), (240 / 6.5) * 5 + 18, id(my_blue));
      
      it.print((it.get_width() / 2), (240 / 6.5) * 6 - 8, id(font_12), id(my_red), TextAlign::CENTER, "Testing 5");
      it.printf((it.get_width() / 2), (240 / 6.5) * 6 + 9, id(font_24), id(my_red), TextAlign::CENTER, "%.2fC", 5.555);

time:
  - platform: sntp
    id: time_comp
    timezone: "Europe/Berlin"

Hi everyone,

Sorry ESPhome noob here, I have the “ultra” version and after flashing the esphome created bin file via the webinterface, it is neither visible in the network nor via usb.

esphome:
  name: minitv
  friendly_name: GeekMagic Mini-TV

esp8266:
  board: d1_mini

wifi:
  ssid: "FRITZ!Box 4040 VY"
  password: "password"

#enable HA API
api:

ota:
  - platform: esphome

#enable logger
logger:

judging from the thread here I should have gone with esp01_1m instead of d1_mini, but also my board seems slightly different to the other esp8266

I will buy a ttl adapter and try to revive it with the yaml from @J0k3r2k1, will this work on my board?

esp8266:
  board: esp01_1m

spi:
  clk_pin: GPIO14
  mosi_pin: GPIO13
  interface: hardware
  id: spihwd
  
display:
  - id: disp
	platform: mipi_spi
	model: ST7789V      
	spi_id: spihwd
	
	dimensions:
	  height: 240
	  width: 240
	  offset_height: 0 
	  offset_width: 0

	dc_pin: GPIO00
	reset_pin: GPIO02
	
	buffer_size: 12.5%
	invert_colors: true
	color_depth: 16
	color_order: BGR
	spi_mode: mode3
	data_rate: 40000000
	
	rotation: 0°
	auto_clear_enabled: False
	update_interval: never 
	lambda: |-
	  it.fill(Color(0, 0, 0));

Same board as mine, here is what I used for my display, so what you have for the fix should solve the issue once you have the adapter:

display:  
  - platform: mipi_spi
    model: st7789v
    spi_id: spihwd
    dimensions: {height: 240, width: 240, offset_height: 0, offset_width: 0}
    invert_colors: true    
    dc_pin: GPIO00
    reset_pin: GPIO02
    color_depth: 8        
    spi_mode: mode3

Very good price today on Aliexpress for esp8266 version.

https://a.aliexpress.com/_mN923HX

Hi there,
thank you so much!
As I understand it this is just for the display, could you maybe share your whole yaml? Thank you so much in advance!

Sure, I use mine to basically act as a small weather station, pulling from my outside SwitchBot temperature sensors. I have some logic to show the high in the morning. Here is the yaml.

esphome:
  name: geekmagic
  friendly_name: Mini Display TV
  on_boot:
    priority: 600
    then:
      - light.turn_on:
          id: backlight
          brightness: 45%

esp8266:
  board: esp01_1m

api:
  encryption:
    key: "apiyourkey"

ota:
  - platform: esphome

logger:

wifi:
  ssid: "ssid"
  password: "password"
  min_auth_mode: WPA2

font:
  - file: "gfonts://Roboto"
    id: font_main
    size: 24
  - file: "gfonts://Roboto"
    id: font_large
    size: 48
  - file: "gfonts://Material+Symbols+Outlined"
    id: font_icon
    size: 50
    glyphs:
      - "\ue2cd" # snowy
      - "\ue518" # sunny
      - "\ue2bd" # cloudy
      - "\uf176" # rain
      - "\ue412" # lightning
      - "\ue2c4" # fog
      - "\uf172" # partly_cloudy
      - "\ue5d8" # Arrow Up
      - "\ue5db" # Arrow Down

time:
  - platform: homeassistant
    id: ha_time

spi:
  clk_pin: GPIO14
  mosi_pin: GPIO13
  interface: hardware
  id: spihwd

output:
  - platform: esp8266_pwm
    pin: GPIO05
    frequency: 1000 Hz 
    inverted: true
    id: backlight_pwm

light:
  - platform: monochromatic
    output: backlight_pwm
    name: "Backlight"
    id: backlight
    restore_mode: RESTORE_AND_ON 
    default_transition_length: 1s

sensor:
  - platform: homeassistant
    id: outside_temp
    entity_id: sensor.indoor_outdoor_meter_3b17_temperature
    internal: true
  - platform: homeassistant
    id: today_high
    entity_id: sensor.today_high_temp
    internal: true
  - platform: homeassistant
    id: today_low
    entity_id: sensor.today_low_temp
    internal: true

binary_sensor:
  - platform: homeassistant
    id: temp_rising
    entity_id: binary_sensor.temp_trend
    internal: true

text_sensor:
  - platform: homeassistant
    id: weather_cond
    entity_id: weather.home_2
    internal: true

display:  
  - platform: mipi_spi
    model: st7789v
    spi_id: spihwd
    dimensions: {height: 240, width: 240, offset_height: 0, offset_width: 0}
    invert_colors: true    
    dc_pin: GPIO00
    reset_pin: GPIO02
    color_depth: 8        
    spi_mode: mode3
    update_interval: 15s
    lambda: |-
      it.fill(Color::BLACK);
      int x_off = (id(ha_time).now().minute % 2 == 0) ? 0 : 1;

      // 1. Time (Top)
      it.strftime(120 + x_off, 35, id(font_main), Color::WHITE, TextAlign::CENTER, "%I:%M %p", id(ha_time).now());
      
      // 2. Weather Icon Logic
      if (id(weather_cond).has_state()) {
        std::string cond = id(weather_cond).state;
        const char* icon = "\ue2bd"; 
        Color icon_color = Color(180, 180, 180);

        if (cond == "sunny" || cond == "clear-night") { 
          icon = "\ue518"; icon_color = Color(255, 255, 0); 
        } else if (cond == "partlycloudy") {
          icon = "\uf172"; icon_color = Color(200, 200, 100);
        } else if (cond == "rainy" || cond == "pouring") { 
          icon = "\uf176"; icon_color = Color(0, 150, 255); 
        } else if (cond == "snowy") {
          icon = "\ue2cd"; icon_color = Color(255, 255, 255); 
        } else if (cond == "lightning" || cond == "lightning-rainy") {
          icon = "\ue412"; icon_color = Color(255, 255, 0);
        }

        it.print(120 + x_off, 85, id(font_icon), icon_color, TextAlign::CENTER, icon);
        it.printf(120 + x_off, 115, id(font_main), Color(150, 150, 150), TextAlign::CENTER, "%s", cond.c_str());
      }

      // 3. Main Temp + Arrow (Normal Logic)
      if (id(outside_temp).has_state()) {
        float temp = id(outside_temp).state;
        Color t_color = (temp > 70.0) ? Color(0, 255, 0) : ((temp >= 40.0) ? Color(255, 255, 0) : Color(0, 150, 255));
        
        it.printf(110 + x_off, 160, id(font_large), t_color, TextAlign::CENTER, "%.0f°", temp);

        if (id(temp_rising).has_state()) {
          const char* arrow = id(temp_rising).state ? "\ue5d8" : "\ue5db";
          Color arrow_color = id(temp_rising).state ? Color(255, 100, 100) : Color(100, 100, 255);
          it.print(180 + x_off, 155, id(font_icon), arrow_color, TextAlign::CENTER, arrow);
        }
      }

      // 4. Forecast (Morning Mode vs. Trend Mode)
      auto now = id(ha_time).now();
      int hour = now.hour;

      if (hour >= 5 && hour < 8) {
        // MORNING MODE (5am - 8am): Force High Temp
        if (id(today_high).has_state()) {
          it.printf(120 + x_off, 215, id(font_main), Color::WHITE, TextAlign::CENTER, "Today's High: %.0f°", id(today_high).state);
        }
      } else if (id(temp_rising).has_state()) {
        // TREND MODE: Show High if rising, Low if falling
        if (id(temp_rising).state) {
          if (id(today_high).has_state()) {
            it.printf(120 + x_off, 215, id(font_main), Color::WHITE, TextAlign::CENTER, "High: %.0f°", id(today_high).state);
          }
        } else {
          if (id(today_low).has_state()) {
            it.printf(120 + x_off, 215, id(font_main), Color::WHITE, TextAlign::CENTER, "Low: %.0f°", id(today_low).state);
          }
        }
      } else {
        // FALLBACK: Show both
        if (id(today_high).has_state() && id(today_low).has_state()) {
          it.printf(120 + x_off, 215, id(font_main), Color::WHITE, TextAlign::CENTER, "H: %.0f°  L: %.0f°", id(today_high).state, id(today_low).state);
        }
      }