#if hour 9 and minute 11

1 messages · Page 1 of 1 (latest)

grizzled cedar
#

Where are you trying to use this on dashboard or automations?

stiff sinew
#

automations

grizzled cedar
#

Then use templates Jinja2 to do that.

stiff sinew
#

🙄 Thanks for the suggestion

#

but this is insane.

grizzled cedar
#

dunno what you mean by insane xD but HA main feature is Jinja Templates.

{% set mins = as_timestamp(now()) | timestamp_custom("%M") %}
{% set hrs = as_timestamp(now()) | timestamp_custom("%H") %}
{{ mins * 10 if hrs == 9 and mins < 11 }}
stiff sinew
#

that makes this easy.

#

{{ int(now().minute * 10) if now().minute <= 10 else 100 }}