Hi all,
I'm trying to control a tp-link electrical socket from the command line...
By now I've done interesting progresses, being able to get the plug id...
Now I'd like to go a step further and activate or deactivate it.
In order to do that I've followed an Internet page that explains how to do it from Linux... And I would like to do it from Windows 10.
If I get this to work I'll make a small article/tip here at CP to explain the steps, which by now have been very easy...
The original linux script would be:
curl --request POST "https://eu-wap.tplinkcloud.com/?token=74adcc7e-64f7-47c1-a751-dece6d2f4704 \
--data '{"method":"passthrough", "params": {"deviceId": "80067AC4FDBD41C54C55896BFA28EAD38A87A5A4", "requestData": "{\"system\":{\"set_relay_state\":{\"state\":1}}}" }}' \
--header "Content-Type: application/json"
From the windows 10 CMD, I've written what I think would be the right translation, but it fails:
curl -X POST -H "Content-Type: application/json" -d "{ \"method\" : \"passthrough\", \"params\" : { \"deviceId\" : \"80067AC4FDBD41C54C55896BFA28EAD38A87A5A4\", \"requestData\" : { \"system\" : { \"set_relay_state\" : { \"state\" : 1 }}}}}" https:
It returns
{"error_code":-10100,"msg":"JSON format error"}
Note: the DeviceId and token used are the same ones used in the original web page.
As an example, one curl call (used to get the devices in the network) that works:
curl -X POST -H "Content-Type: application/json" -d "{ \"method\" : \"getDeviceList\" }" https:
Can you see something wrong here?
Thank you very much.
What I have tried:
Moved quotes, escaped quotes (I've got 2 curl calls to work and tried to emulate them here)...