A linux command line example based on https://github.com/OpenWonderLabs/SwitchBotAPI
token=''
secret=''
switchbot_get(){
nonce=$(uuidgen -r)
t=$(date +%s)000
data=${token}${t}${nonce}
sign=$(echo -n "$data" | openssl dgst -sha256 -hmac "$secret" -binary | base64 -w0)
curl -s -X GET -H "Content-Type:application/json" -H "Authorization:$token" -H "sign:$sign" -H "nonce:$nonce" -H "t:$t" $@
}
switchbot_get https://api.switch-bot.com/v1.1/devices | jq -r .body.deviceList[].deviceId | \
while read deviceId; do \
switchbot_get https://api.switch-bot.com/v1.1/devices/$deviceId/status | \
jq -r '.body | [ .deviceId, .deviceType, .hubDeviceId, .power, .voltage, .weight, .electricityOfDay, .electricCurrent, .version ] | @tsv'
done34XXXXXXXX Plug Mini (JP) 34XXXXXXXX on 101.8 38.7 247 5.37 V1.5-1.5