subzero79 / node-red-contrib-tuya-local

NodeRED node to control tuya devices locally. Based on tuyapi module
29 stars 17 forks source link

Dude you module is not even in NPM? #27

Open dachshund-digital opened 4 years ago

dachshund-digital commented 4 years ago

Dude you module is not even in NPM?

$ npm install node-red-contrib-tuya-local npm ERR! code E404 npm ERR! 404 Not Found - GET https://registry.npmjs.org/node-red-contrib-tuya-local - Not found npm ERR! 404 npm ERR! 404 'node-red-contrib-tuya-local@latest' is not in the npm registry. npm ERR! 404 You should bug the author to publish it (or use the name yourself!) npm ERR! 404 npm ERR! 404 Note that you can also install from a npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in: npm ERR! /home/pi/.npm/_logs/2020-07-23T19_16_59_027Z-debug.log

WHAT THE HELL? Come on!

subzero79 commented 4 years ago

I have to check the latest nodered images. npm install works if git is installed.

Don’t need to speak like that.

subzero79 commented 4 years ago

And is

npm install subzero79/node-red-contrib-tuya-local

BLDanielsJr commented 4 years ago

I have done this npm install in the ~/.node-red directory on my rpi but I still do not see the node available in palette manager in node-red. any suggestions on what I need to do to make this available.

subzero79 commented 4 years ago

If the install went ok without errors you should restart the nodered instance.

I just tested it node-red latest in docker and it shows on the sidebar. I didn't test connection or status because i have no longer a tuya device

BLDanielsJr commented 4 years ago

Thank you. Yes, I just did an update of Node-Red and now see this node in the palette.

Does this interface require the tuya devices to be converted to local with a local key? If so do you recommend doing that conversion?

I am trying to get started with this stuff to move my brewery control to node-red and I am looking for the best switch technology to use. This Tuya stuff sounds good but it does seem to be in great flux and very difficult to find all of the auth keys required. What do you recommend for the best smart technology that is straight forward to use with node-red?

Thanks for your help.

subzero79 commented 4 years ago

The key is always there, communication with this node is always local. The fw allows only one connection at a time, so if you use your mobile at the same time it might not work.

The best you can do is wipe the fw, and install esphome. Use home assistant as automation backend. Esphome is heavily integrated with homeassisant. From there you can install the nodered ha websocket node and do all sort of complex automation.

This node was created as a workaround to the lockdown OTA firmware change imposed in tuya FW in early 2019. Now that restriction has been hacked and is now possible to replace tuya fw with whatever, tasmota etc. just search tuya convert.

That's why this node hasn't received any updates and i don't have more hw to test as my switches are all flashed with esphome

BLDanielsJr commented 4 years ago

Thank you for the help and guidance. I am just getting started with this and want to head in a direction that has great support and growth. I am going to head in the esphome and home assistant direction and see if I can get that to work.

Thanks again!!

dachshund-digital commented 4 years ago

@subzero79 Once I got the module installed, I got my tuya smart plugs working. I used the tuya web site, created developer account, used the tuya CLI to get the device ids, and device keys. Once that was done, all my smart plugs now visible in NR. Glad your module worked, I tried both of the older modules, and neither of them would connect. Apparently they were so old, the recent changes to the tuya API have broken them. Only your module seems to actually work in NR.