Comments for IT Nerd Space http://itnerd.space Blog about Cloud, Automation, Android, Smart things... Thu, 27 Jul 2017 22:01:00 +0000 hourly 1 https://wordpress.org/?v=4.7.5 Comment on How to control your TP-Link HS100 smartplug from Internet by Alexandre Dumont http://itnerd.space/2017/01/22/how-to-control-your-tp-link-hs100-smartplug-from-internet/#comment-223 Thu, 27 Jul 2017 22:01:00 +0000 http://itnerd.space/?p=190#comment-223 I’ve been working on that and a new cool stuff. Not yet ready enough to be published, but here’s a tease: it works, and no more TOKEN hassle!
More on what’s coming here: http://itnerd.space/2017/07/27/looking-back-and-forward-coming-soon-to-this-blog/

]]>
Comment on How to authenticate to TP-Link cloud API by Richard Nardone http://itnerd.space/2017/06/19/how-to-authenticate-to-tp-link-cloud-api/#comment-222 Tue, 25 Jul 2017 11:50:00 +0000 http://itnerd.space/?p=345#comment-222 The issue was using ajax shorthand ($.post). With shorthand you can’t specify the content-type. The “json” at the end of the code just specifies how you want the data result formatted (Accept Header). Once I updated the code to the following I was able to specify the content-type and retrieve the token without error:

$.ajax({
type: ‘POST’,
contentType: “application/json”,
url: myURL,
data: myData,
dataType: “json”,
success: function(data, status) {
$(‘#result-data’).append(JSON.stringify(data));
$(‘#result-status’).append(status);
$(‘#result-token’).append(data.result.token);
}
});

My new result is:
{“error_code”:0,”result”:{“regTime”:”2016-10-23 23:45:58″,”email”:”email.address@gmail.com”,”token”:”00xxx111-x1234b45cd6e7fghij89k0l”}}

My “Success” data is being appended to DIV layers for testing purposes:

]]>
Comment on How to authenticate to TP-Link cloud API by Alexandre Dumont http://itnerd.space/2017/06/19/how-to-authenticate-to-tp-link-cloud-api/#comment-221 Tue, 25 Jul 2017 05:23:00 +0000 http://itnerd.space/?p=345#comment-221 Try to force the header ‘Content-Type: application/json’, and remove the “json” you specified.

]]>
Comment on How to authenticate to TP-Link cloud API by Richard Nardone http://itnerd.space/2017/06/19/how-to-authenticate-to-tp-link-cloud-api/#comment-220 Mon, 24 Jul 2017 23:28:00 +0000 http://itnerd.space/?p=345#comment-220 I created a script to get my token but I keep getting a format error.

Code:
$.post(“https://use1-wap.tplinkcloud.com”,
{
method: “login”,
params: {
appType: “Kasa_Android”,
cloudUserName: “email.address@gmail.com”,
cloudPassword: “SimplePasswordLettersandNumbers”,
terminalUUID: “b6085622-86e0-4940-8fd3-4b60862de994”
}
},
function(data,status) {
$(‘#result-data’).append(JSON.stringify(data));
$(‘#result-status’).append(status);
}, “json” );

The above code returns error:
{“error_code”:-10100,”msg”:”JSON format error”}

Anyone know what I’m doing wrong?

]]>
Comment on How to control your TP-Link HS100 smartplug from Internet by JeremyH http://itnerd.space/2017/01/22/how-to-control-your-tp-link-hs100-smartplug-from-internet/#comment-219 Sat, 22 Jul 2017 06:23:00 +0000 http://itnerd.space/?p=190#comment-219 PS – as per an earlier post I have found that my token expires and I need to discover the new one, and then that will need embedding to replace the old in each applet again – easy but a bit of a pain, would be happy if anyone has a solution.

]]>
Comment on How to control your TP-Link HS100 smartplug from Internet by JeremyH http://itnerd.space/2017/01/22/how-to-control-your-tp-link-hs100-smartplug-from-internet/#comment-218 Sat, 22 Jul 2017 06:22:00 +0000 http://itnerd.space/?p=190#comment-218 Yes works well, and doesn’t need any programming skills, I just had to populate the .env file and create a webhooks routine applet for each task. For example create an applet that would turn off kitchen lights, same for kitchen plugs etc, then list these in the .env. Very easy once I’d figured out how to make the instructions work, plus learnt much more about the webhooks service which will help with another challenge I have set myself – I want to remotely control my ageing home burglar alarm via webcalls and an arduino interface … getting there slowly in small steps at present.

]]>
Comment on How to control your TP-Link HS100 smartplug from Internet by Alexandre Dumont http://itnerd.space/2017/01/22/how-to-control-your-tp-link-hs100-smartplug-from-internet/#comment-217 Fri, 21 Jul 2017 22:06:00 +0000 http://itnerd.space/?p=190#comment-217 Nice Jeremy! I didn’t know this service. It will definitely help all, as one can recreate like a scene and trigger it with one webhook call in Maker. What I didn’t know was the approach they took in Glitch, to trigger IFTTT applets. I was looking into an alternative to Glitch, Webtasks, also free. I’ll try to write up an article about another alternative I know, which might be easier for non programmers, and still do all the steps (including logging in, retrieving the token,…). I only need time to write it…

]]>
Comment on How to control your TP-Link HS100 smartplug from Internet by JeremyH http://itnerd.space/2017/01/22/how-to-control-your-tp-link-hs100-smartplug-from-internet/#comment-216 Fri, 21 Jul 2017 21:40:00 +0000 http://itnerd.space/?p=190#comment-216 I’ve found a fix:
https://medium.com/glitch/how-to-trigger-multiple-applets-in-ifttt-5877860a76af

]]>
Comment on How to control your TP-Link HS100 smartplug from Internet by JeremyH http://itnerd.space/2017/01/22/how-to-control-your-tp-link-hs100-smartplug-from-internet/#comment-215 Fri, 21 Jul 2017 21:39:00 +0000 http://itnerd.space/?p=190#comment-215 I’ve found a fix:
https://medium.com/glitch/how-to-trigger-multiple-applets-in-ifttt-5877860a76af
works great , would be even better if I could work a timer in. so far I can turn on one night and turn off everything else, but would like to have a timer to turn that light off too after 2 mins or something.

]]>
Comment on How to control your TP-Link HS100 smartplug from Internet by Alexandre Dumont http://itnerd.space/2017/01/22/how-to-control-your-tp-link-hs100-smartplug-from-internet/#comment-214 Fri, 21 Jul 2017 19:25:00 +0000 http://itnerd.space/?p=190#comment-214 It does say you need follow the following steps:

Authenticate to TP-Link cloud API and get a token

http://itnerd.space/2017/06/19/how-to-authenticate-to-tp-link-cloud-api/

]]>