-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plug Compatibility Question - #28
Comments
Can you try with the latest version |
Running 'node node_modules/njstuya’ does identify the previously missed switches (see below). I will continue to see whether I can command them later and update you.
{"id":"ebb3728730aad57411us9i","broadcast":{"ip":"10.0.1.80","port":6668,"id":"ebb3728730aad57411us9i","gwID":"ebb3728730aad57411us9i","version":""},"schema":"�q�*P\u001b!4_�����t�w�\b&'����˷�?���"}
{"id":"ebb508bf95ccbedbabjxrb","broadcast":{"ip":"10.0.1.81","port":6668,"id":"ebb508bf95ccbedbabjxrb","gwID":"ebb508bf95ccbedbabjxrb","version":""},"schema":"X�V��>q\u0001[�J�\b�.\u0011%rI�\bn\u0000�\u000b�\n�h:��"}
|
This plug item does not execute commands.
When I run 'node njstuya.js -ip 10.0.1.80 -id ebb3728730aad57411us9i -key 45ba5d9ceaecc76f ON’ get this response:
(node:15430) UnhandledPromiseRejectionWarning: TypeError: Cannot read property '1' of undefined
at TuyaDevice.runCommand (/home/walmer/js-node/node_modules/njstuya/njstuya.js:330:33)
at TuyaDevice.emit (events.js:198:13)
at TuyaDevice._packetHandler (/home/walmer/js-node/node_modules/tuyapi/index.js:492:10)
at packets.forEach.packet (/home/walmer/js-node/node_modules/tuyapi/index.js:385:43)
at Array.forEach (<anonymous>)
at Socket.client.on.data (/home/walmer/js-node/node_modules/tuyapi/index.js:381:19)
at Socket.emit (events.js:198:13)
at addChunk (_stream_readable.js:288:12)
at readableAddChunk (_stream_readable.js:269:11)
at Socket.Readable.push (_stream_readable.js:224:10)
(node:15430) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:15430) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Thanks for you work on this capability.
Richard Paul
On Dec 8, 2020, at 11:20 AM, RB Paul <rbpaul@me.com> wrote:
Sorry - I was able to work the issue with git and install njsTuya <https://github.com/unparagoned/njsTuya> without sudo in my home directory with warnings (below).
Running 'node node_modules/njstuya’ does identify the previously missing switches (see below). I will continue to see whether I can command them later and update you.
npm WARN npm npm does not support Node.js v10.21.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/ <https://nodejs.org/>
npm WARN deprecated request@2.88.2: request has been deprecated, see request/request#3142 <request/request#3142>
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (debug-js/debug#797 <debug-js/debug#797>)
npm WARN saveError ENOENT: no such file or directory, open '/home/walmer/js-node/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/home/walmer/js-node/package.json'
npm WARN js-node No description
npm WARN js-node No repository field.
npm WARN js-node No README data
npm WARN js-node No license field.
{"id":"ebb3728730aad57411us9i","broadcast":{"ip":"10.0.1.80","port":6668,"id":"ebb3728730aad57411us9i","gwID":"ebb3728730aad57411us9i","version":""},"schema":"�q�*P\u001b!4_�����t�w�\b&'����˷�?���"}
{"id":"ebb508bf95ccbedbabjxrb","broadcast":{"ip":"10.0.1.81","port":6668,"id":"ebb508bf95ccbedbabjxrb","gwID":"ebb508bf95ccbedbabjxrb","version":""},"schema":"X�V��>q\u0001[�J�\b�.\u0011%rI�\bn\u0000�\u000b�\n�h:��"}
On Dec 8, 2020, at 11:01 AM, RB Paul <rbpaul@me.com <mailto:rbpaul@me.com>> wrote:
I got chance to check it out with my new Debian machine. didn’t work - if you have some suggestions, please share.
When trying to install with 'sudo npm install unparagoned/njsTuya ’
debian returned:
npm WARN npm npm does not support Node.js v10.21.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/ <https://nodejs.org/>
npm ERR! code ENOGIT
npm ERR! Error while executing:
npm ERR! undefined ls-remote -h -t ssh://git@github.com/unparagoned/njsTuya.git <ssh://git@github.com/unparagoned/njsTuya.git>
npm ERR!
npm ERR! undefined
npm ERR! No git binary found in $PATH
npm ERR!
npm ERR! Failed using git.
npm ERR! Please check if you have git installed and in your PATH.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-12-08T16_56_03_609Z-debug.log
On Nov 9, 2020, at 11:52 AM, unparagoned <notifications@github.com <mailto:notifications@github.com>> wrote:
Can you try with the latest version
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#28 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAYJZNBQSDKQUCXZWCDCBH3SPAT4XANCNFSM4J3CBT6A>.
|
Can you make sure the app on the phone has been closed for a few hours and then run it in debug mode
|
'DEBUG=* node njstuya.js -ip 10.0.1.80 -id ebb3728730aad57411us9i -key 45ba5d9ceaecc76f ON’ returns:
njstuya booting njstuya +0ms
njstuya "{argName} value is: 10.0.1.80 +2ms
njstuya "{argName} value is: ebb3728730aad57411us9i +0ms
njstuya "{argName} value is: 45ba5d9ceaecc76f +0ms
njstuya api {} or undefined +1ms
TuyAPI Connecting to 10.0.1.80... +0ms
TuyAPI Socket connected. +274ms
njstuya Connected to device! +276ms
TuyAPI GET Payload: +1ms
TuyAPI { gwId: 'ebb3728730aad57411us9i',
TuyAPI devId: 'ebb3728730aad57411us9i',
TuyAPI t: '1607610863',
TuyAPI dps: {},
TuyAPI uid: 'ebb3728730aad57411us9i' } +0ms
TuyAPI Received data: 000055aa000000010000000a0000002c00000001c071ca2a501b21345fabb2adbea874c677930826278bab918fcbb7fd3ffbe9c018dfa88a0000aa55 +25ms
TuyAPI Parsed: +2ms
TuyAPI { payload: 'parse data error',
TuyAPI leftover: false,
TuyAPI commandByte: 10,
TuyAPI sequenceN: 1 } +0ms
njstuya runCommand has started with data "parse data error" +29ms
(node:30249) UnhandledPromiseRejectionWarning: TypeError: Cannot read property '1' of undefined
at TuyaDevice.runCommand (/home/walmer/switches-node/node_modules/njstuya/njstuya.js:330:33)
at TuyaDevice.emit (events.js:198:13)
at TuyaDevice._packetHandler (/home/walmer/switches-node/node_modules/tuyapi/index.js:492:10)
at packets.forEach.packet (/home/walmer/switches-node/node_modules/tuyapi/index.js:385:43)
at Array.forEach (<anonymous>)
at Socket.client.on.data (/home/walmer/switches-node/node_modules/tuyapi/index.js:381:19)
at Socket.emit (events.js:198:13)
at addChunk (_stream_readable.js:288:12)
at readableAddChunk (_stream_readable.js:269:11)
at Socket.Readable.push (_stream_readable.js:224:10)
(node:30249) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:30249) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
TuyAPI Disconnect +10s
njstuya undefined +10s
TuyAPI Socket closed: 10.0.1.80 +1ms
njstuya Disconnected from device. +0ms
'DEBUG=* node njstuya.js -ip 10.0.1.80 -id ebb3728730aad57411us9i -key 45ba5d9ceaecc76f’ returns
njstuya booting njstuya +0ms
njstuya "{argName} value is: 10.0.1.80 +2ms
njstuya "{argName} value is: ebb3728730aad57411us9i +0ms
njstuya "{argName} value is: 45ba5d9ceaecc76f +0ms
njstuya api {} or undefined +1ms
TuyAPI Connecting to 10.0.1.80... +0ms
TuyAPI Socket connected. +4ms
njstuya Connected to device! +6ms
TuyAPI GET Payload: +0ms
TuyAPI { gwId: 'ebb3728730aad57411us9i',
TuyAPI devId: 'ebb3728730aad57411us9i',
TuyAPI t: '1607610953',
TuyAPI dps: {},
TuyAPI uid: 'ebb3728730aad57411us9i' } +0ms
TuyAPI Received data: 000055aa000000010000000a0000002c00000001c071ca2a501b21345fabb2adbea874c677930826278bab918fcbb7fd3ffbe9c018dfa88a0000aa55 +21ms
TuyAPI Parsed: +2ms
TuyAPI { payload: 'parse data error',
TuyAPI leftover: false,
TuyAPI commandByte: 10,
TuyAPI sequenceN: 1 } +0ms
njstuya runCommand has started with data "parse data error" +23ms
(node:30313) UnhandledPromiseRejectionWarning: TypeError: Cannot read property '1' of undefined
at TuyaDevice.runCommand (/home/walmer/switches-node/node_modules/njstuya/njstuya.js:330:33)
at TuyaDevice.emit (events.js:198:13)
at TuyaDevice._packetHandler (/home/walmer/switches-node/node_modules/tuyapi/index.js:492:10)
at packets.forEach.packet (/home/walmer/switches-node/node_modules/tuyapi/index.js:385:43)
at Array.forEach (<anonymous>)
at Socket.client.on.data (/home/walmer/switches-node/node_modules/tuyapi/index.js:381:19)
at Socket.emit (events.js:198:13)
at addChunk (_stream_readable.js:288:12)
at readableAddChunk (_stream_readable.js:269:11)
at Socket.Readable.push (_stream_readable.js:224:10)
(node:30313) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:30313) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
TuyAPI Disconnect +10s
njstuya undefined +10s
TuyAPI Socket closed: 10.0.1.80 +1ms
njstuya Disconnected from device. +0ms
Hope this helps
|
I've updated njstuya to use the latest version of tuyapi, which may help. Also make sure you have all apps and other cloud connections like alexa disabled for an hour or so and try local mode again. But I think there may be some issues with the newer devices and local mode. I personally just use cloud mode for my newer devices. Edit: You might need to specify version 3.3, see below. |
Actually, try
|
Greetings, I have 2 smart bars (10.0.1.66 & .67) that work well with njstuya and 2 of two smart plugs that don’t seem to work (10.0.1.80 & .81) I have run the commands you provided and the return output is below. Thanks again, I don’t really have much use for these smart plugs, and I could send you one if you think it might be helpful to your purposes. Let me know. DEBUG= node njstuya.js -ip 10.0.1.80 -id ebb3728730aad57411us9i -key 45ba5d9ceaecc76f -v 3.3* njstuya booting njstuya +0ms DEBUG= node njstuya.js* njstuya booting njstuya +0ms |
It seems like -v 3.3 kind of works, see if you can turn it on or off. njsTuya may just need to work on dealing with the responses better.
|
Command had no affect on the plugs setting - DEBUG=* node njstuya.js -ip 10.0.1.80 -id ebb3728730aad57411us9i -key 45ba5d9ceaecc76f -v 3.3 ON njstuya booting njstuya +0ms |
It might be useful to see the content of You could also try turning it on using a different dps, try dps 2-6.
Alternatively, give https://github.com/TuyaAPI/cli a try, if you can get it working there then there might be something I can do. |
Greetings from Alabama. Let me thank you for addressing this issue I found in these particular plugs. I also want to assure you that I have no expectation there is anything more you might need do for me. I will be pleased to try the suggestions you forward and will share the results —but only to return the benefit (it is small compared to the benefit I have enjoyed using your work). I do not expect to deploy any fix you may devise. I am resolved to move away from this plug technology toward something more suited to an old man in Alabama; meaning it will be a while before I muster the time and attention to try the tuyaAPI-CLI alternative. DEBUG=* node njstuya.js -ip 10.0.1.80 -id ebb3728730aad57411us9i -key 45ba5d9ceaecc76f -v 3.3 OFF njstuya booting njstuya +0ms DEBUG=* node njstuya.js -ip 10.0.1.80 -id ebb3728730aad57411us9i -key 45ba5d9ceaecc76f -v 3.3 -set '{ "dps": 2, "set": true }' njstuya booting njstuya +0ms |
Sorry, it's a bit too difficult to debug it like this. I'd suggest giving cloud mode a try. |
Greetings,
When I run ‘node node_modules/njstuya’ the returned devices are only my two Smart Power Strips. I also have four WiFi Smart Plugs WiFi Smart plugs with Energy Monitoring from Amazon:
https://www.amazon.com/gp/product/B07SGP1BCY/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1
They work great with the Smart Life app and with IFTTT but they don’t appear as devices with the command above. They showed up as “ThinkTurn_#### on my router. And Smart Life shows them as running Firmware 1.4.1 (with no update available) whereas the Power Strips show firmware 1.0.4 (with no update available).
Any recommendations or help would be appreciated.
The text was updated successfully, but these errors were encountered: