@ronschaeffer wrote:
I am getting the following error in when initialising a template sensor using
as_timestamp
:2020-04-01 06:41:29 WARNING (MainThread) [homeassistant.components.template] Template sensor 'date_short' has no entity ids configured to track nor were we able to extract the entities to track from the value template(s). This entity will only be able to be updated manually.
This is my config in sensors.yaml:
- platform: template sensors: date_short: friendly_name: Date value_template: "{{ as_timestamp(now()) | timestamp_custom('%d %b', True) }}"
The sensor
date_short
works and updates correctly (automatically) despite the warning.I assume that the error would go away if I used something like
{{ as_timestamp(strptime(states.sensor.date_time.state, '%d %b')) }}
which includes an entity id, but that does not appear to be the correct template. It returns None in the Develop Tools/Template.Any suggestions? Also, I’m intrigued as to why an entity is required even though it works correctly without.
Thanks.
Posts: 5
Participants: 2