Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95919

Last_changed in lovelace, fix timezone

$
0
0

@dantist wrote:

I have a markdown card in lovelace that shows when the front door was last opened, but it’s one hour off.

content: >-
  {{
  states.binary_sensor.homematic_door_sensor_state.last_changed.strftime('%H:%M
  Uhr (%d.%m.%Y)') }}
title: Tür zuletzt geöffnet
type: markdown

Bildschirmfoto 2020-02-06 um 08.41.41

As stated here by @pnbruckner, “last_changed” is not timezone aware. But I cannot find out how to adjust the timezone in lovelace. I was able to change the string by doing this:

{{ states.binary_sensor.homematic_door_sensor_state.last_changed|regex_replace(find='\+00:00', replace='+01:00') }}

but then I cannot use strftime on the result. Any ideas how to solve this in an elegant way?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 95919

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>