I’m testing a TuYa ZS06 (mains powered) which is functionally the same as the Moes UFO-R11 (battery powered) and was not able to find the information I needed to get it working with the SmartIR integration to be passed through to Home Assistant as a Climate entity. I’m gathering what I found here for ease of access for others.
The below assumes you are familiar with the SmartIR integration, have some experience with IR controllers such as the Broadlink product, and are aware that you need a compatible device_code for your particular device or produce your own device_code (as below).
Generally, the steps are:
-
Pair the ZS06 remote to zigbee2mqtt (z2m)
-
Learn the IR codes for your climate device. In z2m, click on the Exposes tab of the remote; click ON for State; while pointing at the IR remote, press the button on the physical remote you want to collect the IR code; copy/paste the resulting code in a separate file. Build your .json climate code per SmartIR instructions and upload it to
/config/custom_components/smartir/codes/climate
-
Add the remote to Home Assistant via the SmartIR platform, specifically adding the remote to configuration.yaml
climate:
- platform: smartir
name: Livingroom AC
unique_id: livingroom_ac
device_code: 9507 #this device_code is the .json file you produced by learning IR codes for your climate device
controller_data: zigbee2mqtt/zs06-ir/set
- Reboot Home Assistant, then Add a new Lovelace Climate card with entity climate.livingroom_ac and it will show up as a climate device as expected.
Essentially, you have all the information available from the smarthomescene.com review [1] and the zigbee2mqtt.io database [2] but the two details that were hard for me to come by are:
a) The climate .json code file for a Broadlink controller is Base64 whereas the code file for MQTT should be Raw:
"supportedController": "MQTT",
"commandsEncoding": "Raw",
b) The MQTT payload used in the script of the smarthomescene.com review [1] will work in the script but in order for the payload to be executed within the device_code .json used with SmartIR, you have to escape any double quote inside the json command. See SmartIR Github Issue #873 and #1074
"{\"ir_code_to_send\": \"Learned_IR_Code\"}",
A sample of my device_code .json file:
{
"manufacturer": "Mitsubishi Electric",
"supportedModels": [
"MSY-GM18VA"
],
"supportedController": "MQTT",
"commandsEncoding": "Raw",
"minTemperature": 16.0,
"maxTemperature": 31.0,
"precision": 1.0,
"operationModes": [
"cool"
],
"fanModes": [
"low"
],
"commands": {
"off": "{\"ir_code_to_send\": \"CEcNegaSAeYE0mADAJJgAQXSAV8B0gFAE0AHQA9AC0ADgAsAkmAHBZIB0gHmBIADQ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HATYCRwHAC0AHQANAF+ADA0AjQANAE0AH4AMD4C0TBAwBNgJHIANAB0AD4AMLQA9AA+AfE0Ar4AMDA98ANgLAD+ADC+AHEwXfAHIF3wBAB0ADAJQgDws2At8AlAKmAHIFpgA=\"}"
}
}
}
}
Resources:
[1] https://smarthomescene.com/reviews/tuya-zigbee-infrared-ir-remote-zs06-review/
[2] TuYa ZS06 control via MQTT | Zigbee2MQTT
[3] SmartIR Github Issue #1084 also has a NodeRed Flow to convert Broadlink Base64 codes to MQTT Raw codes but I have not personally tried it