softScheck / tplink-smartplug

TP-Link WiFi SmartPlug Client and Wireshark Dissector
Apache License 2.0
1.14k stars 295 forks source link

JSON commands don't seem to work #99

Open aggillator opened 2 years ago

aggillator commented 2 years ago

I try doing a json command using the -j format but all I get back is a message saying it was sent, but under received, there is nothing listed. The command I would use is this [python3 ./tplink_smartplug.py -t 192.168.0.108 -j {"emeter":{"erase_emeter_stat":{}}}] for example, and all I receive is this [Sent: {emeter:{erase_emeter_stat:{}}} Received: {}].

Any advice?

Thanks

bambinetto commented 2 years ago

Put the whole json string in single quotes like this:

Erase All EMeter Statistics '{"emeter":{"erase_emeter_stat":null}}'

That worked for me.

NRollo commented 2 years ago

@aggillator I had the same issue as you (windows platform) and I found that I need to change the quotes to triple quotes, e.g., like this: tplink_smartplug.py -t 192.168.0.7 -j {"""system""":{"""set_relay_state""":{"""state""":1}}}

aggillator commented 2 years ago

Thanks for your tips. Now that I found the “Watt” app, can do it through there. Game-changer.

On Mon, Sep 12, 2022 at 7:26 AM NRollo @.***> wrote:

@aggillator https://github.com/aggillator I had the same issue as you (windows platform) and I found that I need to change the quotes to triple quotes, e.g., like this: tplink_smartplug.py -t 192.168.0.7 -j {"""system""":{"""set_relay_state""":{"""state""":1}}}

— Reply to this email directly, view it on GitHub https://github.com/softScheck/tplink-smartplug/issues/99#issuecomment-1243600499, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWBW75S7DDU4ZPY3E7PJMUDV54HPZANCNFSM5NDRQ23A . You are receiving this because you were mentioned.Message ID: @.***>