这在浏览器中可以工作,并且在Google Hub上也可以工作。

这在浏览器中可以工作,并且在Google Hub上也可以工作。

Markdown


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 = '{}分钟'.format(minutes)|format(morph='minutes',
      as_text=false) if minutes > 0 else '' %}

      {%- set hours = ((time % 86400) // 3600) %}

      {%- set hours = '{}小时 '.format(hours)|format(morph='hours', as_text=false)
      if hours > 0 else '' %}

      {%- set days = (time // 86400) %}

      {%- set days = '{}天 '.format(days)|format(morph='days', as_text=false)
      if days > 0 else '' %}

      {{ '< 1分钟' if time < 60 else days + hours +分钟}}

但是现在这个不计算...谷歌显示只是在中心打印代码而不是执行它。

还有其他人遇到这个问题吗?