Project CE Cloud Lighting Part 2 - Working with Kasa Cloud

I thought about creating a whole thing about creating the account and registering the TP-Link light to Kasa but this video belows goes through the app and the lights pretty well.

Okay, this was a little long winded but covered the basics. Once you get your lights registered  it should look like the Kasa app pictures below.

Now, on to the more important stuff like how are we going to interact with the bulb. You can directly access the bulb but we are going to access the bulb through the Kasa Cloud. Using the kasa_control nodejs library we are going to access the Kasa cloud and send commands to adjust our light. This assumes you have downloaded the Kasa app, created your account and registered your bulb. Below is some code to get the ID of your bulb. If your like me and have multiple bulbs registered you may have to search through the output to find the correct bulb.


The output from our node script should be something similar to:
{ fwVer: '1.8.6 Build 180809 Rel.091659',
    deviceName: 'Smart Wi-Fi LED Bulb with Dimmable Light',
    status: 1,
    alias: 'Office',
    deviceType: 'IOT.SMARTBULB',
    appServerUrl: '',
    deviceModel: 'LB100(US)',
    deviceMac: 'deleted',
    role: 0,
    isSameRegion: true,
    hwId: 'deleted',
    fwId: '00000000000000000000000000000000',
    oemId: '264E4E97B2D2B086F289AC1F00B90679',
    deviceId: '8012221C6DAD0B255555555555555558',
    deviceHwVer: '1.0' },
The "deviceId" is what we are looking for. We can now plug this into our code so we can control our light. Next up we can start building our Touch UI and construct the code to finish off our project.


1 comment:

Note: Only a member of this blog may post a comment.