konsumer / tplink-lightbulb

Control TP-Link smart lightbulbs from nodejs
MIT License
190 stars 32 forks source link

Can you build an android version? #38

Closed lexterror closed 5 years ago

lexterror commented 5 years ago

I wanted to know whether you could build an android version.

Thank you.

konsumer commented 5 years ago

No, that is outside the scope of this project.

I have found that it's a bit easier on other platforms that have basic HTTP (like microcontrollers and stuff) to use the kasa protocol instead of hitting the bulbs directly with UDP packets. It works over the internet (not just your LAN where the bulbs are located) and would work better overall with android, I think.

If you want to write an android lib, check out kasa_control. It's also written in node, but uses simple HTTP requests, so it should be fairly trivial to port. Implement the kasa method then all the others should be pretty simple (send JSON, get JSON responses.)

You can use this lib as a reference for message formats (to use in your version of send) for messages that aren't built in kasa_control.

Your process will probably be similar to this:

You can find example msg objects here.