Tm1637 change all few seconds

Hello Guys!
I have a basic AHT10 sensor:

sensor:
  - platform: aht10
    i2c_id: bus_a
    address: 0x38
    update_interval: 10s
    temperature:
      id: temp 
      name: "AHT10 Temperature"
      accuracy_decimals: 1 
      filters:
      - filter_out: -50
    humidity:
      name: "AHT10 Humidity"
      accuracy_decimals: 1
      filters:
      - filter_out: 0

and a tm1637 display

display:
    platform: tm1637
    id: tm1637_display
    clk_pin: 5
    dio_pin: 4
    lambda: |-
      it.printf(0, "%.1fC", id(temp).state);

I wanna change the display all 10 seconds like this:
temperature value
wait x seconds
humidity value
wait x seconds
temperature value…

Is this possible with ESPHome?

you could try something like this:

display:
    platform: tm1637
    id: tm1637_display
    clk_pin: 5
    dio_pin: 4
    update_interval: 10000ms
    lambda: |-
      static int i = 0;
      if (i == 0){
          i=1;
          it.printf(0, "%.1fC", id(temp).state);
      }else{
         i=0;
         it.printf(0, "%.1fC", id(humidity).state);
      }

and add id: humidity to humidity sensor

1 Like