Issues with AC script running consistently

I have an LG lpi1419ivsm portable AC(WiFi) with LG Thinq HACS module loaded and updated and a Sonoff SNZB-02D thermometer in my closet to keep all the home electronics at a reasonable temperature. I have two automations setup - one for turning the AC on and another for turning the AC off. The script usually runs for 24-48 hrs without any issue but seems to randomly “hang” with the AC in the “fan only” mode. I have even added all the AC modes as conditional matches to see if that was to blame. Any help or suggestions are appreciated and feel free to ask any questions, as I am sure I forgot something vital in my summary

AC on Automation

alias: a Turn Server Room AC on
description: Turns the Server Room AC on when the Server Room temperature is 77 or above.
trigger:
  - platform: numeric_state
    entity_id:
      - sensor.server_room_temperature
    for:
      hours: 0
      minutes: 0
      seconds: 10
    above: 75
condition:
  - condition: or
    conditions:
      - condition: device
        device_id: 27485fa2d043d8d970846ad49d0b4e2c
        domain: climate
        entity_id: 054e501fce1d64a277a0cb186ebb7637
        type: is_hvac_mode
        hvac_mode: "off"
      - condition: device
        device_id: 27485fa2d043d8d970846ad49d0b4e2c
        domain: climate
        entity_id: 054e501fce1d64a277a0cb186ebb7637
        type: is_hvac_mode
        hvac_mode: dry
      - condition: device
        device_id: 27485fa2d043d8d970846ad49d0b4e2c
        domain: climate
        entity_id: 054e501fce1d64a277a0cb186ebb7637
        type: is_hvac_mode
        hvac_mode: cool
      - condition: device
        device_id: 27485fa2d043d8d970846ad49d0b4e2c
        domain: climate
        entity_id: 054e501fce1d64a277a0cb186ebb7637
        type: is_hvac_mode
        hvac_mode: fan_only
action:
  - device_id: 27485fa2d043d8d970846ad49d0b4e2c
    domain: climate
    entity_id: 054e501fce1d64a277a0cb186ebb7637
    type: set_hvac_mode
    hvac_mode: cool
  - service: climate.set_fan_mode
    metadata: {}
    data:
      fan_mode: low
    target:
      entity_id: climate.air_conditioner
    enabled: true
  - service: notify.frazior_home_gmail_com
    metadata: {}
    data:
      message: The Server Room AC is on
      target: [email protected]
      title: Server Room
    enabled: false
  - service: notify.mobile_app_roger_s_pixel_8_pro
    metadata: {}
    data:
      message: The Server Room AC is on
      title: Server Room
  - service: notify.html5_home
    metadata: {}
    data:
      message: The Server Room AC is on
    enabled: false
  - service: notify.persistent_notification
    metadata: {}
    data:
      message: The Server Room AC is on
    enabled: false
mode: single

AC Off Automation

alias: a Turn Server Room AC off
description: Turns the Server Room AC off when the Server Room temperature is below 75.
trigger:
  - platform: numeric_state
    entity_id:
      - sensor.server_room_temperature
    for:
      hours: 0
      minutes: 0
      seconds: 5
    below: 74
condition:
  - condition: device
    device_id: 27485fa2d043d8d970846ad49d0b4e2c
    domain: climate
    entity_id: 054e501fce1d64a277a0cb186ebb7637
    type: is_hvac_mode
    hvac_mode: cool
    enabled: false
action:
  - device_id: 27485fa2d043d8d970846ad49d0b4e2c
    domain: climate
    entity_id: 054e501fce1d64a277a0cb186ebb7637
    type: set_hvac_mode
    hvac_mode: fan_only
  - delay:
      hours: 0
      minutes: 5
      seconds: 0
      milliseconds: 0
    enabled: true
  - device_id: 27485fa2d043d8d970846ad49d0b4e2c
    domain: climate
    entity_id: 054e501fce1d64a277a0cb186ebb7637
    type: set_hvac_mode
    hvac_mode: "off"
  - service: notify.frazior_home_gmail_com
    metadata: {}
    data:
      message: The Server Room AC is off
      target: [email protected]
      title: Server Room
    enabled: false
  - service: notify.mobile_app_roger_s_pixel_8_pro
    metadata: {}
    data:
      message: The Server Room AC is off
      title: Server Room
  - service: notify.html5_home
    metadata: {}
    data:
      message: The Server Room AC is off
    enabled: false
  - service: notify.persistent_notification
    metadata: {}
    data:
      message: The Server Room AC is off
    enabled: false
mode: single

Why don’t you use a thermostat?

I may be misinformed but, I am not aware of any thermostats that work with portable AC units. If you have any suggestions, can you provide a link or model?

I think the suggestion was to use a virtual one instead of your own automation:

1 Like

Ahhh, I will try that. Thanks for the idea @BebeMischa and the clarification @Edwin_D !

1 Like

Looking at the automation though: you have many conditions, but only one trigger. When multiple conditions need to be true simultaneously, you need a trigger for each condition. That is because any condition changing could be the last one needed to satisfy all conditions.