These sensors work good but I notice I’m getting this error in the logs.
How to I set a default?
Error while processing template: Template<template=({{ as_timestamp(states('sensor.date_time_iso')) | timestamp_custom('%I:%M%p') }}) renders=114>
homeassistant.exceptions.TemplateError: ValueError: Template error: as_timestamp got invalid input 'unknown' when rendering template '{{ as_timestamp(states('sensor.date_time_iso')) | timestamp_custom('%I:%M%p') }}' but no default was specified
# Minimal configuration of the standard time and date sensor
- platform: time_date
display_options:
- 'date_time_iso'
# Build on the standard sensor to produce one that can be customized
- sensor:
- name: MyDateTime
state: "{{ as_timestamp(states('sensor.date_time_iso')) | timestamp_custom('%A %B %-d, %I:%M %p') }}"
icon: "mdi:calendar-clock"
- name: MyTime
state: "{{ as_timestamp(states('sensor.date_time_iso')) | timestamp_custom('%I:%M%p') }}"
icon: "mdi:calendar-clock"
- name: MyTimeShort
state: "{{ as_timestamp(states('sensor.date_time_iso')) | timestamp_custom('%I:%M') }}"
icon: "mdi:calendar-clock"