Need help with template switch with different set and reset

Hi, I’m trying to make a template switch with a different set and reset. Does anyone have any idea how this can be done? For the automation of the covers I now use one of these conditions, but I actually want to build in a hysteresis. For example> 1000KW set and <500KW reset.

#UV-sensor
   - platform: template
     sensors:
       uv_sensor:
         friendly_name: "UV-sensor"
         delay_off:
           minutes: 10
         device_class: light
         value_template: >-
          {{ states('sensor.solaredge_energy_current_template')|float >800 }}

This could be useful to you:

I didn’t knew there is a function treshold, exactly what I needed. :blush:
Thanks tom_I

1 Like

I find the explanation of the treshold function very unclear. Had an upper of 1000 and hysteresis of 500 with the idea that the sensor is above 1000 active and below 500 inactive. Apparently this works differently, the hysteresis is fully added on top of the upper setpoint. Now have upper 750 and hysteresis 250 after which the sensor above 1000 is active. Just don’t know yet if the sensor switch off below 750 or 750-250 (hysteresis). In that case the hysteresis would be 500 and not 250.

Should be 750 - 250.

I agree, it is not a good definition of hysteresis.

Any idea how I can use an upper value that depends on the time of day. For example, upper: 750 before 4:00 PM and 600 after 4:00 PM?