Good afternoon. I have a weight sensor that is giving me a value in kg. I wanted to create a sensor that would return words depending on each weight. example: when the weight is less than 1Kg, in this sensor it appears “empty”, when it is between 1Kg and 3kg, it appears “half” is more than 3kg “full”
Use a template sensor:
template:
- sensor:
- name: "Weight In Words"
state: >
{% set weight = states('sensor.your_sensor_here')|float(0) %}
{% if weight > 3 %}
Full
{% elif 1 <= weight <= 3 %}
Half
{% elif weight < 1 %}
Empty
{% endif %}
1 Like