Tasmota MQTT IRHVAC Controller

@kmavrov For the first issue (AC not reacting to the sent code) - One thing to mension double check the Tasmota config for the IR emitting diode. It is a little confusing for lots of people, that D2 pin is GPIO4 and D4 pin is GPIO2. It is eay to set it wrong and loose hours in debugging. You said you’re using tuya remote - chech which pin is controlling their IR LEDs and set it in the Tasmota config as might not be the same as in my DIY devices.

@NoahO Did you tried changing the default value in your config from default_swingv: "high" to default_swingv: "auto"?

@ridham Try with this line:

IRHVAC {"Vendor":"MITSUBISHI_AC","Model":-1,"Command":"Control","Mode":"Cool","Power":"Off","Celsius":"On","Temp":24,"FanSpeed":"High","SwingV":"Lowest","SwingH":"Left Max","Quiet":"Off","Turbo":"Off","Econo":"Off","Light":"Off","Filter":"Off","Clean":"Off","Beep":"Off","Sleep":-1,"iFeel":"Off","SensorTemp":null}

BTW, pay attantion to the double quotes in my example - they are the right one to use, not the one in your example.

When you want to test with other commands from your remote, you have to copy from Tasmota console from {“Vendor”:“MITSUBISHI_AC” part to the next closing curly bracket }, they in Tasmota console write IRHVAC followed by what you already copied. In other words you have to copy the value of the “IRHVAC” key and then send the copied it IRHVAC command. :slight_smile:

Thanks @gh0s7 It worked :partying_face:

1 Like

@ridham I’m glad it worked for You! :slight_smile:

It works! Thanks!

Hi @gh0s7
If i need to add more leds to cover 360 degrees like those tuya ir remote.
Is there a example/diagram to connect the additional LEDs?

Hi there!

Thanks a lot for all your work on this integration.
I’m having an issue where my Daikin unit that runs off the DAIKIN64 protocol constantly goes out of sync.
The reported state of the remote vs the actual state of the HVAC becomes inverted after a while, or after a power cycle.
That usually results in mode adjustments or temperature adjustments on the integration causing the HVAC to turn off, while applying the new settings; turning it back on via remote causes the integration to turn off instead.

This is my config

climate:
  - platform: tasmota_irhvac
    name: Daikin_Dispensary_IRHvac
    command_topic: "cmnd/DaikinDispensary_IR/irhvac"
    state_topic: "tele/DaikinDispensary_IR/RESULT"
    temperature_sensor: sensor.sonoff_1001031489_temperature #optional this sensor is used to display current temp on the AC card
    protocol: "DAIKIN64"
    min_temp: 16 #optional - default 16 int value
    max_temp: 30 #optional - default 32 int value
    target_temp: 26 #optional - default 26 int value
    initial_operation_mode: "off" # optional - default "off" string value
    away_temp: 26 #optional - default 24 int value
    precision: 1.0 #optional - default 1.0 float value
    supported_modes:
      - cool
      - dry
      - fan_only
      - "off" #Turns the AC off - Should be quoted and should be always included here
    supported_fan_speeds:
      - low
      - medium
      - high
      - auto
    supported_swing_list:
      - "off"
      - vertical #up to down
    hvac_model: "1" # string value
    celsius_mode: "On" #optional - default "On" string value - you can remove it if you use celsius

Anyone with a similar issue manage to work this out?

Thanks!

I think the same thing happens with my daikin ac.
After power cycle, tasmota seems to be inverted?
Sending off command turns daikin on and the opposite.
When i use the phsyical remote, sending on commands shows up as ‘off’ in the console

Hi. Thanks for replying. Another issue i noticed is, after being turned on using the remote (without cycling the mains), adjustments via the interface causes the AC to turn back off (adjusting temps/fan modes, etc).

Wondering if the power command is being sent by tasmota each time changes are made via the interface

Hi, I’m going crazy to get the ir to work for starting an air conditioner.
What I use: EPS8266, IR LED as per photo.



What I do: I point the air conditioner remote control at the receiver and I get this on console:

11:38:51.130 RSL: RESULT = {"IrReceived":{"Protocol":"COOLIX","Bits":24,"Data":"0xB21F48","DataLSB":"0x4DF812","Repeat":0,"IRHVAC":{"Vendor":"COOLIX","Model":-1,"Command":"Control","Mode":"Auto","Power":"On","Celsius":"On","Temp":24,"FanSpeed":"Auto","SwingV":"Off","SwingH":"Off","Quiet":"Off","Turbo":"Off","Econo":"Off","Light":"Off","Filter":"Off","Clean":"Off","Beep":"Off","Sleep":-1,"iFeel":"Off","SensorTemp":null}}}


