So one can see that it will still take the input field instead of the variable with the same name, but the new variable (the one with different name) works just fine!
What you are trying to do there is a bit different than the use case I presented. My suggestion will substitute a default value if you do not provide an “optional” field parameter to suppress the variable warning.
You are redefining an already defined a field value as a variable. This can be done just by using a different variable name as you have done with field1_fixed. It can also be done by redefining the variable in the sequence block instead of the variables block.
For what it’s worth, I would have expected it to work in the variables block also, but as you discovered it appears it doesn’t. Not sure if it’s a bug or intended behaviour.
Try this example with the variable declared in the variable block and then again in the sequence block both calling it with a value defined for field1 and without.
We are in agreement here, I too am not sure if this is a bug or not, but as the default filter works, I would expect any other filter to work too… I think I’m going to open a bug and see what happens!
Fair enough, I understand if that is the case, however I can’t find anything like that on the documentation - and I have tried to find something on it…
I’ve now open the issue on this matter, if it is now a bug it will at least be closed with a comment confirming that.
Right, but that’ll be shut down because your issue is not the filters and the use of the same variable.
Example: You provide the following variable to your script: foo: TEST and you have foo: "{{ foo | default | lower }}" in your variable section. No matter what, if foo is provided you’ll always get foo: TEST. and lower will never be applied because you cannot overwrite what’s incoming.
I see you have a long value for “id” which I’ve never seen referenced in docs before. How is this determined? Can I just duplicate the “alias” field (which I already make unique)?
I just went to try the new debug feature and it says “only available with unique ID”…I’m guessing that’s this field? How do I make it so I can use the debugger?
Is it possible to configure the history size for the trace feature? Currently trace feature is “only” available for last 5 events of an automation. Couldn´t find a doc section in case it can be configured.
Would need it for integrations/platforms like alarm and device_tracker (maybe also uptime, filesize, systemmonitor, command_line, etc.). “id” or “unique_id” unfortunately seems to not be accepted.