slametps / MMM-TuyaSL

A MagicMirror module to display Tuya-based (smart_life) smarthome devices
3 stars 4 forks source link

Add functionality #10

Open 2hdlockness opened 2 years ago

2hdlockness commented 2 years ago

Hello First of all, well done for your module, it's great! Do you think it would be possible to add a feature to retrieve the value of a connected temperature sensor? Obviously a sensor that works with TUYA. Thank you

slametps commented 2 years ago

sorry, I don't have that device. To make it works, we must know the transmited message for that kind of device since I don't use the official Tuya API.

2hdlockness commented 2 years ago

Can you tell me what you need? I accessed the device log from Tuya IoT Platform. Maybe I can provide you with the necessary information?

2hdlockness commented 2 years ago

Hello I allow myself to rewrite a little message to you which has not had an answer to my previous one.

slametps commented 2 years ago

Sorry. Unfortunately, I have no time to tinkering and update the code for the new Tuya device. Besides, I don't have the device for the research because the method I use is unofficial by sniffing the transmitted package from Tuya cloud server to MM.

slametps commented 2 years ago

But, for start you may uncomment line 258 in node_helper.js, and see the MM console log output for listed devices and their properties:

//console.log("DEBUG: arrDevices = [" + this.dump(arrDevices) + "]");

2hdlockness commented 2 years ago

Thank you for your reply. This is what I have in my logs after uncommenting line 258.

[02.12.2021 12:55.15.459] [LOG] Getting device list... [02.12.2021 12:55.15.788] [LOG] DEBUG: regionTuya : eu [02.12.2021 12:55.15.790] [LOG] DEBUG: Number of Devices = 11 [02.12.2021 12:55.45.572] [ERROR] Whoops! There was an uncaught exception... [02.12.2021 12:55.45.576] [ERROR] TypeError: this.dump is not a function at Timeout.sendInfo [as _onTimeout] (/home/pi/MagicMirror/modules/MMM-TuyaSL/node_helper.js:258:54) at listOnTimeout (internal/timers.js:554:17) at processTimers (internal/timers.js:497:7)