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.