ValueError: Template error: int got invalid input '<template TemplateState(<state sensor.ex4200=unavailable; restored=True, friendly_name=ex4200, supported_features=0 @ 2024-05-15T13:08:31.746892+02:00>)>' when rendering template '{{ states.sensor.juniper_ex4200 | int | timestamp_custom("%d.%m.%Y %H:%M")}}' but no default was specified
removing the value_template is working with the second timer
thanks for your help
You were trying to convert a state object (first line in screenshot below) to a number. I’m using the states() function to get the state of the object. Another (less-preferred) option is the third line:
You’ll see I have also included a default value on the int filter. That is useful if the sensor state is ever not a number (e.g. unavailable): the output will then be Jan 1970 rather than an error message.