Last active
March 12, 2024 20:34
-
-
Save athal7/4aeda6b69361da76e5876b016fd56cc3 to your computer and use it in GitHub Desktop.
ComEd Hourly Price
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Used with https://github.com/dwaan/homebridge-file-switch | |
API_URL="https://hourlypricing.comed.com/api?type=currenthouraverage" | |
price=$(curl -s "$API_URL" | jq -r '.[0].price') | |
if [ -n "$DEBUG" ]; then echo $price; fi | |
if (( $(echo "$price < 5" | bc -l) )); then echo "On"; else echo "Off"; fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment