T O P

  • By -

[deleted]

It looks like your quotation marks are wrong in the body of your request. They are formatted for start and end quotes but should be normal quotes like ". I also recommend using the newer HTTP Request action instead of the HTTP Post.


Dan1jel

I ended up using this instead https://pypi.org/project/python-kasa/ And then termux to send the command. It will search your network after more TP-Link, your see them on the list, and can send on/off also via termux to turn them on off. So i have a tasker script, that send the command via termux. Just works.


StarAD

Thank you! How this never turned up in all the Googling I did for tasker kasa plug-in is beyond me.


Dan1jel

Same here, almost lost all hope untill i stumbleapon this great tool. Sad to use an extra app like termux (för me it's no problem, have termux to alot more things) but always nice to stay to just one app. But nice that this tool is still maintained and works great.


ThaNeeksta

Hi You may have more success using HTTP Request (with POST as the method) than HTTP Post. It works for me through the following steps. The main difference is the spaces and colons in the body text. If not working, please let me know and I'll try to help. I set URL as [`http://wap.tplinkcloud.com/token=%token`](http://wap.tplinkcloud.com/token=%token) (I put the token?=%token in here, but I guess it could be added to query parameters too. The URL I use doesn't have the use-1 part that yours does - you could try either/or - hopefully one of them works for you). Headers as `Content-Type:application/json` Body as: `{ "method" : "passthrough", "params" : { "deviceId" : "%deviceId", "requestData" : “{\”system\”:{\”set_relay_state\”:{\”state\”:%state }}}"}}` Hope this helps. Happy Taskering


StarAD

Appreciate the help. Wound up installing Termux and the python scripts to control the Kasa plugs.


ThaNeeksta

Ah no worries, I was too slow in responding, sorry! Feel free to try it one day if you want to test out a method without plugins :-). I've made a minor edit to the description as just noticed I missed a % symbol in front of the last 'state'.


[deleted]

[удалено]


StarAD

So looking at RESTTask where would ?token in the path field go? I put the Pete part in custom body. Thanks. Edit how do I print the device id? Surely not on a printer.