Water boiler automation using helper

I put the time to trun on and time to turn off, and then I waited.
But nothing happened…not too sure why

Was the temperature above 52 when you turned on the automation, did the temperature drop below 52 during your test?

it was below 52 which should be one of the condition to turn on the geyser switch.

Triggers do not trigger if they are below as explained in the docs.

Numeric state trigger
Fires when the numeric value of an entity’s state (or attribute’s value if using the attribute property, or the calculated value if using the value_template property) crosses (and only when crossing) a given threshold.

This means in order to get the automation going you need to manually start the heating this first time.
From then on it should work as expected

After long trying and testing, I came to the following solution.
These two automation work as intended :slight_smile:

- id: "00050"
  alias: Geyser ON Automation
  description: Geyser ON Automation
  mode: single
  trigger:
    - platform: time_pattern
      minutes: /05
  condition:
    - condition: and
      conditions:
        - condition: numeric_state
          entity_id: sensor.geyser_ds18b20_temperature
          below: "52"
        - condition: state
          entity_id: switch.geyser_switch
          state: "off"
        - condition: or
          conditions:
            - condition: time
              after: 'input_datetime.geyser_on_time_mon_fri'
              before: 'input_datetime.geyser_off_time_mon_fri'
              weekday:
                - mon
                - tue
                - wed
                - thu
                - fri
            - condition: time
              after: 'input_datetime.geyser_on_time_mon_fri'
              before: 'input_datetime.geyser_off_time_sat_sun'
              weekday:
                - sat
                - sun
  action:
    - service: switch.turn_on
      entity_id: switch.geyser_switch

###############################################

- id: "00051"
  alias: Geyser OFF Automation
  description: Geyser OFF Automation
  mode: single
  trigger:
    - platform: time_pattern
      minutes: /05
  condition:
    - condition: and
      conditions:
        - condition: state
          entity_id: switch.geyser_switch
          state: "on"
        - condition: or
          conditions:
             - condition: time
               after: 'input_datetime.geyser_off_time_mon_fri'
               before: "input_datetime.geyser_on_time_mon_fri"
               weekday:
                 - mon
                 - tue
                 - wed
                 - thu
                 - fri
             - condition: time
               after: "input_datetime.geyser_off_time_sat_sun"
               before: "input_datetime.geyser_on_time_sat_sun"
               weekday:
                 - sat
                 - sun
  action:
    - service: switch.turn_off
      entity_id: switch.geyser_switch

Not to forget to mentioned that I am still opened to further ideas and testing if anyone has more elegant solution :blush:

@browetd and @Hellis81, thank you both, I really appreciate all the help and diverse views :pray: :smiley:

1 Like

Did you try and turn it on to keep it within range?

yes, that I know how to do…primary goal is time management of water being heated vs power consumption hence the need for times.

I don’t think you understand.
You just needed to get the automation going by keeping it within time and temperature one time.
That is all. From then on it will function within time and temperature for ever.
But because this is REAL automation it uses the states and if the states are out of bounds when you start the automation then it will not trigger.

But on the contrary, a real automation will not use resources when not needed, it will not let the temperature go below the threshold and not above either.
Depending on the resolution of your temperature probe, it will allow 51.9 - 70.1.

A time pattern automation will allow it to go below and above, and outside of times.

I can’t understand how your solution possibly can work since it will turn off the heating every five minutes when it is on and within time.
If five minutes is all that is required to get the temperature from 52 -70 then it’s reasonable, but if it takes longer that automation can’t possibly work.