using this script:
googlehome_announce:
alias: 'Googlehome announce'
sequence:
- service: tts.google_say
data_template:
language: en
entity_id: media_player.googlehome_woonkamer, media_player.googlehome_hobbykamer
message: >
{% set name = states[entityid.split('.')[0]][entityid.split('.')[1]].name %}
{{as_timestamp(now()) | timestamp_custom('%X') }} :
{% if tostate == 'not_home' %}
{{-name }} left {{fromstate}}
{% elif fromstate == 'not_home' %}
{{-name }} arrived at {{tostate}}
{% else %}
{{-name }} left {{fromstate}} and arrived at {{tostate}}
{% endif %}
my presence tracking is announced over my google homes perfectly, with one issue: it skips the hour. The time is registered perfectly, which I can check using this almost same script:
notify_presence:
alias: 'Notify presence'
sequence:
- service: notify.notify
data_template:
title: >
{{trigger}}: {{ states[entityid.split('.')[0]][entityid.split('.')[1]].name }} notification
message: >
{% set name = states[entityid.split('.')[0]][entityid.split('.')[1]].name %}
{{as_timestamp(now()) | timestamp_custom('%X') }} :
{% if tostate == 'not_home' %}
{{-name }} left {{fromstate}}
{% elif fromstate == 'not_home' %}
{{-name }} arrived at {{tostate}}
{% else %}
{{-name }} left {{fromstate}} and arrived at {{tostate}}
{% endif %}
showing me the exact message in a notification.
any thoughts on why this would happen? Could it be some kind of lag?
changing to:
Hi, at {{as_timestamp(now()) | timestamp_custom('%X') }} :
solves the issue for me, but still would be interested why this happens.