Hello,
I’m getting the following error after upgrading to 2021.10:
Template warning: 'timestamp_local' got invalid input 'unavailable' when rendering template '{{ (as_timestamp(states("sensor.cert_expiry_timestamp")|timestamp_local))|timestamp_custom("%B %d, %Y") }}' but no default was specified. Currently 'timestamp_local' will return 'unavailable', however this template will fail to render in Home Assistant core 2021.12
The raw value of the “sensor.cert_expiry_timestamp” entity is 20121-11-19T15:00:07+00:00
Adding the (0) after timestamp_local causes the result to be “Unknown”. I verified this in the Developer Tools > Template tester and got the result as “None”
Removing it, results in the correct value “November 19, 2021”
Thanks, but that didn’t solve the problem. The error message now is:
Template warning: 'timestamp_local' got invalid input '20121-11-19T15:00:07+00:00' when rendering template '{{ (as_timestamp(states("sensor.cert_expiry_timestamp")|timestamp_local))|timestamp_custom("%B %d, %Y") }}' but no default was specified. Currently 'timestamp_local' will return 'unavailable', however this template will fail to render in Home Assistant core 2021.12
The rendered value is correct “November 19, 2021” but the error message mentions that the default value is missing.
This worked ! After I added a “)” after “0)” to fix a syntax error and restarted HA, there is not a “no default is specified” error and the correct value is rendered. Thanks!