Sensor with multiple values how?

Hello everyone,

I’m currently in the process of crafting a custom template sensor designed for my oven, and I’m seeking some guidance on how to achieve the desired functionality. Specifically, I’m aiming to create a sensor that displays “on” when the oven wattage exceeds 100, “off” when the wattage is at 0, and “ready” when the wattage falls between the range of 10 to 100. I’m quite new to this.

While I’ve managed to create binary sensors that toggle between “on” and “off” based on certain conditions, I’m facing some challenges when it comes to implementing multiple possible states like “ready.” I’m unsure about the approach I should take to achieve this level of versatility.

If any of you experienced members have encountered a similar situation or have insights into creating template sensors with multiple responses, I would appreciate your help. Your expertise could help me overcome this hurdle and enable me to create the perfect template sensor for my oven. :sweat_smile:

Thank you so much for taking the time to read this post

You want a regular sensor instead of Binary if you want different states. You can also set the attributes for even more information if you like. I have dozens of template sensors with all kinds of states, your imagination is nearly the only limit.

1 Like
  - sensor:
      - name: Sensor Name
        state: |-
          {% set value = states('sensor.YOUR_WATTS_SENSOR')|float(0) %}
          {% if  0 < value < 100 %} ready
          {% elif value >= 100 %} on
          {% else %} off {% endif %}
1 Like

Thank you so much for the answer @Didgeridrew it works!!

and @CO_4X4 indeed sensor everything lol