Hello - Hoping for some help. I’m trying to reformat a sensor attribute to better display on a card.
Sensor shows:
language: en
category: Met
event: wind gusts
responseType: Prepare
urgency: Immediate
severity: Minor
certainty: Likely
effective: 2024-06-10T09:04:00+02:00
onset: 2024-06-10T14:00:00+02:00
expires: 2024-06-10T21:00:00+02:00
Trying to reformat the onset from above to:
At time: 14:00
{% set begin_time = strptime(state_attr(‘binary_sensor.kusel’, ‘onset’), ‘%Y-%m-%dT%H:%m:%s+%z’) %}
ValueError: Template error: strptime got invalid input ‘2024-06-10T14:00:00+02:00’ when rendering template ‘{% set begin_time = strptime(state_attr(‘binary_sensor.kusel’, ‘onset’), ‘%Y-%m-%dT%H:%m:%s+%z’) %} {{begin_time}}’ but no default was specified
In effect from: 06-10-2024 until 06-10-2024
Begins: 14:00
Ends: 21:00
There is a risk of wind gusts (level 1 of 4).
Height range: > 400 m; Max. gusts: 50-60 km/h; Wind direction: south-west then west; Increased gusts: near showers and in exposed locations ~ 70 km/h