When you start HASS, the entity doesn’t exist yet, thus the error evaluating the value_template.
See if this helps: