Helper outcome specific text

Hi, I would like to implement a specific helper, what should be able to do…

  • if a conditions is true then I just need a text e.g. „yes“
  • if the conditions is false then I just need also a text e.g. „no“

What kind of helper is appropriate to do this?

Thanks!!!

Hi,

create a template helper and use the following template as an example:

{% if is_state('sun.sun', 'above_horizon') %}
  yes
{% else %}
  no
{% endif %}

See here for more examples

1 Like