Hi,
I have a statistics sensor to get a min and max temperature over the last 24 hours. This working very fine:
platform: statistics
name: sts_terrassetemp
entity_id: sensor.netatmo_terrasse_temperature
sampling_size: 1440
precision: 1
max_age:
hours: 24
Now the entity have two attributes to tell the min and max time for example:
min_age: 2019-10-07T11:05:42.037604+00:00
max_age: 2019-10-08T10:58:44.592072+00:00
How can I convert these attributes to my local time zone and a format like this: dd.mm. hh:mm to sho the timestamp with the min / max value at my frontend. Here ist the template config where I want to insert the timestamp:
platform: template
sensors:
tmp_terrasse_temp_min:
friendly_name_template: "Außen Min.-Temperatur 24h"
entity_id:
- sensor.sts_terrassetemp
icon_template: mdi:thermometer
unit_of_measurement: "°C"
value_template: >-
{{ states.sensor.sts_terrassetemp.attributes.min_value }}
tmp_terrasse_temp_max:
friendly_name_template: "Außen Maxi.-Temperatur 24h"
entity_id:
- sensor.sts_terrassetemp
icon_template: mdi:thermometer
unit_of_measurement: "°C"
value_template: >-
{{ states.sensor.sts_terrassetemp.attributes.max_value }}
Regards, Steffen