tuya-local
                                
                                 tuya-local copied to clipboard
                                
                                    tuya-local copied to clipboard
                            
                            
                            
                        New device - Universal Remote Control
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:
 
 
- id: 101
name: sensor
type: integer
unit: C
range:
min: 0
max: 80
mapping:
- entity: sensor
class: humidity
name: Humidity
dps:
- id: 102 type: integer name: sensor unit: "%" class: measurement readonly: true`
 
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" }
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...).
Could you add basik device in next realese? It work as temperature and humidity sensor.
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.
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.
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.
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 How to know which codes / commands to send (what to use for the command field)?
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 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.
Use the remote.send_command service with the same device and command that you recorded the remote code against.
Use the
remote.send_commandservice 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