I have a sensor (door open / door closed) of a dishwasher. This sensor provides “off” when the door is closed and “on” when the door is open. I want as output the German terms instead of the English.
Example:
on–>“offen”
off–>“geschlossen”
For this I tried the following (used the command “replace”):
{{ states ('binary_sensor.geschirrspuler_door') | replace("on", "offen") | replace("off", "geschlossen")}}
But this does not work. Namely, it generates the following:
If door is open: “offen”
If door is close: “off”
Is there any documentation to “replace” or a better way to adapt the output to another language?
Besides that, one more question. Where is the best place to read up on the syntax of the commands as a beginner?
The problem is that “offen” includes “off”, which is then further processed in the next replace, but I can’t explain your results. You can test this in DevTools->Templates: