Template warning will fail to render in Home Assistant core 2022.1

Hi everyone,
have currently following messages in HA log.

Can you help me please?

Template warning: ‘as_timestamp’ got invalid input ‘<template TemplateState(<state sensor.samba_backup_last_backup=2021-11-14 12:05; friendly_name=Letztes Backup @ 2021-11-15T08:31:20.325183+01:00>)>’ when rendering template ‘value_template: “{{ as_timestamp(now()) - as_timestamp(states.sensor.samba_backup_last_backup) }}”’ but no default was specified. Currently ‘as_timestamp’ will return ‘None’, however this template will fail to render in Home Assistant core 2022.1

- platform: template
  sensors:
    time_formatted_samba_backup:
      friendly_name: "samba_backup"
      value_template: "{{ as_timestamp(states('sensor.samba_backup_last_backup')) | 
      timestamp_custom('%d.%m.%Y - %H:%M') }}"
      icon_template: mdi:calendar-clock  

Template variable error: ‘value’ is undefined when rendering '{% if value.daysTo == 0 %}heute{% elif value.daysTo == 1 %}morgen{% else %}in {{value.daysTo}} Tagen{% endif %}'Template variable error: ‘value’ is undefined when rendering 'sensor: - platform: waste_collection_schedule name: Abfall Restmüll details_format: “upcoming” value_template: >- {% if value.daysTo == 0 %} HEUTE {% elif value.daysTo == 1 %} MORGEN {% else %} in {{value.daysTo}} Tagen {% endif %} types: - Restabfall’Template variable error: ‘value’ is undefined when rendering ‘sensor: - platform: waste_collection_schedule name: Abfall Restmüll details_format: upcoming value_template: >- {% if value.daysTo == 0 %} HEUTE {% elif value.daysTo == 1 %} MORGEN {% else %} in {{value.daysTo}} Tagen {% endif %} types: - Restabfall’

sensor:
  - platform: waste_collection_schedule
    name: Abfall Restmüll
    details_format: "upcoming"
    value_template: '{% if value.daysTo == 0 %}heute{% elif value.daysTo == 1 %}morgen{% else %}in 
    {{value.daysTo}} Tagen{% endif %}'
    types:
      - Restabfall
1 Like