The home assistant docs point here to document how conditions can be set to prevent an action from happening. They also point to this in the template trigger documentation since action has been added to template sensors (2023.9).
I tried this configuration, but the condition doesn’t prevent the action as defined. Any ideas where I’m going wrong? I’ve tried to simplify the template config to the bare minimum. Even though the condition template evaluates to false, the debug log is still written.
I don’t think the trigger-based template sensor config has been updated to accept the pluralized keys yet. I think it should work using the shorthand in the condition block, but I haven’t tested it yet.
I was thinking the action and sensor updates weren’t coupled, but obviously reading the documentation, examples and why the action was added, it’s fairly clear they are.
I’m trying to add logic in the template that can be executed when a flag is set for debugging purposes to write debugging data to a file, mainly details about the jinja2 code to make sure what I think is happening at template trigger is actually happening. Hoping to make this reuseable in the future.
I can always remove or comment out the action block that is doing the debug file, I was just hoping for something easier to turn on/off with an entity.
I guess instead of having the action write the file I could call a script and decide there if any file writing should occur, but it would still have the overhead of the initial script call. Maybe not that bad a tradeoff for occasional debugging purposes.
Or maybe I should just figure out how to test my code better in the developer tools template pane.