Tasmota MQTT IRHVAC Controller

I run Check Configuration and the configuration is valid.
Warning messages from the log:

2020-08-11 19:53:22 INFO (MainThread) [homeassistant.components.climate] Not adding entity AC_Receiver_LivingRoom because it’s disabled

2020-08-11 19:53:22 INFO (MainThread) [homeassistant.components.climate] Setting up climate.mqtt

2020-08-11 19:53:22 INFO (MainThread) [homeassistant.setup] Setup of domain climate took 0.2 seconds

2020-08-11 19:53:22 INFO (MainThread) [homeassistant.setup] Setting up climate

2020-08-11 19:53:21 INFO (MainThread) [homeassistant.bootstrap] Setting up stage 2: {‘device_tracker’, ‘yeelight’, ‘history’, ‘climate’, ‘zone’, ‘system_health’, ‘sensor’, ‘ssdp’, ‘input_number’, ‘map’, ‘cast’, ‘updater’, ‘default_config’, ‘input_boolean’, ‘zeroconf’, ‘cover’, ‘group’, ‘input_datetime’, ‘met’, ‘ipp’, ‘tts’, ‘mqtt’, ‘switch’, ‘logbook’, ‘mobile_app’, ‘input_text’, ‘script’, ‘automation’, ‘sun’, ‘scene’, ‘upnp’, ‘input_select’}

Here’s the relevant message:

I have no idea how you managed to disable it but here’s how to re-enable it:

  1. Go to Configuration > Entities
  2. Click the Filter icon displayed in the upper right-hand corner of the screen to reveal its menu.
    Screenshot from 2020-08-11 17-01-04
  3. Enable “Show disabled entities”
  4. Find climate.ac_receiver_livingroom in the list and click it to display more information.
  5. You will see an “Enable Entity” toggle button. Turn it on.
  6. Restart Home Assistant.

Thank you!!

example for me please

Sorry for the possibly newbie question, I’m quite new to HA. Is there an off-the-shelf transmitter that can be re-flashed OTA that would work with this integration? I’d love to start controlling my Pioneer (made by Gree?) minisplit and this sounds like a good path. However, with a newborn in the house setting up my soldering station is a bridge too far. :slight_smile:

So, I can control my AC from the UI and everything works great but I want that when I am using the remote controller of the AC it will send the mqtt message that received in the receiver to the AC via the transmitter. I thought about an automation that the trigger is mqtt tele/RESULT and the action is the script that I wrote.
Can you help me please?

As long as you have the ir receiver positioned near the AC or receiver then it should also receive the remotes transmission and update it on HA

The ir receiver and the transimitter is not positioned near the AC but they are positioned that they aimed to the AC. I control the AC by aim the remote control the the receiver.

I believe th1234 was asking about a different configuration: Instead point the AC remote to the custom built IRHVAC unit, and then have any received commands update Home Assistant AND repeat that same command through the custom IRHVAC unit, thus sending it to the AC unit.

Understand what you are trying to achieve now. You want the module to act as kind of a repeater as such.

I will step aside now as my knowledge ends here but can’t see why it shouldn’t be possible with something like an automation or a script that kits resends the command that was received.

Been a while since I have used tasmota and MQTT as I switch to esphome but the might be a rule you could add to tasmota that rebroadcasts the command. This would remove any dependence from HA having to do the work and remove any delay or issues

I have some problems:

  1. When I am pressing the buttons in the UI of the home assistant it sends to the AC but doesn’t update the UI.

  2. When I change the temp in the UI it sends the temp to the AC but the mode is unknown:
    14:31:30 CMD: Group 0, Index 1, Command "IRHVAC", Data "{"Vendor":"GREE","Power":"on","Mode":"unknown","FanSpeed":"Auto","Light":"On","Temp":23.0}"

  3. When I change the mode in the UI it sends the mode to the AC but the temp is none or 0:
    14:31:30 CMD: Group 0, Index 1, Command "IRHVAC", Data "{"Vendor":"GREE","Power":"on","Mode":"heat","FanSpeed":"Auto","Light":"On","Temp":None}"

  4. The problem that when I am using the AC remote control from the receiver and the transmitter, the receiver is receiving the data but it doesn’t transmit it to the AC via the transmitter

That’s the configuration.yaml:

