#Adding a delay and Airco in Automation

1 messages · Page 1 of 1 (latest)

void remnant
#

Hi, i have created a automation that turns on a plug when the energy surplus is over 1000. I now want to combine it with the Airco, if its on or not. This i my code for now:

description: ""
triggers:
  - trigger: numeric_state
    entity_id:
      - sensor.overschot_nummeriek
    above: 1000
conditions:
  - condition: time
    weekday:
      - sun
      - mon
      - tue
      - thu
      - fri
      - sat
  - condition: device
    device_id: 8ba411c570759885313019ae3f825513
    domain: climate
    entity_id: bddc47c8ce64d782aef2da848516b60e
    type: is_hvac_mode
    hvac_mode: cool
actions:
  - delay:
      hours: 0
      minutes: 3
      seconds: 0
      milliseconds: 0
  - choose:
      - conditions:
          - condition: not
            conditions:
              - condition: numeric_state
                entity_id: sensor.overschot_nummeriek
                above: 1000
        sequence:
          - type: turn_off
            device_id: 0c0d9e8e20189a1b6ae386197de9ba47
            entity_id: 5bac4f32b80ef6604e517e10b4a19554
            domain: light
  - type: turn_on
    device_id: 0c0d9e8e20189a1b6ae386197de9ba47
    entity_id: 5bac4f32b80ef6604e517e10b4a19554
    domain: light
mode: single

If the airco is on, and the energy surplus is 1000+, then i want to add an extra delay of 3 mins, so that the airco is not in start up mode and 'draining' all the surplus, so the pump goes on-off-on-off etc.

After the delay i want to re-check the trigger, is the energy over 1000 yes or no. If yes, then turn plug on. If no, turn off (or do nothing).

The does not meet condition is correct; if the energy surplus is not over 1000 then turn off is correct. Will this work, when the plug is off already?

dim pilot
#

Why not just change your numeric state trigger to add for "00:03:00" rather than a delay and a re-check? That would make it so that your automation don’t trigger unless the surplus has been over 1000 continuously for 3 minutes

#

The other issue is that your automation ends with turning the light on, no matter what. Sometimes it may turn it off first (if the surplus is not > 1000) but it will always end with turning it back on

#

I’m not clear on what your intent is, so it’s difficult to suggest improvements. When do you want the light to turn off?

void remnant
#

I have three machines i would like to trigger, when i have energy surplus. First one is the Washingmachine, this is priority 1. So no condition, except the energy surplus to turn it on.
Second (priority) is the airco.
Third (prority) is the heatpump of the swimmingpool.

The use case it that i dont turn on all the devices at once, because that will trigger my surplus to be gone, or drop bewlow the 0.

#

the 1000+ for three minits in a row should work, but how?

dim pilot
#

Does your automation need to turn off any of those 3 devices? If so, what logic did you want to use for that?

void remnant
#

i have separate Off automation for the Airco and heatpump of the swimming pool. The washingmachine can stay on.

dim pilot
#

does it even make sense to check if your airco is cooling? If the surplus has been > 1000 for 3 straight minutes, wouldn't you want to turn on your pump even if the airco is off for some reason?

void remnant
#

I do, I only want to prevent all machines turning on at the same time. I haven’t calculated the power usages yet, because no smart plugs that can do this. Any recommendations?

#

By adding the delay on the start airco and start heatingpump, I prevent this? Do i not?

dim pilot
#

I'd just recommend a single automation for all 3 devices, something like this:

description: ""
mode: single
triggers:
  - trigger: numeric_state
    entity_id: sensor.overschot_nummeriek
    above: 1000
    id: washingmachine
  - trigger: numeric_state
    entity_id: sensor.overschot_nummeriek
    for:
      minutes: 1
    above: 1000
    id: airco
  - trigger: numeric_state
    entity_id: sensor.overschot_nummeriek
    for:
      minutes: 3
    above: 1000
    id: pump
conditions: []
actions:
  - choose:
      - conditions:
          - condition: trigger
            id: washingmachine
        sequence:
          - action: switch.turn_on
            target:
              entity_id: switch.washingmachine
      - conditions:
          - condition: trigger
            id: airco
        sequence:
          - action: climate.set_hvac_mode
            target:
              entity_id: climate.living_room_thermostat
            data:
              hvac_mode: cool
      - conditions:
          - condition: trigger
            id: pump
        sequence:
          - action: switch.turn_on
            target:
              entity_id: switch.pump
void remnant
#

Thanks, I’ll look into it tonight 🙂

dim pilot
#
  • washingmachine triggers immediately after >1000
  • airco triggers after 1 minute of >1000 (which will be affected by washingmachine, so probably more than just 1 minute after washing machine turns on
  • pump triggers after 3 minutes of >1000 (which will be affected by both washingmachine and airco, so probably much longer than 3 minutes after washingmachine turned on