Having some issues with script logic that will see if I need to do a task when the script runs. This always evaluates to False, even if it shouldn’t. I have been unable to figure out how to debug what these values are at runtime so I am at a loss.
The point of this is to flip on a toggle switch when today is past last task date and the duration (21 days in this case)
sequence:
- if:
- condition: template
value_template: >-
"{{(states('input_datetime.last_changed_silver_cartridge') |
as_datetime | as_local + timedelta(days= 21 )).date() < now().date()
}}"
then: null
else:
- action: input_boolean.turn_on
metadata: {}
data: {}
target:
entity_id: input_boolean.silver_cartridge_toggle
alias: Maintenance Daily Update Script
description: ""
All help appreciated!