climate:
  - platform: mqtt
    name: AC_Receiver_LivingRoom
    unique_id: '1'
    qos: 1
    precision: 1.0
    retain: true
    modes:
      - "off"
      - "cool"
      - "heat"
    min_temp: 16
    max_temp: 30
    payload_on: 'on'
    payload_off: 'off'
    
    power_state_topic: 'tele/AC_LivingRoom/RESULT'
    power_state_template: '{{ value_json["IrReceived"]["IRHVAC"]["Power"] }}'
    
    mode_command_topic: climate/hvac_mode
    mode_state_topic: 'tele/AC_LivingRoom/RESULT'
    mode_state_template: '{{ value_json["IrReceived"]["IRHVAC"]["Mode"] | lower }}'

    temperature_command_topic: climate/temperature
    temperature_state_topic: 'tele/AC_LivingRoom/RESULT'
    temperature_state_template: '{{ value_json["IrReceived"]["IRHVAC"]["Temp"] }}'

And that’s the automations.yaml:

- id: '1597665196561'
  alias: AC temp
  trigger:
    platform: mqtt
    topic: climate/temperature
  action: 
    - service: mqtt.publish
      data_template:
        topic: cmnd/AC_LivingRoom/IRhvac
        payload: >
          {"Vendor":"GREE","Power":"on","Mode":"{{states('climate.ac_receiver_livingroom')}}","FanSpeed":"Auto","Light":"On","Temp":{{trigger.payload}}}
  mode: single
- id: '1597665221423'
  alias: AC mode
  trigger:
    platform: mqtt
    topic: climate/hvac_mode
  action: 
    - service: mqtt.publish
      data_template:
        topic: cmnd/AC_LivingRoom/IRhvac
        payload: >
          {% if trigger.payload == "off" %}
             {"Vendor":"GREE","Power":"off","Mode":"{{states('climate.ac_receiver_livingroom')}}","FanSpeed":"Auto","Light":"On","Temp":{{state_attr('climate.ac_receiver_livingroom','temperature')}}} 
          {% else %}
             {"Vendor":"GREE","Power":"on","Mode":"{{trigger.payload}}","FanSpeed":"Auto","Light":"On","Temp":{{state_attr('climate.ac_receiver_livingroom','temperature')}}}
          {% endif %}
  mode: single

I tried to change automations in some ways but it didn’t work

Thanks for your help!!

congratulations for the compose, it works perfectly. I’m using it on two air conditioners the only problem is that exposing the two climates to google when I say: 'ok google turn on the air conditioner ", google answers ok, the air conditioner emits the command reception beep but does not turn on. Looking from the console it seems that the command is sent correctly Any idea?

Can you specify if two air conditioners are is sight of a single devide? Also usualy it works like “ok google, set speciffic_air_conditioner to 24 degrees cool”. I mean, you have to ask it to set it to given temperature and mode too. In this example it is “24 degrees cool” :slight_smile:

the air conditioners are controlled by two different devices. even commanding from the Google app I have the same problem and Alexa also behaves the same way. While with other integration methods (for example smart ir) with the same command everything works perfectly. I’ll try to give the specific command ok Google “set to cold 24 degrees”

I tried as you told me, but same result

Hm … That sounds strange … If in the Tasmota console the IR command looks good, then I would check if the IR emmiter is OK or if it is connected properly (as in my picture in the first post) … Also if you have this 100 ohms resistor R2, you have to remove it. And another thing that you have to check is if the pin that you have connected the IR led has 5V on it. Not all Node MCUs have the same pinouts and power options, and sometimes on 5V pin VIN there may be less than a 0.5V. You may check for VU pin in this case, but it is important to feed the IR with 5V. :slight_smile:

Strange behaviour of IR transmitter.

I’m still new to the HA scene, but have already spend a good number of things learning, trying, playing, frustrating, rebuilding etc. (giving the abbreviated version) My next step was to put Tasmota on my Eachen IR system to control an AC unit. I used the remote to see the message on the console of the IR, copied the message, created a stand-alone automation to send it to the AC from within HA.

But when I send the “ON” command, the AC turns “OFF”. I thought I made a mistake, but I couldn’t figure out what was wrong. I eliminated all the inbetween steps until in increased the console logging on the Tasmota and found this:

