Automating LG Portable A/C Unit

I have one of these - LG A/C Portable Air Conditioner and one of the broadlink ir blasters which will control it just fine.

One note - the IR remote control power button turns on AND off the A/C unit - there are not separate buttonson the remote. So the code I send with the IR blaster is the same each time - just sending it once will turn the A/C on or off depending on which state the A/C unit is in currently.

I’m using this unit to keep a small playroom cool on a second floor of our home. Right now it has been running 24/7 because I can’t figure out to automate it reliably. The thermostat on it works perfectly fine - but it runs a fan etc 24/7 even when not cooling the room, which is not only a waste of electricity, but noisy as well.

Here’s the automation I had setup -

- alias: "Turn On A/C In Playoom"
  trigger:
     - platform: state
       entity_id: sensor.playroom_temperature
  condition:
    condition: template
    value_template: '{{ (states("sensor.playroom_temperature") | float) >= 75 | float }}'
  action:
  <send IR code>

- alias: "Turn Off A/C In Playoom"
  trigger:
     - platform: state
       entity_id: sensor.playroom_temperature
  condition:
    condition: template
    value_template: '{{ (states("sensor.playroom_temperature") | float) <= 74 | float }}'
  action:
<send IR code>

I can send the IR code fine - but the code acts like it loops - as in seemed like it would check every so many seconds - realize the temp was too high and send the code to turn on, which in turn would shut off the A/C because of the nature of the power button I explained above. So it was like a constant off/on cycle. The sensor I’m using for temp is an extra Ecobee remote unit I have for my Ecobee 3.

Any ideas/thoughts?

Bumping to see if anyone has any ideas. Thanks!

As an FYI - I ended up handling this in Node Red - works very well!

Hey, Im about to buy a DeLonghi portable AC. Mind showing how you did it in Node Red? :slight_smile:

I’ll try!!

1- Once an hour kick off the flow
2. Get the current temp from an Ecobee Sensor and Get the current power draw on the a/c unity (using a Sonoff POW) - so I can tell temp in the room AND find out if the a/c is already running or not.
3. Join that data into 1 object for the databus
4. Set some global flow variables (flow.roomtemp which is the ecobee temp) and flow.watts (power from the sonoff) for use later
5. Is the room above or below 75 degrees?
6a. If above 75 - check if a/c unit is already running - if not - turn on and loop for 1 min until we see the power draw is above 50 watts - so then we know it is running
6b. If below 75 - check if a/c unit is already running - if it is - turn off and loop for 1 min until we see the power draw is 50 or below - so then we know it is NOT running
7. Set data for pushover message and then send pushover to let me know if a/c was turned off or on

See the attached screenshot for more details as to the layout. If you have more questions - let me know - I’ll do my best to answer. I don’t have this setup any longer because we moved. but it was dead solid while I was using it. The Sonoff POW was the key for me to tell if the unit was running or not - because the ir code sent was the same code to turn the a/c unit off and on - so sometimes it would not register or skip the off or on and get out of sync, the Sonoff 100% could tell me if the unit was running or not.

Mind sharing the flow so I can take a look at the logic?