[SOLVED] Adding support for Feit WiFi LED bulbs from Costco

I actually intended to in my original post, but I forgot.

George,

Am I stuck using HomeKit and HomeBridge? I am currently only using OpenHAB and have neither of the others installed.

Thanks,

Todd

No. I don’t use homebridge at all, either. You will however, need Node-RED installed to use this method. I happen to have it installed already to expose my openhab items to HomeKit more flexibly than the HomeKit binding. If you don’t have any use for HomeKit, just ignore those elements above.

Cool. Thanks! I’ll try it when I get home.

Hi Robert,
I tried to implement your process, but I haven’t been able to figure it out. I am running OpenHAB on a headless RPi3+ without a graphical interface. I’m not sure how to run Node Red on such a system. I access it with my workstation, which is a Linux system.
Also, I haven’t figured out where to put the Node Red files that you posted.
In other words, I am at a complete loss. Can you help?

Thanks,

Todd

If you are running openHABian, use the setup tool to install node-red.
If not: https://nodered.org/docs/hardware/raspberrypi

NodeRed is installed.

Good. Spend some time with it. Play around.
In the menu, manage pallete, you can install more nodes.
I recommend the following
node-red-contrib-bigtimer
node-red-contrib-openhab2
node-red-contrib-ramp-thermostat

As a starting point
There are many nodes available for many technologies (A bit like bindings…)

My issue is how do I run it? I’m running a headless Openhabian without the GUI, and I access it from a Linux system (ssh). Do I run it from the Linux system? I’m lost here…

You run it as a service as is described in the installation instructions autostart at boot. You access the interface through a web browser.

1 Like

OK, I got Node Red running. In proceeding with the instructions to instruction iv:


    On Linux, do the following:

    sudo mkdir /usr/share/ca-certificates/extra/
    sudo cp $HOME/.anyproxy/certificates/rootCA.crt /usr/share/ca-certificates/extra/
    sudo dpkg-reconfigure ca-certificates

    The last command will open up a GUI; hit yes on the first prompt. Using the arrows on your keyboard, locate extra/rootCA.crt, place an * next to it by hitting the space bar, hit the Tab key on your keyboard to highlight OK, and press the Enter key.


(I removed the Windows and Mac OS commands, for brevity,  because I'm running a Linux system)


iv. Execute tuya-cli list-app. Within a few seconds, you would be shown (a) a QR code and (b) details of the proxy server.

v. Scan the barcode with your iPhone. If you don't know how to do that, just say "Hey Siri, scan a QR code!" and point the camera at the barcode.

vi. Your phone will ask you your permission to open Safari; let it.

I get this error every time:

[19:34:42] openhabian@openHABianPi:/usr/bin$ tuya-cli list-app
(node:13495) UnhandledPromiseRejectionWarning: RangeError: Array buffer allocation failed
    at new ArrayBuffer (<anonymous>)
    at Object.<anonymous> (/usr/lib/node_modules/anyproxy/node_modules/brotli/build/encode.js:21:207)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/usr/lib/node_modules/anyproxy/node_modules/brotli/compress.js:1:76)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
(node:13495) 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:13495) [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.

It won’t show the QR code so I can set up the proxy server
What a frustrating process…

Sorry Robert, but I was unable to make the instructions work. The AMoo-Miki/ homebridge-tuya-lan instructions gave me errors (see above).
When I ran this command I got the following errors:

npm WARN saveError ENOENT: no such file or directory, open '/home/openhabian/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/openhabian/package.json'
npm WARN openhabian No description
npm WARN openhabian No repository field.
npm WARN openhabian No README data
npm WARN openhabian No license field.

+ tuyapi@3.2.2
added 11 packages from 16 contributors and audited 11 packages in 18.755s
found 0 vulnerabilities

When I run this command I get:

(node:9222) UnhandledPromiseRejectionWarning: RangeError: Array buffer allocation failed
    at new ArrayBuffer (<anonymous>)
    at Object.<anonymous> (/usr/lib/node_modules/anyproxy/node_modules/brotli/build/encode.js:21:207)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/usr/lib/node_modules/anyproxy/node_modules/brotli/compress.js:1:76)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
(node:9222) 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:9222) [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.

And the command freezes and I have to enter ^C to get the system back.
I haven’t been able to figure out the tuya-cli get --id or the tuya-cli get --key commands.
If I run tuya-cli list, I get {}

error: option `--id <id>' argument missing
[19:46:51] openhabian@openHABianPi:~$ tuya-cli list
{}

Without being able to run the tuya-cli commands I can’t get the ID or Key, nor do I get the QR code so I can set up the reverse proxy.
This isn’t working…

Just to let you all know, this is NOT SOLVED. The procedures that are listed didn’t work for me and my light bulbs are still NOT accessable through OpenHAB.

Thank you.

7/2/2020: It’s been a year and still no change.

There are a few different methods for connecting Tuya devices to openHAB. Personally, I favour flashing them with Tasmota firmware using Tuya-convert.

1 Like

Hi Russ,

That appears to be for plugs. I looked at the device list and didn’t see bulbs anywhere. Is the process the same for light bulbs?

Thanks,

Todd

You have to look at the Tasmota templates.

1 Like

Awesome! Thanks. I didn’t notice the list on the left. As soon as I get my system functional again I will do some testing. I have 2 bulbs and I’d like to get them functioning through OH.

Just as a follow up… I reflashed my bulbs with Tasmota. I have been playing with them off and on for awhile. They work to an extent, but I am still trying to figure out the commands, especially now that Openhab 3.1 is out. I’ve made some progress, but MQTT is a PITA. I got a lot of help here because the documentation was bad. At any rate, they are sort of working, but I’m still working on it. The reflash option is definitely the best way to go, at least for me. Thanks Russ for the reflash idea.

Note that Tuya has made changes to both their hardware and firmware, which makes flashing Tasmota much more difficult on new devices. If the device still has an ESP8266 then you can do it by connecting wires to the chip, but Tuya-Convert no longer works in most cases.

Personally, I’m not planning to buy any more Tuya devices. TP-Link Kasas are typically priced about the same and work directly with openHAB.

I bought these a couple of years ago and was able to flash them with no problem. At this point, I’m just trying to finalize my configuration so the commands work properly. Lots of trial and error. One of the bulbs is the main light in my bedroom, so as long as I can at least turn it off/on by vocal command, I’m good. It’s just getting the colors and dimming to work. And, of course, OH3 changed everything, so it feels like I’m starting over. And since I didn’t really have a good grasp of MQTT to begin with, it feels like I’m starting over. More research… :upside_down_face: It’s improving…

I agree with not getting any more of the bulbs. Actually, I’ve decided to stay away from Feit altogether. We bought some plugs (6-pack) from Costco, and they don’t work with OH. Haven’t looked into reflashing them. Since they are relatively new, I’d probably run into the flashing issue you mentioned, and I’m not looking for another headache. I just use their app for those. When I get the bulbs working correctly, I MAY look into the plugs???

Thank you again for all your help. It has relieved my stress levels a bit. I appreciate it.

1 Like