Hi all – kind of befuddled here. I’m trying to reference an “input_number” in the threshold for an automation so I can control it via the UI. This is the relevant condition field in the automation:
The “minutes: {{input_number.sump_off_length | float}}” is my attempt at imputing the input value into the automation. My understanding from the documentation is that this should work, but I keep getting
Message malformed: expected float for dictionary value @ data['for']['minutes']
Is this use case supported? Any thoughts on how to make this work? The goal is to set the input slider in the UI to, e.g., 10 and then to trigger this automation after the device is off for 10 minutes.
Thank you for taking the time to answer – I really appreciate it.
For posterity / future reference, how did you divine that distinction from the documentation? Why states() v.s. direct interpolation (seems arbitrary? {{input_number.sump_off_length | float}} resolves in the template debugger) and why the state condition type v.s. device. These appear to be equivalent just behave differently?
Typically, if the documentation doesn’t include a particular operation, or provide examples of performing it, then it cannot be done.
For example, nowhere in the documentation for Device Trigger does it explain that after creating it using the UI, you can then switch to YAML mode and add templates to any part of it. For Device Condition, there’s simply no documentation; create it via the UI and nothing more. Device Trigger, Device Condition, and Device Action were designed to be used exclusively via the UI (the visual automation/script editor) and not meant to be created/modified via YAML.