I have 3 x Carrier Air Conditioners in my house. The attached project and library files control all 3 my aircons. Some work to be done as the signal sent from the remote to the aircon includes the last setting of for eg the fan speed, is it swinging or not, the mode, etc, etc.
I have wrapped this Github project to pass the required codes from my S4 mini (KitKat with an IR blaster) to the aircons as cycle times of the IR signal.
Have done nothing fancy to this project - just wanted to see if I can control the air cons. Attached the following:
1. B4A sample project
2. The Java code - the cycle times are hard coded in the wrapper
3. The B4A library files - copy them to your additional library folder
4. Other library files that you will require - copy them to your additional library folder
Take note of the B4A manifest file.
It is working by replacing my Carrier Remote Type RG14A2/EF with the app on the S4 mini.
Change the Wrapper to your liking to suite your air conditioner - find the right cycle time codes and then replace it within the wrapper and recompile the library (compiling it can be very easily done with Simple Library Compiler)
I have downloaded this app to get some of the cycle time codes that I needed to control my air cons.
Sample Code:
Library as it is at present:
ACcontrol
Version: 1
I have wrapped this Github project to pass the required codes from my S4 mini (KitKat with an IR blaster) to the aircons as cycle times of the IR signal.
Have done nothing fancy to this project - just wanted to see if I can control the air cons. Attached the following:
1. B4A sample project
2. The Java code - the cycle times are hard coded in the wrapper
3. The B4A library files - copy them to your additional library folder
4. Other library files that you will require - copy them to your additional library folder
Take note of the B4A manifest file.
It is working by replacing my Carrier Remote Type RG14A2/EF with the app on the S4 mini.
Change the Wrapper to your liking to suite your air conditioner - find the right cycle time codes and then replace it within the wrapper and recompile the library (compiling it can be very easily done with Simple Library Compiler)
I have downloaded this app to get some of the cycle time codes that I needed to control my air cons.
Sample Code:
B4X:
#Region Project Attributes
#ApplicationLabel: b4aACcontrol
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: portrait
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim carrier As ACcontrol
Private Button1 As Button
Dim ac As Int = 0
Private Button2 As Button
Private Button3 As Button
Private Button4 As Button
Private Button5 As Button
Private Button6 As Button
Private Button7 As Button
Private Button8 As Button
Private Button9 As Button
Private Button10 As Button
Private Button11 As Button
Private Button12 As Button
Private Button13 As Button
Private Button14 As Button
Private Button15 As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("main")
carrier.Initialize("")
End Sub
Sub Activity_Resume
carrier.StartInfraRed
End Sub
Sub Activity_Pause (UserClosed As Boolean)
carrier.StopInfraRed
End Sub
Sub Button1_Click
If ac = 0 Then
Button1.Text = "Aircon On"
carrier.PowerOn
ac = 1
Else
Button1.Text = "Aircon Off"
carrier.PowerOff
ac = 0
End If
End Sub
Sub Button2_Click
carrier.Temp1
End Sub
Sub Button3_Click
carrier.Temp2
End Sub
Sub Button4_Click
carrier.Temp3
End Sub
Sub Button5_Click
carrier.FanSpeedHigh
End Sub
Sub Button6_Click
carrier.FanSpeedMedium
End Sub
Sub Button7_Click
carrier.FanSpeedLow
End Sub
Sub Button8_Click
carrier.FanSpeedAuto
End Sub
Sub Button9_Click
carrier.CoolMode
End Sub
Sub Button10_Click
carrier.DryMode
End Sub
Sub Button11_Click
carrier.HeatMode
End Sub
Sub Button12_Click
carrier.AutoMode
End Sub
Sub Button13_Click
carrier.FanMode
End Sub
Sub Button14_Click
carrier.Swing1
End Sub
Sub Button15_Click
carrier.Swing2
End Sub
Library as it is at present:
ACcontrol
Version: 1
- ACcontrol
Methods:- AutoMode
- CoolMode
- DryMode
- FanMode
- FanSpeedAuto
- FanSpeedHigh
- FanSpeedLow
- FanSpeedMedium
- HeatMode
- Initialize (paramString As String)
- PowerOff
- PowerOn
- StartInfraRed
- StopInfraRed
- Swing1
- Swing2
- Temp1
- Temp2
- Temp3
- android.permission.TRANSMIT_IR
Attachments
Last edited: