Skip to content

Instantly share code, notes, and snippets.

@urbanskimichal
Created February 17, 2022 21:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save urbanskimichal/07999f413c28c391f0cefbe6d331452b to your computer and use it in GitHub Desktop.
Save urbanskimichal/07999f413c28c391f0cefbe6d331452b to your computer and use it in GitHub Desktop.
#!/bin/bash
# Periodically send Toggle command to s26 wifi plug (Tasmota / Sonoff).
# The first argument is an IP address of the plug.
# Command is based on Tasmota documentation.
IP=$1
echo "s26 plug test"
echo "IP: $IP"
for i in {0..50}
do
echo
date
echo "Request #$i:"
curl -w '\nResponse time: %{time_total}s\n' "http://$IP/cm?cmnd=Power%20Toggle"
sleep 2
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment