Water pump with interval slider?

well, what about the ‘/1’ change. I think that is the most important attempt. Doc’s clearly point to haveing that in quotes:

minutes: '/1'

Sorry, I was unclear.
I used quotes with both above.

minutes: '/1'

Looking to future already: (FIXED!)

{% if states.sensor.ebb_temperature.state | float > 30 %}
  {% set time = now().hour*24*60+now().minute | int %}
  {% set interval = states.input_number.slider1.state | round | int %}
  {% set interval = interval - 15 %}
    {% if time % interval == 0 %}
      switch.turn_on
    {% endif %}
{% elif states.sensor.ebb_temperature.state | float < 15 %}
  {% set time = now().hour*24*60+now().minute | int %}
  {% set interval = states.input_number.slider1.state | round | int %}
  {% set interval = interval + 30 %}
    {% if time % interval == 0 %}
      switch.turn_on
    {% endif %}
{% elif states.sensor.ebb_temperature.state | float >= 15 %}
  {% set time = now().hour*24*60+now().minute | int %}
  {% set interval = states.input_number.slider1.state | round | int %}
    {% if time % interval == 0 %}
      switch.turn_on
    {% endif %}
{% endif %}

Is this a right way to play with interval in different temperature ranges? I’m not familiar to syntax so learning in a progress.

I changed " minutes: ‘/1’ " => " seconds: ‘/60’ " and now it seems to work!

- id: waterpump
  alias: EBB Waterpump controller
  trigger:
    platform: time
    seconds: '/60'
  condition:
    condition: template
    #value_template:  '{{ (now().hour*24*60+now().minute) % states.input_number.slider1.state | round | int == 0 }}'
    value_template: >
      {% set t = now().hour*24*60+now().minute | int %}
      {% set m = states.input_number.slider1.state | round | int %}
      {{ t%m == 0 }}
  action:
    - service: switch.turn_on
      data:
        entity_id: switch.ebb_pump
    - delay: '00:00:59'
    - service: switch.turn_off
      data:
        entity_id: switch.ebb_pump
1 Like

Seems like you may have found a bug with minutes: '/1'. That should have worked. Glad seconds is working for you.

This seems alittle off. Only because your last elif statement will never be reached. Else if makes it so that if it goes into a path, it wont reach another path. If your number is greater than or equal to 15, it will never reach greater than 35 because every number greater than 35 is greater than 15. If you truly want to have exactly what you wrote, your first if statement should be >35, then less than 15, then greater than or equal to 15. That way, everything between 15 and 35 will go to the greater than 15 route. Everything above 35 will go to the 35 route. Everything less that 15 will go to the less than 15 route.

@petro Thank you, seems I got syntax right? It was just something I threw together last night before going to sleep.

Ya, it looks right. Might be easier to read if you indent your if statements though.

I fixed template above and made some indents.
Thank You @petro!

Next step would be adding moisture effect.
Is this best/right way to implement it or is there another, more flexible way?

{% if states.sensor.ebb_temperature.state | float > 30 and states.sensor.ebb_humidity.state | float < 75 %}

Thats probably the best way. The other option is to create a template sensor that displays different states and trigger off those different states. But if you are trying to minimize the number of ‘listeners’ in home assistant, just use if statements in your current automations.