Generic_thermostat for Humidity

This was the solution:

value_template: “{{((states.input_number.schieber_steckdose1.state | float) + 2.5) <= states(‘sensor.steckdose1_am2301_humidity’) | float }}”

Now I only need to combine these two automations into one - is this possible?

  • id: steckdose1_luftfeuchtigkeit_on
    alias: “Steckdose 1 Luftfeuchtigkeit on“
    initial_state: true

    trigger:
    platform: template
    value_template: “{{((states.input_number.schieber_steckdose1.state | float) + 2.5) <= states(‘sensor.steckdose1_am2301_humidity’) | float }}”

    action:
    service: switch.turn_on
    entity_id: switch.steckdose1

  • id: steckdose1_luftfeuchtigkeit_off
    alias: “Steckdose 1 Luftfeuchtigkeit off“
    initial_state: true

    trigger:
    platform: template
    value_template: “{{((states.input_number.schieber_steckdose1.state | float) + 2.5) >= states(‘sensor.steckdose1_am2301_humidity’) | float }}”

    action:
    service: switch.turn_off
    entity_id: switch.steckdose1