I have a template that returns number which means offset hours and I want to use it in Sun trigger automation. Is possible to use a template as offset?
I have try with this but does not work. {{(states('sensor.templatesunset_offset') | float * 3600) | timestamp_custom("%H:%M:%S", 0) }}
With regards,
Thanks for your reply. I think that this is not going to work for me because my offset is for sunset and I think that when sunset is finished the 'next_setting' attribute will be the sunset of tomorrow.
Install the Sun2 custom integration. It’s sensors are set up a bit differently, so you have access to the values for today, yesterday, and tomorrow as attributes:
I want to use a template for offset because in winter the sunset is earlier so I have created a template to add more offset if sunset hour is lower than 20h