I’d rather not have to make the Alexa command complicated. I’m not the only one at home and I would need to teach them and the extra complication would just frustrate them. I have enough trouble with controlling multiple Lifx bulbs myself and half of the time I forget to say “tell Life X to turn off the bedroom lights”.
It would only be as complicated as the name you pick for the outlet. If you were to name it “Nightstand light”, for example, the command would be as simple as “Alexa, turn off the nightstand light”. Not sure what would make it more complicated than that, unless you’re using the Ask Alexa smartapp, which is not necessary to just turn things on and off.
Regarding CoRE, this is the post, he just said he made one and it was working, didn’t give an example.
I suppose you are right. I was extrapolating based on other smart devices that have multiple registered names with Alexa smart home devices such as Lifx or even Hue that trigger differently depending if you use the “tell…” command. In those cases the same device is registered multiple times under the same name but are invoked with differently with the tell command. There is no reason why the TP-Link smart plug’s name in Kasa has to be the same in Smartthings. I’ll just make them different and that way Alexa will use Smartthings to execute the command.
I’m running into issues on step 4 with using “npm install”. cmd returns an error saying " ‘npm’ is not recognized as an internal or external command, operable program, or batch file". I’m not sure if the computer needs to be restarted after installing nodejs, or if there is some other step to get this to be a workable command. Searching on google didn’t give real interpretable helps.
Thanks for the prompt response. I did download the 64 bit version is that makes any difference. I’ve gone back and tried it with node.exe also running. It didn’t make a difference, nor did trying “npm -v”.
Try this, pulled from the link below. There are some comments on variations of this, so give the link a read too…
Open the Control Panel (Click the Start button, then click Control Panel)
Click User Accounts
Click Change my environment variables
Select PATH and click the Edit… button
At the end of the Variable value, add ;C:\Program Files\nodejs
Click Ok on the “Edit User Variable” window, then click Ok on the “Environment Variables” window
Start a command prompt window (Start button, then type cmd into the search and hit enter)
At the prompt (C:>) type npm and hit enter; you should now see some help text (Usage: npm etc.) rather than “npm is not recognized…”
If it doesn’t work immediately, try rebooting and typing again. Hopefully this works…
It looks like my issue stemmed from downloading the binary (.exe) instead of the installer (.msi). Once I downloaded and installed the .msi, I saw the npm package in the installation process. Running cmd after that worked as it was supposed to. It might be worth updating the instructions with that little detail, although I recognize I should have known better. The HS100 controller is now running. I’m not home (did this remotely), so haven’t been able to check whether the whole thing is working yet.
My only other questions are:
Does this also work with the HS200 switches from TP-Link?
Would it be helpful to point out in the instructions that the IP address can be deduced from the mac address of each outlet in the Kasa app & lining it up with the IP address shown in your router configuration page?
You may need to use cmd /c or cmd /k or even the start command. One of these may work. I’m just throwing out generic ways of launching processes at startup.
I have finished setting this up on a stick PC running Windows 10 Home Edition. The stick starts and runs the application without keyboard, mouse, or monitor. Below are steps I did to set this up (above and beyond the steps above to install the SmartThings app).
Prerequisites
a. Windows 10 PC on WiFi and Windows 10 (either home or professional)
b. Router that allows you to reserve IP addresses (mine is a TP-Link Archer C-3150).
Steps:
a. Create *.bat (batch) file containing the below commands, using your path in the CD command.
cd c:\Program Files\nodejs\0 TP-Link
node hs100.js
b. Load this file into your windows startup directory.
c. Set Windows to automatically Log you in
(see site https://www.cnet.com/how-to/automatically-log-in-to-your-windows-10-pc)
d. Go to the power setting and set PC to NEVER go into standby.
e. In your router Reserve an IP address for your PC and your controlled TP-Link devices.
f. Restart your router. Wait for the reboot to complete.
g. Reboot your PC. It should automatically run the node app. (You can now disconnect /power off monitor, mouse, and keyboard.)
h. Go to the SmartThings App and update your TP-Link device setting to the new IP addresses (for the devices and server).
Current Status: Two open items.
a. On power failure, I will have to press power button to restart. I will check Bios to see if there is a start on power function. Complete. Works seamlessly. Takes about three minutes to be up and running again.
b. Still waiting a windows update. I think it will restart automatically since I am auto loggin in; however, we will see.
Since you only have a single TP-LInk outlet, a more cost effective solution would be to buy a Samsung (~$40) or WeMo (~$40). There are also some z-wave/zigbee devices, but i would verify that they work first. Then sell your TP-Link.
I’ve withdrawn my post incase anyone ventured into my repo, it isn’t ready yet as it turned into a full rewrite of the node gateway and device handler (feel free to browse history, it tells a frustrating story). Plus the addition of a smart app!
For simple on / off for a HS100/HS110 the original code works great but to get realiable power monitoring with the smartthings eco system for the HS110 I had to start from scratch.
Apologies for jumping the gun, I’m sure anyone who has attempted to develop for the smartthings platform can testify what a love hate relationship it is and I’ve learned so much in just three weeks. I hope to have this ready to go in beta by the end of next week - as in I’ll be using it and anyone may fork / checkout.
I’d also like to comment that TP Link sockets are great, the range and reliability over range is far superior to the wemo sockets which are officially supported. They are more solidly built and while I don’t have the spec sheet to hand believe they will safely switch a higher load than the Samsung on paper.
For now please DO NOT USE MY CODE the repo version is incomplete.
Does anyone have any insight on how to integrate this with Smartthings Node Proxy?
I posted yesterday about this but I think it was in the wrong thread. Thanks.