I keep forgetting the syntax for these two things, so there’s a chance writing it here will help me remember.
I have a TP-Link HS110 plug (probably identical to the HS100 … but I thought being able to query it through the app to find out energy usage would be neat …).
Anyway, it originally didn’t seem to let me schedule it through the app, so I dug around and wrote a crap shell script I can prod via cron.
1. tplink.sh -u firstname.lastname@example.org -p mypassword -o off -> turns the first device found off.
2. tplink.sh -u email@example.com -p mypassword -o on -> turns the first device found on.
3. tplink.sh -u firstname.lastname@example.org -p mypassword -d TpLinkDeviceId -o on -> now for a specific device.
4. tplink.sh -u …. -p …. -d “?” -> dumps device list output …
5. tplink.sh -t tpLinktoken -d DeviceId -o on|off …
Some alternative bash things…. ( avoiding unneecessary use of cat / awk / grep …. )