Airco Temperature Check failing

Hi All,
I hope you can help me with my issue. I have two split units (two outdoor and four indoor) AC units in my house. These are Fujitsu FGLair supported units and I have added them to HA using HACS integration. This works perfectly and I can manage the AC units (even better than the FGLair APP I might add!).

The issue is with the automation. I have created an automation that is active between 8h AM and 20h every day and checks if the temperature in the room is higher then 23C for more than 5 minutes. If so, then the AC will start cooling to a temperature of 22C. See the script of one of the four (they are all four identical):

id: '1745744935385'
alias: Werkkamer AC Automation Cool
description: ''
triggers:
  - trigger: numeric_state
    entity_id:
      - climate.werk_kamer
    attribute: current_temperature
    above: 23
    for:
      hours: 0
      minutes: 5
      seconds: 0
  - trigger: numeric_state
    entity_id:
      - sensor.zonneplan_current_electricity_tariff
    below: 0
conditions:
  - condition: time
    before: '20:00:00'
    after: '08:00:00'
actions:
  - device_id: 82116ab1be9079fdd62fb85c921e2b05
    domain: climate
    entity_id: f413e1792152466656ccc673963ea245
    type: set_hvac_mode
    metadata:
      secondary: false
    hvac_mode: cool
  - action: climate.set_temperature
    metadata: {}
    data:
      temperature: 22
    target:
      device_id: 82116ab1be9079fdd62fb85c921e2b05
mode: singletype or paste code here

Now, if the temperature is 23,5C or higher when the automation starts, the script doesn’t run. I have to set the AC myself using a dashboard I created for these AC units.

What can I do to make sure the automation works as expected?

I hope you can help as I have been at this for weeks now, and the only solution I can think of is setting multiple temperature values (>23, >24, >25, >26, etc.).

triggers:
  - trigger: homeassistant
    event: start
  - trigger: event
    event_type:
      - automation_reloaded
  - trigger: numeric_state
    entity_id:
      - climate.werk_kamer
    attribute: current_temperature
    above: 23
    for:
      hours: 0
      minutes: 5
      seconds: 0
  - trigger: numeric_state
    entity_id:
      - sensor.zonneplan_current_electricity_tariff
    below: 0
conditions:
  - condition: time
    before: '20:00:00'
    after: '08:00:00'
  - condition: numeric_state
    entity_id:
      - climate.werk_kamer
    attribute: current_temperature
    above: 23

Hi tom_I.
This seems to be working. Thanks a lot for your quick reply. I will monitor this and use these aditions also on other automations going forward.

Hmmz. After yesterday, it still seems to be failing. I now have the AC in the script above sitting at 25C, but the automation is not starting. It is after 8h AM (it is now 11:51h AM) and all requirements should now be correct to start the AC in a cooling mode.
What else am I missing, or do I need to add to the script to make it work?

Out of the 4 AC’s I have, three are at 24C or above (one at 25C) and none of them are starting.

Thanks tom_I. I did check the traces and I see for the example script above that it tried to start last night (at 0:35:57) and was stopped as it was outside of the time range.
Now, I would assume that every temperature change after that, the whole script would run and check the variables and actions. It clearly doesn’t do that. It is almost as if I need to force the scripts to be tested every hour or so to make it work.

Try this:

triggers:
  - trigger: state
    entity_id:
      - climate.werk_kamer
    attribute: current_temperature
    not_to:
      - unknown
      - unavailable
    for:
      hours: 0
      minutes: 5
      seconds: 0
  - trigger: numeric_state
    entity_id:
      - sensor.zonneplan_current_electricity_tariff
    below: 0
conditions:
  - condition: time
    before: '20:00:00'
    after: '08:00:00'
  - condition: numeric_state
    entity_id:
      - climate.werk_kamer
    attribute: current_temperature
    above: 23

It will trigger whenever the temperature has been stable for 5 minutes then check if it is above 23.

Thanks. I’ll test that for a day and see if it works as expected on my test AC. I’ll let you know how it goes :slight_smile:

Unfortunately, this didn’t work. The temperature went up to and above of 24C and the AC wasn’t started. On the previous script version, one of the AC’s did work, so that script is still the better one.
I have reverted to that script and will test some more to see if there is anything that can be improved.

Likely just removing this would fix it:

An update on this topic. It seems to all be working now. To be honest, I made as mistake where one AC automation was looking at a temperature sensor of another . . . stupid of me that I didn’t cross check the script before.
The scripts now are as in the second step in this thread.

So, a massive thanks to tom_I for assisting me with the changes in the script.

1 Like