#Simple automation to turn-on and set the air-conditioner

1 messages · Page 1 of 1 (latest)

peak lark
#

Hi,
I've build an ESPHome device with bme280 sensor, and I'm trying to create an automation to turn on and set an air conditioner in a room.
The temperature its below the 22°C and I don't understand why the automation trigger doesn't run. I tried to check the trace and its blank and the automation start its never. The automation its in enable state too.
What I did in wrong way? Why the trigger doesn't run?
I edited the automation by Visual-GUI.
Below the automation code:

description: ""
triggers:
  - trigger: numeric_state
    entity_id:
      - sensor.test_esp32_wroom_temperature
    below: 22
conditions: []
actions:
  - action: climate.turn_on
    metadata: {}
    data: {}
    target:
      entity_id: climate.air_sala
mode: single```
austere plank
#

Triggers run on an event. Aka, it does not run "when it's below 22 degrees". It will run "when it drops below 22”. Aka, when it was already below 22 when you made the automation it will not do anything. But it's not a problem, just wait and turn it on manually for now. Next time when the temperature drops it will just trigger when you want it to

peak lark
#

I understand.... I always forget that he works in transition! 🙁
So I need to evaluate another way to manage the automation.
My target its to turn on the air conditioner on temperature transition or when the temperature its already on the below.

austere plank
#

But how does it get below 22 if it will turn on when it gets below? If the answer is "I only want it to happen when X" then the change of X simply is also a trigger for this automation.

peak lark
#

The goal is to heat a room when the temperature is heated during the day.
So outside that time slot, the temperature could drop, and putting me outside the transition state.
I partially solved in this way by change the code yaml with the below part.

  - entity_id: sensor.test_esp32_wroom_temperature
    trigger: state
  - event: start
    trigger: homeassistant
  - event_type: automation_reloaded
    trigger: event
conditions:
  - condition: numeric_state
    entity_id: sensor.test_esp32_wroom_temperature
    below: 21```
austere plank
#

Please don't 😐

#

Like I said, you are limiting it with a time slot, that's fine. But that simply means that the start of the time slot is also a trigger.

Triggers:

  • temp drops below 22
  • time slot start
    Conditions:
  • temp below 22
  • it's in the time slot
peak lark
austere plank
#

Yeah, but doing

triggers:
  - entity_id: sensor.test_esp32_wroom_temperature
    trigger: state
conditions:
  - condition: numeric_state
    entity_id: sensor.test_esp32_wroom_temperature
    below: 21

just isn't a very smart way of doing automations.

peak lark
# austere plank Yeah, but doing ```yaml triggers: - entity_id: sensor.test_esp32_wroom_temper...

I was rereading the post.
I know the temperature sensor trigger logic doesn't seem to make much sense right now, but I'm experimenting with automation. The initial trigger should be another type of sensor, which unfortunately I don't have yet.
The missing sensor its necessary to know if door and window in a room are open.
I have an elderly person who has the habit of running the air conditioning with the windows open. A waste of energy, and I pay the bills!