22:15:08 MQT: Received Topic "cmnd/IR_LR/IRHVAC", Data Size 338, Data "{"Protocol":"SHARP_AC","Bits":104,"Data":"0x0xAA5ACF10CB113200088000F051","Repeat":0,"IRHVAC":{"Vendor":"SHARP_AC","Model":-1,"Power":"On","Mode":"Cool","Celsius":"On","Temp":26,"FanSpeed":"Medium","SwingV":"Off","SwingH":"Off","Quiet":"Off","Turbo":"Off","Econo":"Off","Light":"Off","Filter":"Off","Clean":"Off","Beep":"Off","Sleep":-1}}"
22:15:08 SRC: MQTT
22:15:08 CMD: Group 0, Index 1, Command "IRHVAC", Data "{"Protocol":"SHARP_AC","Bits":104,"Data":"0x0xAA5ACF10CB113200088000F051","Repeat":0,"IRHVAC":{"Vendor":"SHARP_AC","Model":-1,"Power":"On","Mode":"Cool","Celsius":"On","Temp":26,"FanSpeed":"Medium","SwingV":"Off","SwingH":"Off","Quiet":"Off","Turbo":"Off","Econo":"Off","Light":"Off","Filter":"Off","Clean":"Off","Beep":"Off","Sleep":-1}}"

22:15:08 MQT: stat/IR_LR/RESULT = {"IRHVAC":{"Vendor":"SHARP_AC","Model":1,"Power":"Off","Mode":"Off","Celsius":"On","Temp":21,"FanSpeed":"Medium","SwingV":"Off","SwingH":"Off","Quiet":"Off","Turbo":"Off","Econo":"Off","Light":"Off","Filter":"Off","Clean":"Off","Beep":"Off","Sleep":-1}}
22:15:08 MQT: tele/IR_LR/RESULT = {"IrReceived":{"Protocol":"SHARP_AC","Bits":104,"Data":"0x0xAA5ACF1000213000088005E071","Repeat":0,"IRHVAC":{"Vendor":"SHARP_AC","Model":-1,"Power":"Off","Mode":"Off","Celsius":"On","Temp":15,"FanSpeed":"Medium","SwingV":"Off","SwingH":"Off","Quiet":"Off","Turbo":"Off","Econo":"Off","Light":"Off","Filter":"Off","Clean":"Off","Beep":"Off","Sleep":-1}}}

Mind the “Power”:“On” in the transmission and the “Power”:“Off” in the result and telemetry.

So if I’m correct, it sends the “ON” command, but in the result, there is the “OFF” command (as well as some of the other fields that I didn’t set). I’m probably doing something wrong and searched before writing this message, but I didn’t get find anyone that seems to have this (beginners?) problem.

Your help will be creatly appreciated!

@gh0s7 Thanks for that wonderful project!.
Im using Tasmota IRHVAC version not the LG version.Lg version didnt work for me

when i am using the tele/tasmota_0D7671/RESULT for the state topic i am getting this error in homeassitant.

Exception in state_message_received when handling msg on 'tele/tasmota_0D7671/RESULT': '{"IrReceived":{"Protocol":"LG2","Bits":28,"Data":"0x880074B","DataLSB":"0x1001E0D2","Repeat":0,"IRHVAC":{"Vendor":"LG","Model":2,"Power":"On","Mode":"Cool","Celsius":"On","Temp":22,"FanSpeed":"Max","SwingV":"Off","SwingH":"Off","Quiet":"Off","Turbo":"Off","Econo":"Off","Light":"Off","Filter":"Off","Clean":"Off","Beep":"Off","Sleep":-1}}}' Traceback (most recent call last): 
File "/config/custom_components/tasmota_irhvac/climate.py", line 544, in state_message_received AttributeError: 'TasmotaIrhvac' object has no attribute '_protocol'

this is my console output:

 tele/tasmota_0D7671/RESULT = {"IrReceived":{"Protocol":"LG2","Bits":28,"Data":"0x88C0051","DataLSB":"0x1031008A","Repeat":0,"IRHVAC":{"Vendor":"LG","Model":2,"Power":"Off","Mode":"Off","Celsius":"On","Temp":15,"FanSpeed":"Auto","SwingV":"Off","SwingH":"Off","Quiet":"Off","Turbo":"Off","Econo":"Off","Light":"Off","Filter":"Off","Clean":"Off","Beep":"Off","Sleep":-1}}}

For my LG AC, Protocol - LG2 and Model - LG Could this be reason for the error.

@soap This is a bug as we migrated to “vendor” instead of “protocol” so we have to fix it first. Thanks for your feedback! Will fix it soon and it will work in next version/commit. Il’l post here when it is ready … :wink:

@soap It was fixed some time ago, but I didn’t merged the changes. Can you try with the newest code now and share if it works now? Sorry for the bug, it is my fault that I didn’t accept the latest code changes. :slight_smile: