The BME680 sensor uses Celsius values, and HA converts these for the frontend, but I also want to display Fahrenheit values on a SSD1306 wired to the nodeMCU. I wrote this template to return display_temperature from bedroom_temperature:
- platform: template
id: display_temperature
internal: true
filters:
- lambda: return ('bedroom_temperature' | float) * (9.0/5.0) + 32.0;
but I get the following errors on compiling:
/config/esphome/bedroomthermostat.yaml:52:15: warning: character constant too long for its type
52 | - lambda: return ('bedroom_temperature' | float) * (9.0/5.0) + 32.0;
| ^~~~~~~~~~~~~~~~~~~~~
/config/esphome/bedroomthermostat.yaml: In lambda function:
/config/esphome/bedroomthermostat.yaml:52:39: error: expected primary-expression before 'float'
52 | - lambda: return ('bedroom_temperature' | float) * (9.0/5.0) + 32.0;
| ^~~~~
/config/esphome/bedroomthermostat.yaml:52:38: error: expected ')' before 'float'
52 | - lambda: return ('bedroom_temperature' | float) * (9.0/5.0) + 32.0;
| ~ ^~~~~~
| )
*** [/data/bedroomthermostat/.pioenvs/bedroomthermostat/src/main.cpp.o] Error 1
What have I got wrong here? Thanks for any help.