Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON commands don't seem to work #99

Open
aggillator opened this issue Jan 30, 2022 · 3 comments
Open

JSON commands don't seem to work #99

aggillator opened this issue Jan 30, 2022 · 3 comments

Comments

@aggillator
Copy link

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
Copy link

Put the whole json string in single quotes like this:

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

That worked for me.

@NRollo
Copy link

NRollo commented Sep 12, 2022

@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
Copy link
Author

aggillator commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants