This works in a browser and did work on a google hub.
square: false
columns: 1
type: grid
cards:
- type: markdown
content: >
{{ states('input_text.notify_text') }}
{%- set time = (as_timestamp(now()) -
as_timestamp(states.input_text.notify_text.last_changed)) | int %}
{%- set minutes = ((time % 3600) // 60) %}
{%- set minutes = '{}m'.format(minutes)|format(morph='minutes',
as_text=false) if minutes > 0 else '' %}
{%- set hours = ((time % 86400) // 3600) %}
{%- set hours = '{}h '.format(hours)|format(morph='hours', as_text=false)
if hours > 0 else '' %}
{%- set days = (time // 86400) %}
{%- set days = '{} days '.format(days)|format(morph='days', as_text=false)
if days > 0 else '' %}
{{ '< 1 minute' if time < 60 else days + hours + minutes }}
But now this does not computeā¦ The google display just prints the code on the hub instead of executing it.
Anyone else getting this problem?