Thanks, well I dont want it to do anything other than switch from up to down, then another button will check it’s state and use that to increment / decrement a value.
I added a value template and that broke it completely:
You can not self reference the template switch state. That’s like saying “hey switch are you on, to check see if you are on”. It is not providing any information.
You probably want an input boolean helper.
These do not have icon templates though. So if this is important to you, then what you do is create a template switch to monitor and control the input_boolean.
The value_template has to resolve to true or false. At least that is what I assumed from memory and I see no contradiction here now that I have checked.
However states('input_boolean.up_down_dir') returns 'on' or 'off'.
The |bool filter converts common Home Assistant states like 'on' or 'off' to true or false respectively.
The value_template may have changed to recognise the states 'on' or 'off'. There have been a lot of improvements lately and I have not tested this, but as noted above there is nothing in the value_template documentation to say that it does recognise these states. So “better safe than sorry”.
Probably it used to be “true/false” some time ago.
I started learning HA on September 2020, created first switch may be at the end of 2020, it was “on/off” that time if I am not mistaken…