First a bit of background, I have made a DIY climate controller using ESPHome which is taking temperature values from a nearby Sonoff Zigbee Temp and Humidity Sensor. This works flawlessly until I restart HA (for an update, change to the config etc), where the issue is that because the temperature hasn’t changed a new temp value is not sent from the Zigbee sensor and consequently the ESPHome Climate sensor does not pick it up. Eventually the sensor will send a temperature update I just want to make it better.
What I have thought of doing is create a template sensor from this Zigbee sensor so I can always keep a value in HA and not have to wait for the sensor to update, but I am having issues doing so (Template Sensors are a bit of a rabbit hole). I have got this in my config file:
template:
- sensor:
- name: "Hallway Temp Template"
device_class: temperature
unit_of_measurement: "°C"
value_template: "{{(states(sensor.hallway_sensor_temperature)}}"
This completes without error but when checking the config prior to a system restart I get this error in the HA Logs
Logger: homeassistant.config
Source: config.py:929
First occurred: 09:40:55 (6 occurrences)
Last logged: 10:00:35
Invalid config for [template]: [value_template] is an invalid option for [template]. Check: template->sensor->0->value_template. (See /config/configuration.yaml, line 177).
I dont really know what the invalid option is, granted I have just been using other posts and the somewhat difficult to understand HA help pages for this. Any help would be much appreciated. All I want is the value of the Zigbee sensor added to a template so there is never an occurrence of no known value.