Adding some smarts to a dumb aircon

It's still pretty dumb, though

I have a Friedrich aircon. It’s of the old school. The only intelligent part of it is “eco” mode (turn off the fan when the temperature is cold enough) and a simple timer (“turn on in 9 hours time”).

It’s this timer that annoys me; you have to set it every day. A number of days I would go to work, forgetting to set it, and come home to a house in the mid-90F.

So I wondered if there was a way I could remotely control it. Now I’ve previously played with an Arduino and the IR library and successfully managed to have it send the POWER signal to the aircon. Unfortunately this is a toggle; if the aircon is already on then the signal turns it off. For remote access I needed to know the current state of the aircon.

I considered a smart plug to measure the power draw, but this won’t work due to the “eco” mode.

The front panel looks like this:

Friedrich panel

I thought that if I could detect if any of those LEDs were on then I could use this as a proxy for if the aircon was “on” or not.

The hardware

Via a reddit chat, I came across a post around reading a smart-meter LED. This lead me down the path of a photo-resister. You put these across an ADC port and a voltage supply and the resistance of the component changes depending on how much light is on them. And they’re small; about the same size as the LED! That would fit nicely in that area.

So I tried out a simple design, using a photo-resister, a pull-down resister and a spare LED blaster I had from previous tests and hooked them to a NodeMCU ESP8266.

Test board

And it worked; if I covered the photo-resister then the value read from A0 dropped to zero; if I shone a light on it then the value shot up.

So now I needed to fit it all into the control panel space. I decided to use some doorbell wire left over from the garage project. Only the IR transmitter and the resister needed to be inside the panel:

Cable End

I cut a hole in the side of the door to route the cable through. I’m not so happy with this; when I open the door it drags on the cable and moves the photo-resister. I may need to make the hole bigger.

Drilled Door

Nicely there was a small gap along the top of the control panel which the doorbell wire fit into!

Panel with components

On the ESP side I connected the wire to some cables that let me put it on the legs. I didn’t want to solder the cable to the board because I wanted to be able to disconnect it for reprogramming. I did solder the pull-down resister to the board, for simplicity:

Final board

The software

So now I have a network accessible board capable of reading the on/off state (OK, the state of the “Eco” LED!) and send IR signals to turn on/off the aircon. The rest is just a simple matter of programming.

Essentially I make the ESP send the current state of the sensor on an MQTT queue once a second. On another queue it can receive commands (“POWER ON”, “POWER OFF”, “POWER”) and depending on the state of the sensor it can decide whether to send an IR signal or not. I had to use a rolling average of the sensor readings because point readings weren’t too accurate. But it works!

Alexa integration

It’s now pretty easy to add a fake Hue bulb. A loop can read the status channel

#!/bin/ksh -p

# Dining Room Aircon

STATUS=${1:-/tmp/aircon}

temp=0
/home/sweh/bin/mqttcli sub --host hass -t aircon/EA42DF/status | while read line
do
  kill -0 $PPID 2>/dev/null || exit

  print $line > $STATUS
done

So now the main program just has two simple functions:

get_aircon()
{
  SWITCH["DiningRoomAirCon"]=$(cat $AIRCON_STATUS)
}

set_aircon()
{
  /home/sweh/bin/mqttcli pub --host hass.spuddy.org -t aircon/EA42DF/control -m "POWER$1"
}

At this point I can now say “Alexa, turn the dining room aircon on”… and it works!

And the first thing I did at that point was to add a “power off” to my bedtime routine, because I’ve lost count of the number of times I’ve gone to bed forgetting to turn the aircon off and been woken up as the compressor kicks in (I’m a light sleeper).

Home Assistant Automation

HA integration is also simple; just point to the message queues:

switch:
  - platform: mqtt
    name: "Air Con"
    state_topic: "aircon/EA42DF/status"
    command_topic: "aircon/EA42DF/control"
    state_on: "ON"
    state_off: "OFF"
    payload_on: "POWER ON"
    payload_off: "POWER OFF"
HA status

Plans and limitations

There’s still a limitation with this; I don’t know what the temperature is set to. But since I rarely change this (68F setting appears to make the living room around 78-80F, which is comfortable) I’m not too worried.

More interesting is the ability to now control this via home assistant. I already have a reading from my smart thermostat, so I know how warm the living room is. It’s possible I could set up an automation for something like “if the living room is over 85F then turn on air-con”. I’d probably time-bound this so it only does it between 2pm and 9pm. Also need to work out how to not send the “ON” signal every 30 seconds :-).

All possible and feasible.

The result may not be a smart aircon, but it’s not as brain-dead as it was before!