I’m a little bit new to the coding part of HA. I’m trying to remap the values of a group I created. By default it has two states ‘on’ and ‘off’, but I want change this to the Dutch words ‘aan’ and ‘uit’.
I’ve pasted the code above in my configuration.yaml and the ‘Check configuration’ says it’s all good. Although I can’t seem to find this sensor within Developer Tools > States where it should pop-up I assume.
Can someone point me in the right direction? Thanks!
Your indentation is not correct. The slug (buitenverlichting:) must be indented two spaces under sensors:. Also don’t quote the items in your template results.
Finally there’s this warning you should take note of:
Thanks for the clarrification on how to use spaces, quotes etc. This helps a lot.
Unfortunately the code still doens’t work. When I try to use ‘buitenverlichting’ it still doens’t show up in “Developer Tools > States” and also shows no value when I try to use it within my banner-card.
Is this me?
Edit #1:
Fixed by changing it to:
template:
sensors:
buitenverlichting:
value_template: >-
{% if is_state('group.buiten', 'off') %}
Uit
{% elif is_state('group.buiten', 'on') %}
Aan
{% else %}
n/a
{% endif %}
Why does this work and your code didn’t? Can anyone explain so I do understand what I did here?
Edit #2::
I really starting to think I’m missing some kind of basic principal here since I try to do the same for a different sensor and…it doesn’t work the same. I’ll share some more of the code around it because I’ve got the feeling it’s all connected:
The first part of the code above worked for weeks. The second part for the ‘buitenverlichting’ also did work with the latest change. But after adding that same code for remote.sony_bravia_tv, all off the code got corrupted it seems.
I’m really doing something wrong here and kinda feel stupid now but I can’t see what it is.
Better. You’ve used a combination of multi-line and single line template that looks a bit odd and your indentation is not consistent. ideally you would do this: