Template for washing machine and dryer with one outlet

Im struggling to build my washing machine and dryer template. I use both machines on one outlet and measure the power to enable the corresponding binary sensor. The dryer immedeatly goes to 2000W but my washing machine start with 200W pump first and goes to 1800W. This is my differentiator. In my test template I used different Watt numbers because I tested it with my lamps first.

The temples differentiats between dryer and washing machine but the binary sensor toggle all the time. How can I improve it?

Waschmaschine

  • platform: template
    sensors:
    washing_maschine:
    friendly_name: “Waschmaschine”
    value_template: >
    {% if ((states(‘binary_sensor.washing_maschine’) == ‘off’) and (states(‘sensor.00085709a3ebdd_power’) | float > 10.0) and (states(‘sensor.00085709a3ebdd_power’) | float < 50.0)) %}
    True
    {% elif (states(‘sensor.00085709a3ebdd_power’) | float < 5.0) %}
    False
    {% else %}
    “Pending”
    {% endif %}

Wäschetrockner

  • platform: template
    sensors:
    clothes_dryer:
    friendly_name: “Wäschetrockner”
    value_template: >
    {% if ((states(‘binary_sensor.clothes_dryer’) == ‘off’) and states(‘sensor.00085709a3ebdd_power’) | float > 60.0) %}
    True
    {% elif (states(‘sensor.00085709a3ebdd_power’) | float < 5.0) %}
    False
    {% else %}
    “Pending”
    {% endif %}