Hi everybody,
I’m trying to write a binary sensor like this:
binary_sensor:
- platform: template
sensors:
abc:
value_template: >
{{ today_at("22:00:00") <= now() < today_at("08:00:00") or
today_at("14:00:00") <= now() < today_at("16:00:00") }}
But I need those times in a different timezone.
The problem is that the server where HA is running on is in UTC and I need to keep it like that, so I can’t use functions like as_local()
I thought that I could use
{% set dt = as_datetime(utcnow().timestamp() + 3600) %}
But then I realized that the calculation will break with daylight saving.
Any ideas how to do it without HACS/extra integrations?
Thank you.
Dex