I finally got my Home detection working reliable but it takes around 6 min for the detection to be Registered
So I would like to correct the time difference in the notifications
action:
- service: notify.ios_group_caspersen_home
data_template:
message: >
{% set offset_minutes = 6 %}
{% set t = (now().timestamp() - offset_minutes * 60) | timestamp_local %}
Left at {{ strptime(t,'%Y-%m-%d %H:%M:%S').strftime('%H:%M') }}
This converts the current time into seconds, subtracts the offset (converted to seconds) and stores the value as a string time stamp. Then it converts the string timestamp into a datetime object and pulls out the hour and minute as a string.
There are other ways to do it, this way handles any time transition.