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

v4.0.0 - Add Cloud Mode support via pyPowerwall v0.7.0 #414

Merged
merged 28 commits into from
Jan 21, 2024
Merged
Changes from 2 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
a0ed67c
Stage updates for pypowerwall v0.7.0
jasonacox Dec 27, 2023
1ab975e
v4.0.0
jasonacox Dec 27, 2023
39462a1
Add auth and site file creation
jasonacox Dec 29, 2023
ad1958c
Add .auth folder
jasonacox Dec 30, 2023
252f335
Update powerwall.yml for .auth
jasonacox Dec 30, 2023
d5bc73e
Add PW_AUTH_PATH to Docker Compose config
mcbirse Dec 31, 2023
7c54343
Add CQ for nominal_full_pack_energy
jasonacox Jan 2, 2024
a2fff22
Merge branch 'v4.0.0' of https://github.com/jasonacox/Powerwall-Dashb…
jasonacox Jan 2, 2024
5aa5fcd
Capture SIGTERM when weather411 halts due to missing config
mcbirse Jan 10, 2024
e8817c5
Add auth files
mcbirse Jan 10, 2024
32b946f
Remove profiles
mcbirse Jan 10, 2024
666947a
Update setup scripts and remove profiles
mcbirse Jan 10, 2024
b9bd555
Update container versions and remove profiles
mcbirse Jan 10, 2024
7e1bd00
Update pypowerwall
jasonacox Jan 14, 2024
90c2d7e
Add v3.0.8
jasonacox Jan 14, 2024
f41de0d
v4.0.0 upgrade script
mcbirse Jan 14, 2024
fde66b2
Fix network scan ip addr in Windows Git Bash
mcbirse Jan 15, 2024
7e7d692
Merge branch 'main' into v4.0.0
jasonacox Jan 15, 2024
1d96c9a
Merge branch 'v4.0.0' of https://github.com/jasonacox/Powerwall-Dashb…
jasonacox Jan 15, 2024
fa1bd89
Get ip addr based on OS
mcbirse Jan 16, 2024
1b2aae4
Fix for missing cmd
mcbirse Jan 16, 2024
94c75f7
Update verify script
mcbirse Jan 16, 2024
253dffe
Add sample docker compose for tesla-history
mcbirse Jan 19, 2024
2e1c504
Update setup options, README and RELEASE notes
mcbirse Jan 19, 2024
2f58551
Update to latest pypowerwall and proxy
mcbirse Jan 21, 2024
a493e91
Update README
jasonacox Jan 21, 2024
910e627
Add animation to solar-only dashboard
jasonacox Jan 21, 2024
7807a8c
Add script descriptions
jasonacox Jan 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,12 @@ echo "-----------------------------------------"
# Run Local Access mode network scan
if [ "${config}" == "Local Access" ] && ! grep -qE "^PW_HOST=.+" "${PW_ENV_FILE}"; then
echo "Running network scan... (press Ctrl-C to interrupt)"
docker exec -it pypowerwall python3 -m pypowerwall scan -ip=$(ip route get 8.8.8.8 | awk '{ print $NF }')
if type winpty > /dev/null 2>&1; then
IP=$(netstat -rn | grep "0.0.0.0" | awk '{ print $4 }' | head -1)
else
IP=$(ip route get 8.8.8.8 | awk '{ print $7 }')
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't work on my Mac. I can use ipconfig getifaddr en0 or ifconfig | grep 'inet ' | grep -v '127.0.0.1' | awk '{print $2}'.

maybe something like this?

OS=$(uname -s)

# Get local IP based on the operating system
case $OS in
  Linux*) IP=$(ip route get 8.8.8.8 | awk '{ print $7 }') ;;
  Darwin*) IP=$(ifconfig | grep 'inet ' | grep -v '127.0.0.1' | awk '{print $2}') ;;
  CYGWIN*|MINGW32*|MSYS*) IP=$(netstat -rn | grep "0.0.0.0" | awk '{ print $4 }' | head -1) ;;
  *) IP=""
esac

echo "Your OS is ${OS} and your local IP is ${IP}"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks better than what I did. I will incorporate this or similar into the script - feel free to change it though.

I was trying to find a consistent OS independent way of discovering the local IP address in bash.... it seems there isn't one?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good! Yes, search for one and even asked ChatGPT! 😂 No luck. Worse case, if it gets an empty or wrong, response, the scan won't rung and the user can manually enter the IP during setup.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep true. When you think something should be simple... lol

To complicate things, small change for this I'll remove the "32" in CYGWIN*|MINGW32*|MSYS*) as my Git Bash returns MINGW64 😆

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good and we are getting close @mcbirse. What left on your list? I'll start testing.

fi
docker exec -it pypowerwall python3 -m pypowerwall scan -ip=${IP}
echo "-----------------------------------------"
echo "Enter address for Powerwall... (or leave blank to switch to Tesla Cloud mode)"
read -p 'IP Address: ' IP
Expand Down