#Turning off airco, several triggers in 1 automation?

1 messages · Page 1 of 1 (latest)

frosty hatch
#

Hi everyone. I’m back. Hopefully it’s oké I post another question.
I have a automation that turns on the airco if the energy surplus is above 500 watt AND the temperature is above 23.0 degrees. This works fine.
Now I want to accomplish that the airco goes off:

  1. IF the energy surplus goes below 500 and the airco is ON.
  2. IF the temperature drops below 22 degrees and the airco is ON.
  3. IF the time is 16.57 (no matter what)

Is it possible to make this in one automation? Or must i accomplish this directly in yaml? Im using the gui now.

alias: AircoUIT21gradenOfKouder10-17uEnOverschot100
description: ""
triggers:
  - type: temperature
    device_id: efee112d20f4da0c45bee0f478b2ee15
    entity_id: 2c1ae628891edf86ff3374e6bfd4cf22
    domain: sensor
    trigger: device
    below: 22
  - trigger: numeric_state
    entity_id:
      - sensor.overschot_nummeriek
    below: 500
  - trigger: time
    at: "16:57:00"
conditions:
  - condition: device
    device_id: 8ba411c570759885313019ae3f825513
    domain: climate
    entity_id: bddc47c8ce64d782aef2da848516b60e
    type: is_hvac_mode
    hvac_mode: cool
  - condition: time
    after: "10:00:00"
    before: "16:57:00"
actions:
  - device_id: 8ba411c570759885313019ae3f825513
    domain: climate
    entity_id: bddc47c8ce64d782aef2da848516b60e
    type: set_hvac_mode
    hvac_mode: "off"
mode: single
sonic ibex
#

Yes, can be done in single automation. Could even be combined with the turning on if you want. All from the UI 🙂

The "and the airco is ON." is not needed, as the thing will not explode if you try to turn it off when it's off. So no condition is actually needed

Of do you only want to turn it off if it's in a specific mode?

frosty hatch
#

This is how i have it gui now, but this isn’t the way is it? Because all When’s have to be true?

frosty hatch
#

@sonic ibex how can I start over a When again, in the same flow?
I need something like When temp is 23 or lower Then action Turn off Airco.

When energy surplus is below 500
Then action turn off airco.

I can’t figure out how to do this in 1 automation (from the gui)?

sonic ibex
# frosty hatch This is how i have it gui now, but this isn’t the way is it? Because all When’s ...

No! Every "When" (actually a trigger) will kick off the automation. As triggers have no duration it is basically impossible for two things to happen at exactly the same time to the millisecond.

Still think it's ridiculous the UI only shows when, and if and then do.. They are called triggers, conditions and actions.

And sharing the yaml is wayyyyyy easier. As that contains everything. And like I said, no need to check for on. Just like with a regular bulb and switch, it will not explode when you try to turn it off when it's already off.

So just make an automation with the three triggers you want (minus the "is on") and the action to turn it off.

frosty hatch
sonic ibex
#

Just remove all the conditions and you should be good. You only need the triggers and the action.

frosty hatch
#

@sonic ibex Will the following yaml turn off the airco when the degrees are below 22, AND energy surplus is below 300 AND the time is 16:57?

description: ""
triggers:
  - type: temperature
    device_id: efee112d20f4da0c45bee0f478b2ee15
    entity_id: 2c1ae628891edf86ff3374e6bfd4cf22
    domain: sensor
    trigger: device
    below: 22
  - trigger: numeric_state
    entity_id:
      - sensor.overschot_nummeriek
    below: 300
  - trigger: time
    at: "16:57:00"
conditions: []
actions:
  - device_id: 8ba411c570759885313019ae3f825513
    domain: climate
    entity_id: bddc47c8ce64d782aef2da848516b60e
    type: set_hvac_mode
    hvac_mode: "off"
mode: single
sonic ibex
#

No, but now I'm going to be a bit picky on language. We tend to use the word 'and' incorrect in this case (also the Dutch 'en'). So I guess you meant 'or' here. Then, yes.

  • So if the temperature goes below 22, if will turn it off
  • If 'overschot' goes below 300, it will turn it off
  • If it is 16:57, it will turn it off

But the triggers have no link to the state of the other trigers, hence why I say you should be talking about 'or' 🙂 Thus even if 'overschot' is 1500, if the temperature goes below 22, it will turn it off.

frosty hatch
#

Feedback accepted. I indeed mean OR.
I am no programmer, so don’t know all correct Python syntaxes.

frosty hatch
#

Still breaking my head on the When and Conditions part. Now my Airco doesnt go on lol. Sent you a dm if thats oke @sonic ibex