tuya-local icon indicating copy to clipboard operation
tuya-local copied to clipboard

New device - Universal Remote Control

Open Der-Nax opened this issue 3 years ago • 7 comments

I added new device:

`name: Universal Remote Control products:

  • id: whs3cty93fzrqkpt primary_entity: entity: sensor dps:
    • id: 101 name: sensor type: integer unit: C range: min: 0 max: 80 mapping:
      • scale: 10 secondary_entities:
  • entity: sensor class: humidity name: Humidity dps:
    • id: 102 type: integer name: sensor unit: "%" class: measurement readonly: true`

Der-Nax avatar Jul 19 '22 21:07 Der-Nax

Please add it in a new release.

There is additional functionality - subdevice. Do you have plans to support subdevices?

Information about subdevice: { "result": { "active_time": xxx, "category": "infrared_ac", "category_name": "Infrared air conditioner", "create_time": xxx, "gateway_id": "xxx", "icon": "smart/icon/001453365846342fhj9e/11c62df7bd89c10f43d3e5ee8d13b4f4.png", "id": "xxx", "ip": "", "lat": "xxx", "local_key": "xxx", "lon": "xxx", "model": "", "name": "XXX", "node_id": "xxx", "online": true, "owner_id": "xxx", "product_id": "qzktzhehinzsz2je", "product_name": "Air Conditioning", "sub": true, "time_zone": "xx", "update_time": xxx, "uuid": "xxx" }, "success": true, "t": XXX, "tid": "XXX" }

{ "result": { "category": "infrared_ac", "functions": [ { "code": "F", "type": "ENUM", "values": "{"min":0,"max":3,"scale":0,"step":1,"type":"Integer"}" }, { "code": "M", "type": "ENUM", "values": "{"min":0,"max":4,"scale":0,"step":1,"type":"Integer"}" }, { "code": "PowerOff", "type": "STRING", "values": "PowerOff" }, { "code": "PowerOn", "type": "STRING", "values": "PowerOn" }, { "code": "T", "type": "ENUM", "values": "{"min":16,"max":30,"scale":0,"step":1,"type":"Integer"}" } ], "status": [ { "code": "wind", "type": "ENUM", "values": "{"min":0,"max":3,"scale":0,"step":1,"type":"Integer"}" }, { "code": "mode", "type": "ENUM", "values": "{"min":0,"max":4,"scale":0,"step":1,"type":"Integer"}" }, { "code": "power", "type": "BOOLEAN", "values": "{}" }, { "code": "temp", "type": "ENUM", "values": "{"min":16,"max":30,"scale":0,"step":1,"type":"Integer"}" } ] }, "success": true, "t": XXX, "tid": "XXX" }

Der-Nax avatar Jul 19 '22 21:07 Der-Nax

Currently subdevices are not handled by the underlying tinytuya library, but when they are I would like to add support (as requested previously in #70, and required for #170 as well as this device). However I think IR blasters are different in that they do not return any data, only allow commands to be sent, so further changes are also needed to enable that, since current support assumes a simple mapping to data points that can always be read, and some can be also set (previously rejected in #120 as it deviates too much from the current feature set, but maybe one day...).

make-all avatar Jul 20 '22 00:07 make-all

Could you add basik device in next realese? It work as temperature and humidity sensor.

Der-Nax avatar Jul 26 '22 08:07 Der-Nax

This is exactly what the commit above is for - just the two sensors. So actually you can try it already by going to the tuya-local integration in HACS, selecting "Redownload" from the menu, and select "main" as the version to install.

make-all avatar Jul 26 '22 09:07 make-all

I updated integration. But device was not working. I will need to add my files to device folder. I have not time to undestand the problem. Sorry. Could you please provide name of file which you add? I'll try to check.

Der-Nax avatar Jul 28 '22 17:07 Der-Nax

The file is ir_remote_sensors.yaml.

You can see the change here: https://github.com/make-all/tuya-local/commit/c4ff146607b3852ec78663e02d58e462dbeea41e#diff-20448fbcc4d0159e0d0caefe8d4ed8937071f29d20ef4b85ec45119c62a49e09

If you previously had it working with a different filename, you may need to remove the old device and re-add it.

make-all avatar Jul 29 '22 13:07 make-all

Although this issue contains tuya portal info for a sub device, local info is missing, so this issue will be closed when the general subdevice support is added without implementing that specific device.

make-all avatar Apr 29 '23 14:04 make-all

@make-all How to know which codes / commands to send (what to use for the command field)?

stijnb1234 avatar Dec 31 '23 20:12 stijnb1234

You can use the remote.learn_command service to learn the commands and they will be filed against a subdevice and command name that you specify. The send command will then use the same details. Otherwise you need to send raw codes prefixed with b64: but the way Tuya represents their codes is different than broadlink and others, so you'll need a Tuya specific source for those codes.

make-all avatar Jan 01 '24 01:01 make-all

@make-all I have managed to work out how to learn and I can see the codes in the file outputted in .storage but how do I now send these! Sorry for the dumb question, I'm a noob to IR part of HA.

christianzappa avatar Jan 16 '24 15:01 christianzappa

Use the remote.send_command service with the same device and command that you recorded the remote code against.

make-all avatar Jan 16 '24 22:01 make-all

Use the remote.send_command service with the same device and command that you recorded the remote code against.

Gotcha. I worked it out in the end.

By my device is a S06Pro WR3E, seems to be working nicely

christianzappa avatar Jan 17 '24 13:01 christianzappa