I'm working on a home automation project to control the Air Conditioner (ON/OFF only) using arduino automatically. When the temperature is greater than X, switch on AC; when temperature is Lower than Y, switch OFF AC. My challenge is following:
The AC sends the same code to switch ON and OFF. If the AC is ON, then it will switch OFF teh AC and vice versa. How do i track the AC states
When the board is first initialized, how to determine the current state of the AC since the only interface is the IR emitter.
-The AC could already be ON but within the range of the temperature to be cooled (say between X and Y) but not below Y. In this case the AC should be left ON till Y. If the AC is OFF in this case, it should be switched ON and run till Temperature is Y.
The AC could be OFF but temperature is higher than X, i this case the AC should be switched ON and run till Y, then OFF.
-The AC could be OFF, but temperature is below Y, in this case it should be left ON.
I seriously doubt that you can ask the AC what state it is in. You could disable/hide/dispose of the current remote control, and have the Arduino be the only thing controlling the AC. Then, the Arduino would know what state the AC was in.
When the board is first initialized, how to determine the current state of the AC since the only interface is the IR emitter.
Again, I seriously doubt that you can. At least, not by asking the AC. You need a current sensor, or something that can see the state of a light on the AC (assuming that there is one), to infer whether the AC is running or not.
If the AC is on, but not currently running, and the Arduino was not responsible for turning it on, it will not be able to know that.
Can I ask you why you need to use an Arduino to over-ride the settings of your air conditioner?
Surely it already cools when it is too hot and doesn't cool if the temperature is acceptable. Is that the case?
I am only asking this question because I live in a territory where domestic air conditioning is not the normal situation. For me this is just a thought experiment.
(For me the current outdoor ambient temperature is 0°C).
I have couple of ACs in different rooms (5 in total); a mix of split and window ACs. The overall goal of the project is to centrally control all of them without having to go physically to each room (some rooms are outside the main house). The mains power is out question since the AC requires to be switched ON or OFF with a remote once it's supplied with power. Again, I do not want to just set them to a particular temperature and leave them ON; this way I may be able to save on some electricity costs accrued when the AC is evn operating at the bare minimum; when the temperature is just right. I could even take this a step further and introduce a web component where I can view all the rooms conditions from a central location even away from home.