I have seen this error all over the place here but somehow I can’t apply the answers to my situation.
Like all the others I’d like to set a value based on a variable.
Below screenshot shows where I am coming from (point2) and what I want to do (point1)
I have tried quite a few variations, with quotes, without quotes, adding “data:”, whatever I found as proposed solution, but somehow don’t get any further.
In fact, I don’t understand why HA is complaining about a float in the first place? This is supposed to be an integer value but anyway, can’t get it to work in the UI and also not via the automation.yaml.
You cannot use templates, at all, with device actions. Don’t use device actions. They may be easy to setup in the UI but the code they make is barely human readable.
Ah, ok no device actions. So that probably means I need to edit the automation.yaml directly. Up to now device actions are the only type of automation I got, so couldn’t find any other yaml structure to reuse in automations.yaml. What should I look for instead? Any term I can search for here?
Apologies if this is a basic question, as you can probably tell, I am pretty new to HA
No, you can use the visual editor for most things except figuring out the templates. But after you open the “Add action” picker, don’t go with the first option “Device” but find the category for the entity type you want to operate on and then pick the appropriate action from there.
For your actions you’d pick the Number category and then the action Set. While this may sound near identical to what you’re already doing, and looking very similar in the visual editor, when you go to inspect the YAML they are very different.
And that worked right away. Thank you very much!
Haven’t come across this approach until now, and you are right, the yaml looks a lot cleaner now. Very easy to edit and duplicate in fact