next, i send this:

11:40:25.325 CMD: IRHVAC :{"Vendor":"COOLIX","Model":-1,"Command":"Control","Mode":"Auto","Power":"On","Celsius":"On","Temp":24,"FanSpeed":"Auto","SwingV":"Off","SwingH":"Off","Quiet":"Off","Turbo":"Off","Econo":"Off","Light":"Off","Filter":"Off","Clean":"Off","Beep":"Off","Sleep":-1,"iFeel":"Off"}


but the air conditioner does not respond
What i tested:
I tried to change Ir led and receiver, I tried to change more Esp8266, even testing an esp32 but it doesn’t change. The LEDs work because I see the flash via the IR camera.
I also tried receiving the raw data and converting it but it doesn’t work the same

I tried with a Philips TV but nothing happens…

what am I doing wrong?

Yeah, it does happen randomly.
I wonder if it’s more of tasmota-ir issue or hacs issue
Probably need to raise this issue on tasmota github?

On the esp8266, did you use the VU pin?
Also, did you position the transistor correctly?

I’ve already written to Tasmota but no one responds


I used this pin for ir led

For that board, use VU pin, not VIN

1 Like

Already raised an issue on github. So far no response. Have you been able to reproduce the error consistently ?

If you’re powerin the board with USB - use VU as @ferbulous said. If you power the board from the VIN pin, use the same pin for the LED.

When you use HA card to command the AC, we send to Tasmota the full payload for the AC:

    async def send_ir(self):
        """Send the payload to tasmota mqtt topic."""
        fan_speed = self.fan_mode
        # tweak for some ELECTRA_AC devices
        if HVAC_FAN_MAX_HIGH in self._fan_list and HVAC_FAN_AUTO_MAX in self._fan_list:
            if self.fan_mode == FAN_HIGH:
                fan_speed = HVAC_FAN_MAX
            if self.fan_mode == HVAC_FAN_MAX:
                fan_speed = HVAC_FAN_AUTO

        # Set the swing mode - default off
        self._swingv = STATE_OFF if self._fix_swingv is None else self._fix_swingv
        self._swingh = STATE_OFF if self._fix_swingh is None else self._fix_swingh

        if SWING_BOTH in self._swing_list or SWING_VERTICAL in self._swing_list:
            if self._swing_mode == SWING_BOTH or self._swing_mode == SWING_VERTICAL:
                self._swingv = STATE_AUTO

        if SWING_BOTH in self._swing_list or SWING_HORIZONTAL in self._swing_list:
            if self._swing_mode == SWING_BOTH or self._swing_mode == SWING_HORIZONTAL:
                self._swingh = STATE_AUTO

        _dt = dt_util.now()
        _min = _dt.hour * 60 + _dt.minute

        # Populate the payload
        payload_data = {
            "StateMode": self._state_mode,
            "Vendor": self._vendor,
            "Model": self._model,
            "Power": self.power_mode,
            "Mode": self._last_on_mode if self._keep_mode else self._hvac_mode,
            "Celsius": self._celsius,
            "Temp": self._target_temp,
            "FanSpeed": fan_speed,
            "SwingV": self._swingv,
            "SwingH": self._swingh,
            "Quiet": self._quiet,
            "Turbo": self._turbo,
            "Econo": self._econo,
            "Light": self._light,
            "Filter": self._filter,
            "Clean": self._clean,
            "Beep": self._beep,
            "Sleep": self._sleep,
            "Clock": int(_min),
            "Weekday": int(_dt.weekday()),
        }
        self._state_mode = DEFAULT_STATE_MODE
        for key in self._toggle_list:
            setattr(self, "_" + key.lower(), "off")

        payload = json.dumps(payload_data)

        # Publish mqtt message
        if float(self._mqtt_delay) != float(DEFAULT_MQTT_DELAY):
            await asyncio.sleep(float(self._mqtt_delay))

        await mqtt.async_publish(self.hass, self.topic, payload)

        # Update HA UI and State
        self.async_schedule_update_ha_state()

When we receive something from Tasmota, we check what of all of these properties are received and we set in HA only those, that are received and we set it to the value that we receive from Tasmota (excluding swing).
You can see the full code here
So I can’t help a lot for this issue, but you can still give an example of what Tasmota receives, when you press the button of your remote, when the problem occurs.
This could be an issue on Tasmota side or IRremoteESP8266 which are making the protocols library, that Tasmota uses.
Anyway, you can still provide Tasmota logs from when the problem occurs.

In the logs, when that happens it seems to just output the inverse of on or off when command send from ha or phsyical remote

Looks like this issue was raised before for daikin64

1 Like