IR Eachen Blaster Sending IR commands via MQTT

Hvac aircons are different to just sending ir code on off. You need to send all settings each time you change something.

Can you list all of the options you have on your remote. Eg some aircons have fan speed. Low med high. Some have strong quite eco aswell. Then I can help more.

Edit:

Here is an example. This is only for outgoing ir commands so using remote will not update openHAB.

Items For Google home intergration.

Group               Airconditioner             "Aircon"                                            {ga="Thermostat" [modes="off=OFF, heat=HEAT,cool=COOL,on=ON,heatcool=auto"]}
String              AirconditionerMode         "mode"                            (Airconditioner)  {ga="thermostatMode"}
Number:Temperature  AirconditionerTemperature  "Current Ambient [%.1f °C]"       (Airconditioner)  {ga="thermostatTemperatureAmbient"}
Number:Temperature  AirconditionerSetTemp      "Setpoint temperature [%.1f °C]"  (Airconditioner)  {ga="thermostatTemperatureSetpoint"}

Switch              AirconditionerPower
String              AirconditionerSetMode


Part of Sitemap

      Text label="Aircon" icon="heating"{

        Switch item=AirconditionerPower label="AC Power" mappings=[ON="On", OFF="Off"]
        Setpoint item=AirconditionerTemperature label="AC Temp" minValue=17 maxValue=30 step=1
        Switch item=AirconditionerSetMode label="AC Mode" mappings=[cool="COOL", dry="DRY", fan="FAN", heat="HEAT"]
      }

RULES

rule "Send Command to Aircon through IRBLASTER"
when

    Item AirconditionerPower received command or
    Item AirconditionerSetTemp received command or
    Item AirconditionerSetMode received command
then
        val mqttActions = getActions("mqtt","mqtt:broker:myMQTTBroker")
        var int setTemp = (AirconditionerSetTemp.state as Number).intValue
        var jsonString = '{"Vendor":"GREE","Model":1,' + 
                         '"Power":"'+ AirconditionerPower.state.toString +'",' +
                         '"Mode":"'+ AirconditionerSetMode.state.toString +'",' +
                         '"Celsius":"On",' +
                         '"Temp":'+ setTemp +',' +
                         '"FanSpeed":"Auto",' +
                         '"SwingV":"Auto",' +
                         '"SwingH":"Off",' +
                         '"Quiet":"Off",' +
                         '"Turbo":"Off",' +
                         '"Econo":"Off",' +
                         '"Light":"On",' +
                         '"Clean":"Off",' +
                         '"Filter":"Off",' +
                         '"Beep":"Off",' +
                         '"Sleep":-1}'
        logInfo("IRhvac", " Aircon To " + jsonString )    
        mqttActions.publishMQTT("irBlaster2/cmnd/IRhvac",  jsonString )         
        
end

rule "If google control tuning aircon on/off"
when
   Item AirconditionerMode received command
then

          if (receivedCommand != OFF){ 
            AirconditionerPower.sendCommand(ON)
            AirconditionerSetMode.sendCommand(receivedCommand)
            
            } else {
                      AirconditionerPower.sendCommand(OFF)
                   }

end

You will need to change the broker name myMQTTBroker to the same as yours and irBlaster2/cmnd/IRhvac to yours cmnd/tasmota_8347F2/IRhvac

You will also need to change Vendor and other stuff to make it match yours.

{“Vendor”:“COOLIX”,“Model”:-1,“Power”:“On”,“Mode”:“Heat”,“Celsius”:“On”,“Temp”:21,“FanSpeed”:“Min”,“SwingV”:“Off”,“SwingH”:“Off”,“Quiet”:“Off”,“Turbo”:“Off”,“Econo”:“Off”,“Light”:“Off”,“Filter”:“Off”,“Clean”:“Off”,“Beep”:“Off”,“Sleep”:-1}}

If you want to setup all the other functions you can edit to suit. I use VSCode with openhab extention which helps heaps for little mistakes I make.

If you want to make it so the remote will change your aircon and update openhab let me know. My remotes are for emergency’s only its all automated or voice controlled now.

1 Like