Diisplaying sensor calibration on ESPhome TM1637

I have an esp32 running ESPresense with a temperature sensor that I have calibrated in config.yaml:

  - platform: template
    sensors:
      corrected_temperature:
        unique_id: "sensors.espresense_ext_correct_temperature"
        friendly_name: "Corrected Ext Temperature"
        value_template: "{{ states('sensor.espresense_ext_bme280_temperature') | float - 3 }}"

This works and I can see the corrected temperature on my dash.

I have a display board powered by an ESP32 running ESPHome that uses TM1637 8 segment displays. It can’t display this corrected sensor and is only showing NaN. Here’s the relevant bits in the ESPHome yaml:

sensor:
  - platform: homeassistant
    name: "Extension temperature"
    id: ExtTemp
    entity_id: sensors.espresense_ext_correct_temperature

  - platform: tm1637
    id: tm1637_displayc
    clk_pin: 23
    dio_pin: 18
    lambda: |-
      it.printf("%.0f~C", id(ExtTemp).state);

Is the problem in the use of float twice? If anyone can point me at a solution that would be great.

In the serial logs for the device are you getting the temperature from home assistant correctly?

1 Like

aha, no they are not appearing. I hadn’t thought to check the logs. What would be the solution?

I don’t think this is required for homeassistant sensors, only services, but worth a try:

I don’t think that entity id is correct. Check developer tools → states.

Pretty sure it will be sensor.corrected_temperature

That’s sorted it, and I understand now how the entity ids are named, so thank you for that too!

1 Like