Hello,
is there a possibility to configure an atuomation to do something before a specified time?
I have simple timer, It works at specified time but I want to power on heater 15 minutes before that specified time.
I suppose it need to do something with sensor alarm_time and substract 15 from minutes. But how to do that if minutes = for example 5?
I will appreciate any help.
Regards
Thanks for reply. The concept is right, but when I pasted code I have this error:
Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “C:\Users\Latitude\AppData\Local\Programs\Python\Python36\lib\site-packages\homeassistant\components\automation_init_.py”, line 330, in async_trigger
if skip_condition or self.cond_func(variables):
File "C:\Users\Latitude\AppData\Local\Programs\Python\Python36\lib\site-packages\homeassistant\components\automation_init.py", line 436, in if_action
return all(check(hass, variables) for check in checks)
File “C:\Users\Latitude\AppData\Local\Programs\Python\Python36\lib\site-packages\homeassistant\components\automation_init_.py”, line 436, in
return all(check(hass, variables) for check in checks)
File “C:\Users\Latitude\AppData\Local\Programs\Python\Python36\lib\site-packages\homeassistant\helpers\condition.py”, line 316, in template_if
return async_template(hass, value_template, variables)
File “C:\Users\Latitude\AppData\Local\Programs\Python\Python36\lib\site-packages\homeassistant\helpers\condition.py”, line 298, in async_template
value = value_template.async_render(variables)
File “C:\Users\Latitude\AppData\Local\Programs\Python\Python36\lib\site-packages\homeassistant\helpers\template.py”, line 132, in async_render
return self._compiled.render(kwargs).strip()
File “C:\Users\Latitude\AppData\Local\Programs\Python\Python36\lib\site-packages\jinja2\asyncsupport.py”, line 76, in render
return original_render(self, *args, **kwargs)
File “C:\Users\Latitude\AppData\Local\Programs\Python\Python36\lib\site-packages\jinja2\environment.py”, line 1008, in render
return self.environment.handle_exception(exc_info, True)
File “C:\Users\Latitude\AppData\Local\Programs\Python\Python36\lib\site-packages\jinja2\environment.py”, line 780, in handle_exception
reraise(exc_type, exc_value, tb)
File “C:\Users\Latitude\AppData\Local\Programs\Python\Python36\lib\site-packages\jinja2_compat.py”, line 37, in reraise
raise value.with_traceback(tb)
File “”, line 1, in top-level template code
File “C:\Users\Latitude\AppData\Local\Programs\Python\Python36\lib\site-packages\jinja2\sandbox.py”, line 427, in call
return __context.call(__obj, *args, **kwargs)
ValueError: Invalid format string