TheAgentK / tuya-mqtt

Nodejs-Script to combine tuyaapi and openhab via mqtt
MIT License
173 stars 80 forks source link

Support for non numeric device id #32

Closed francisp2 closed 3 years ago

francisp2 commented 4 years ago

Is your feature request related to a problem? Please describe. All the examples I find assume the device id is a number, e.g. 1234567890ABCDEF, however, I have two lights where the device id is not a number e.g. : bff339668eb83f6350kkah lsc

Describe the solution you'd like Don't want it to crash on the non-numeric device id

tsightler commented 4 years ago

I can't really think of anything in the tuya-mqtt code itself that wouldn't allow this. The code simply accepts whatever value you put in this field and passes it to the API. Have you tried it with things like tuya-cli and proven that it works?

tsightler commented 4 years ago

Did a little research and I think you may have a device that uses the v3.2 Tuya protocol. Currently this is not supported by the Tuya API which tuya-mqtt depends on although there is an enhancement request. Below is a small, relevant snippet:

It's also interesting to note that some other assumptions have been broken with this protocol, for instance the devId normally consists of a prod_idx and the mac address concatenated, but here it doesn't look like a mac address at all.

Thus it wouldn't be possible to add support for this device until it is supported in tuyapi. I will keep this open and we can revisit if/when tuyapi adds support.

tsightler commented 3 years ago

I don't believe that this can be supported at this time since the protocol is not supported by the API. Closing for now.