manexim / home

Control your smart home gadgets - Designed for elementary OS
https://elementary.io/
GNU General Public License v3.0
9 stars 7 forks source link

Support Feit smart bulbs #24

Open cassidyjames opened 4 years ago

cassidyjames commented 4 years ago

I have a couple of LIFX bulbs, but a ton of Feit smart bulbs from Costco. They're much cheaper than LIFX and while they're not as vibrant, they are supported in Google Home and Alexa with the same interface as LIFX or Hue. It would be awesome to be able to control them from my desktop, too!

@meisenzahl, if you don't have access to Feit bulbs, I can send you some as a gift. Shoot me an email and I can hook you up. :wink:

meisenzahl commented 4 years ago

Apparently the Feit smart bulbs are based on the Tuya platform. So I bought a compatible smart bulb and try to integrate it now.

meisenzahl commented 4 years ago

My current research has shown that Tuya based lamps are difficult to integrate. I would prefer it if Home would work completely without cloud dependencies. But connecting Tuya based smart bulbs via the local network doesn't seem to be really user-friendly.

The local control protocol was reverse engineered by @codetheweb. (codetheweb/tuyapi) To control smart bulbs locally, however, many manual steps are necessary:

  1. Add any devices you want to use with tuyapi to the Tuya Smart app.
  2. Install the CLI tool by running npm i @tuyapi/cli -g. If it returns an error, you may need to prefix the command with sudo. (Tip: using sudo to install global packages is not considered best practice. See this NPM article for some help.)
  3. Install AnyProxy by running npm i anyproxy -g. Then run anyproxy-ca.
  4. Run tuya-cli list-app. It will print out a QR code; scan it with your phone and install the root certificate. After installation, trust the installed root certificate.
  5. Configure the proxy on your phone with the parameters provided in the console.
  6. Enable full trust of certificate by going to Settings > General > About > Certificate Trust Settings
  7. Open Tuya Smart and refresh the list of devices by "pulling down".
  8. A list of ID and key pairs should appear in the console.
  9. It's recommended to untrust the root certificate after you're done for security purposes.

I will continue to investigate the possibility of implementing a local connection even more user-friendly.

codetheweb commented 4 years ago

Got mentioned and decided to check this project out, it looks really cool.

You're correct @meisenzahl, getting local control to work is a bit of a chore. I'm not sure how opposed you are to cloud control, but Tuya created an API for Home Assistant that's very easy to use.