zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

[New device support]: Aubess Universal Smart IR Remote Control - Tuya TS1201

Open kds69 opened this issue 4 years ago • 138 comments

Link

https://www.aliexpress.com/item/1005003772831987.html?gatewayAdapt=glo2fra&gatewayAdapt=glo2fra&gatewayAdapt=glo2fra&spm=a2g0o.order_list.0.0.21ef5e5bnDdlPP

Database entry

{"id":63,"type":"Router","ieeeAddr":"0x2c1165fffe63aea3","nwkAddr":27932,"manufId":4098,"manufName":"_TZ3290_acv1iuslxi3shaaj","powerSource":"Mains (single phase)","modelId":"TS1201","epList":[1,242],"endpoints":{"1":{"profId":260,"epId":1,"devId":61440,"inClusterList":[0,4,5,3,60672,57348,6],"outClusterList":[25,10],"clusters":{"genBasic":{"attributes":{"modelId":"TS1201","manufacturerName":"_TZ3290_acv1iuslxi3shaaj","powerSource":1,"zclVersion":3,"appVersion":65,"stackVersion":0,"hwVersion":1,"dateCode":""}}},"binds":[{"cluster":1,"type":"endpoint","deviceIeeeAddress":"0x00124b0022a54f44","endpointID":1},{"cluster":64642,"type":"endpoint","deviceIeeeAddress":"0x00124b0022a54f44","endpointID":1}],"configuredReportings":[],"meta":{}},"242":{"profId":41440,"epId":242,"devId":97,"inClusterList":[],"outClusterList":[33],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":65,"stackVersion":0,"hwVersion":1,"dateCode":"","zclVersion":3,"interviewCompleted":true,"meta":{},"lastSeen":1645952529076,"defaultSendRequestWhen":"immediate"}

Comments

I have purchased this item to give it a try in the hope that this device is a clone of HEIMAN HS2IRC (https://www.zigbee2mqtt.io/devices/HS2IRC.html). External converter (see in "external converter" part) which was replicating HEIMAN HS2IRC's device didn't help to get any response from AUBESS device (send "create" device command, "get_list"). Sniffing didn't show reply from device, but I am not very competent in that area. One thing I didn't try is to revert latest fix of heimen.js converter which force manufacturer to null on message toZigbee for HS2IRC. This could be a track to explore. Note that with or without external converter battery level exposure is causing non fatal errors as the Aubess device has no battery at all and obviously can't expose any...

External converter

const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const extend = require('zigbee-herdsman-converters/lib/extend');
const e = exposes.presets;
const ea = exposes.access;
const constants = require('zigbee-herdsman-converters/lib/constants');
const globalStore = require('zigbee-herdsman-converters/lib/store');

//change in zigbee db model and vendor

const definition = {
        fingerprint: [{modelID: 'TS1201', manufacturerName: '_TZ3290_acv1iuslxi3shaaj'}],
        //zigbeeModel: ['HS2IRC'],
        model: 'HS2IRC',
        vendor: 'HEIMAN',
        description: 'Aubess Universal Smart IR Remote Control',
        fromZigbee: [fz.battery, fz.heiman_ir_remote],
        toZigbee: [tz.heiman_ir_remote],
        exposes: [e.battery()],
        configure: async (device, coordinatorEndpoint, logger) => {
            const endpoint = device.getEndpoint(1);
            await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg', 'heimanSpecificInfraRedRemote']);
            await reporting.batteryPercentageRemaining(endpoint, {min: constants.repInterval.MINUTES_5, max: constants.repInterval.HOUR});
        },
};

module.exports = definition;

Supported color modes

No response

Color temperature range

No response

kds69 avatar Feb 27 '22 11:02 kds69

I would be interested by this device, will follow this issue.

nmaster2042 avatar Mar 11 '22 15:03 nmaster2042

I've got the device profiles:

ZigBee Device Profile, Simple Descriptor Response, Nwk Addr: ------, Status: Success
    Sequence Number: 24
    Status: Success (0)
    Nwk Addr of Interest: ------
    Simple Descriptor Length: 26
    Simple Descriptor
        Endpoint: 1
        Profile: Home Automation (0x0104)
        Application Device: Unknown (0xf000)
        Application Version: 0x0001
        Input Cluster Count: 7
        Input Cluster List
            Input Cluster: Basic (0x0000)
            Input Cluster: Groups (0x0004)
            Input Cluster: Scenes (0x0005)
            Input Cluster: Identify (0x0003)
            Input Cluster: Unknown (0xed00)
            Input Cluster: Unknown (0xe004)
            Input Cluster: On/Off (0x0006)
        Output Cluster Count: 2
        Output Cluster List
            Output Cluster: OTA Upgrade (0x0019)
            Output Cluster: Time (0x000a)

The clusters '0xed00' and '0xe004' looks interesting. Does anyone have information about them?

mak-42 avatar Mar 31 '22 20:03 mak-42

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days

github-actions[bot] avatar May 01 '22 00:05 github-actions[bot]

I'm waiting for a tuya hub to sniff the protocol and add the device.

mak-42 avatar May 01 '22 06:05 mak-42

I have a similar device that i bought for the same reason (was hoping it was a clone of the Heimann). This one is from Tuya (rebranded by Moes) and looks like it might be the same as your Aubess device. Let me know if i can help with anything would like to get mine working as well. I dont have a Tuya smart hub and this device just came in today so I haven't played with it much yet.

JoshuaDodds avatar May 07 '22 16:05 JoshuaDodds

I've received tuya hub and tried to sniff communication between the hub and the device. I think I know how to made the device receive a command from a remote control and transmit it. It should be enough to control simple devices (fans, lights, etc.), but is not enough for something smarter like climate control.

It seems the full protocol is quite complicated. I'll try to puzzle my brain over it a little bit more.

Look at the packets which hub sending to the device. Maybe you can see something.

  1. "Power on" command of Chinese fan (taught it for the first time): {"key_num":1,"delay":300,"key1":{"num":1,"freq":38000,"type":1,"key_code":"A/IEiwFAAwbJAfIE8gSLIAUBiwFAC+ADAwuLAfIE8gSLAckBRx9AB0ADBskB8gTyBIsgBQGLAUALA4sB8gRAB8ADBfIEiwHJAeARLwHJAeAFAwHyBOC5LwGLAeA97wOLAfIE4RcfBYsB8gTyBEAFAYsB4AcrCYsB8gTyBIsByQHgPY8DyQHyBOAHAwHyBEAX4BVfBIsB8gTJoAMF8gSLAckB4BUvAckB4AEDBfIEiwHJAQ=="}}
  2. "Power on" command of Chinese fan (same button, taught it for the second time): {"key_num":1,"delay":300,"key1":{"num":1,"freq":38000,"type":1,"key_code":"A/MEaAFAAwW+AfME8wRABQO+Ab4BQAUC8wTqIANAB0ADAfMEQCMBLx9AB0ADBr4B8wTzBGggBQFoAUAL4AMDQDcF8wRoAeoB4AEvBuoB8wTzBGggBQFoAUAL4AcDBfMEvgG+AeAZLwO+AfMEQDsB8wRAR+AZLwHqAYADBfMEaAG+AeABLwa+AfME8wRoIAUBaAHAI8AHwBsB6gHgAS8G6gHzBPMEaCAFAWgBQB9AA0ATwAMF8wRoAeoB4AEvQB8D8wRoAUADA+oB8wTgAwPAGwHqAeABLwbqAfME8wRoIAUBaAFAC0AjQANAC0ADAfMEQBfgES8B6gHgBQMB8wTgGS/gW1/AYwHzBOAZj+ADwwXzBGgBvgHA7wi+Ab4B8wTzBGggBQFoAeADJ0AXQA8B8wRAF8AvQAsE8wTzBGggBQFoAcAjQBPAAwHzBEAX4AEvBr4B8wTzBGggBQFoAcAjQAdAF0ADAfMEQBfgAS8G6gHzBPMEaCAFAWgBQAvgBwMB8wRAF+AdL+AbX0AjQAMB6gGAAwHzBOARX+ADJ+AJL0AdAWgBQBcD8wRoAUADQBFAD+ADBwXzBGgB6gHgAb9AGwnzBGgB8wS+Ab4BQAWAAwDqoAcF8wRoAb4BwC8IvgG+AfME8wRoIAUBaAHAI0ATwAMF8wRoAeoB"}}
  3. "Power on" command of an old Dune HD player (selected from the device vendor's database): {"key_num":1,"delay":300,"header":"00040ED8010010390015001500150040010004015A00AD00000106015A00560015","key1":{"type":0,"key_code":"00 00 BF 43 BC"}}

"key_code" contains the sequence (in base64) the device sent when it recorded pushing button on a remote control.

mak-42 avatar May 07 '22 18:05 mak-42

I dug out the documentation of Dune HD player. It says:

All Dune HD IR Remotes use NEC IR protocol. Different generations of Remotes use different NEC IR customer codes: ... Previous generation (Premium IR Remote + discontinued models): 00 BF ... IR HEX codes (latest Remote models use CF CF instead 00 BF): ... POWER 00 BF 43 BC There is the description of NEC Protocol.

I captured POWER button of an Dune HD player two times and sends it to the device:

  1. {"key_num":1,"delay":300,"key1":{"num":1,"freq":38000,"type":1,"key_code":"B08jRhFwAvsB4BUDAVwG4A0DQDfgAxtAD+ADA0Ab4AcPQBPAAwf7AXACXAZwAg=="}}
  2. {"key_num":1,"delay":300,"key1":{"num":1,"freq":38000,"type":1,"key_code":"B0gjQhFvAv8B4BUDAVoG4A0DQDfgAxtAD+ADA0Ab4AcPQBPAA0AbQAsPKaBII2IIbwL//0gjYghvAg=="}}

It does not look like I expected. All the ideas how to transform NEC protocol code to the "key_code" value are welcome.

Anyway. I'm going to make a custom script to support this device. It'll allow to learn keys returning the "key_code" value and send keys.

mak-42 avatar May 08 '22 18:05 mak-42

Thanks you so much for looking into it. Unfortunately, I can't help you on this. We'll probably come into play as you manage to create a script to learn keys. I actually do have robot vacuum cleaner for whichkeys from manufacturer (navibot) can be found on the net and I'll try in parallel now that I have the structure of messages thanks to you.

kds69 avatar May 10 '22 09:05 kds69

One does not simply write the script. It looks the developers of the device invented a custom protocol incapsulated into ZigBee packets. It requires to sends and received a sequence of ZigBee packets (usually command packets of six types) to transmit one IR command. I still don't understand how to make it right way. It seems it'll take more time when I expected.

mak-42 avatar May 10 '22 20:05 mak-42

I've managed to send one of previously written ir code to my fan using my awfully written script. It switched the fan on. I hope I'll finish the first version of the script at the weekend.

mak-42 avatar May 12 '22 22:05 mak-42

I've finished the first version of the script. It looks nasty, but should work. Please, check if it works with your devices. If everything is ok, I'll make a MR to support the device out of box.

Adding the device:

  1. The script file with external converter has to be unzipped next to the "configuration.yaml".
  2. Set the Zigbee2MQTT log_level to debug and enable the external converter by adding the following to your Zigbee2MQTT configuration.yaml:
advanced:
  log_level: debug
external_converters:
  - TS1201.js
  1. restart zigbee2mqtt.

The device should be recognized and ready to use.

The device exposed three properties:

  1. "learnIRCode" - turn it on to switch the device into learning mode.
  2. " learnedIRCode" - displays previously learned IR code.
  3. "IRCodeToSend" - paste one of previously learned IR code to send it by the device.

TS1201.zip

mak-42 avatar May 15 '22 14:05 mak-42

Hi! The original Aubess IR device removed from the Aliexpress shop. Now you can by this new one directly from Aubess, I hope this also work with your scripts, but I don't know, what will be the difference: https://www.aliexpress.com/item/1005004222101838.html?spm=a2g0o.store_pc_allProduct.8148356.1.27453847L42QDD&pdp_npi=2%40dis%21HUF%21HUF%2013%2C001.11%21HUF%208%2C711.89%21%21%21%21%21%400b0a187916527052859052723e9fa1%21%21sh

sipossz avatar May 16 '22 12:05 sipossz

I may be wrong but I think previous version of the device is always avaliable, see here: https://fr.aliexpress.com/item/1005003793186067.html?spm=a2g0s.8937460.0.0.3f3d2e0ePuePy3&gatewayAdapt=glo2fra

There is another one, but physically different: https://fr.aliexpress.com/item/1005003878194474.html?spm=a2g0s.8937460.0.0.3f3d2e0ePuePy3&gatewayAdapt=glo2fra

nmaster2042 avatar May 16 '22 13:05 nmaster2042

Ok as I see the difference is only the power supply: the new one works with 2xAAA betteries against USB charging. I order one, and I'll try it, how it works with your script.

sipossz avatar May 16 '22 13:05 sipossz

sipossz, I think the script should be modified for new device, because it should report battery status at least. Please send a database entry when you receive the device and I'll try to modify the script for you,

mak-42 avatar May 16 '22 21:05 mak-42

External converter TS1201.js tested successfully on 2 IR devices: -navibot samsung SR8950 -yamaha home theater HTR-4064

Well done, Sir!! This is really great!!

Question: I tested directly via zigbee2mqtt front-page. How mqtt command would look like? ... found ;)

kds69 avatar May 20 '22 15:05 kds69

@kds69, thank you for testing. I started creating a merge request, but I need more time to complete it. So hopefully, I'll finish it next week.

mak-42 avatar May 22 '22 18:05 mak-42

I've finished the first version of the script. It looks nasty, but should work. Please, check if it works with your devices. If everything is ok, I'll make a MR to support the device out of box.

Adding the device:

  1. The script file with external converter has to be unzipped next to the "configuration.yaml".
  2. Set the Zigbee2MQTT log_level to debug and enable the external converter by adding the following to your Zigbee2MQTT configuration.yaml:
advanced:
  log_level: debug
external_converters:
  - TS1201.js
  1. restart zigbee2mqtt.

The device should be recognized and ready to use.

The device exposed three properties:

  1. "learnIRCode" - turn it on to switch the device into learning mode.
  2. " learnedIRCode" - displays previously learned IR code.
  3. "IRCodeToSend" - paste one of previously learned IR code to send it by the device.

TS1201.zip

thank you so much it works even with: https://www.aliexpress.com/item/1005004203511085.html?spm=a2g0o.order_list.0.0.59ef1802wEH7PO

Model:UFO-R11 Vendor: MOES

i change "" manufacturerName: '_TZ3290_j37rooaxrcdcqo5n'}"" and works fine

but it didn't show battery percentage at first time i try to configure it with ZHA, ZHA show battery percentage.

can anyone please share how to add device button to dashboard after reading IR code , (for example power button in tv )

naifzack avatar May 25 '22 09:05 naifzack

can anyone please share how to add device button to dashboard after reading IR code , (for example power button in tv )

This is HA related question, I do recommend to check on the HA community forum or discord.

kds69 avatar May 25 '22 10:05 kds69

share link please to any recommended page

naifzack avatar May 25 '22 10:05 naifzack