Skip to content

Commit

Permalink
Merge pull request #2 from jasonacox/main
Browse files Browse the repository at this point in the history
Sync with master
  • Loading branch information
BJReplay authored Jan 16, 2023
2 parents be041c5 + 57fd8ea commit ed99711
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 20 deletions.
7 changes: 7 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# RELEASE NOTES

## v2.7.0 - PyPowerwall t24 and Ecowitt Weather Support

* [[Ecowitt Weather](https://github.com/jasonacox/Powerwall-Dashboard/tree/main/weather/contrib/ecowitt#ecowitt-local-weather-server)] Added Ecowitt local weather station data import service and dashboard by @BJReplay in https://github.com/jasonacox/Powerwall-Dashboard/pull/150 https://github.com/jasonacox/Powerwall-Dashboard/pull/151 https://github.com/jasonacox/Powerwall-Dashboard/pull/153 https://github.com/jasonacox/Powerwall-Dashboard/pull/157
* [[Tesla History Tool](https://github.com/jasonacox/Powerwall-Dashboard/tree/main/tools/tesla-history#tesla-history-import-tool)] Revise error handling of SITE_DATA request by @mcbirse in https://github.com/jasonacox/Powerwall-Dashboard/pull/156
* [[Ecowitt Weather History Tool](https://github.com/jasonacox/Powerwall-Dashboard/tree/main/tools/ecowitt-weather-history#ecowitt-weather-history-import-tool)] Added Ecowitt Weather History Tool by @BJReplay in https://github.com/jasonacox/Powerwall-Dashboard/pull/159
* [[pyPowerwall Proxy](https://github.com/jasonacox/pypowerwall/tree/main/proxy#pypowerwall-proxy-server)] Upgraded to pyPowerwall Proxy t24 which moves to Python 3.10 and adds /alerts/pw for easier alert history tracking by @DerickJohnson in https://github.com/jasonacox/pypowerwall/pull/26

## v2.6.7 - History Tools and Powerwall Firmware Version

* Add Powerwall Firmware version to Power-Flow animation. #112
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.6.7
2.7.0
25 changes: 19 additions & 6 deletions backups/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,33 @@ Backup the Powerwall-Dashboard folder. In that folder are two important folders:
* influxdb - This is the folder for the database that stores the metrics.
* grafana - This is the folder for the dashboard which holds your setup and customization.

The following shows an example of how to migrate the data (influxdb) from one system to another (see backup.sh):

## Backup Example

```bash
#!/bin/bash
# Daily Backup for Powerwall-Dashboard
# Daily Backup for Powerwall-Dashboard Data
if [ "$EUID" -ne 0 ]
then echo "Must run as root"
exit
fi

# Set values for your environment
BACKUP_FOLDER="/backup" # Destination folder for backups
DASHBOARD="/home/user/Powerwall-Dashboard" # Location of Dashboard to backup
BACKUP_FOLDER="${DASHBOARD}/backups" # Destination folder for backups
KEEP="5" # Days to keep backup

# Check to see if direcotry exists
if [ ! -d "${DASHBOARD}" ]; then
echo "Dashboard directory ${DASHBOARD} does not exist."
exit
fi
if [ ! -d "${BACKUP_FOLDER}" ]; then
echo "Backup directory ${BACKUP_FOLDER} does not exist."
exit
fi

# Timestamp for Backup Filename
STAMP=$(date '+%Y-%m-%d')

Expand All @@ -32,15 +44,16 @@ echo "Creating InfluxDB Backup"
cd ${DASHBOARD}
mkdir -p influxdb/backups
chmod g+w influxdb/backups
docker exec -it influxdb influxd backup -database powerwall /var/lib/influxdb/backups
docker exec influxdb influxd backup -database powerwall /var/lib/influxdb/backups

# Backup Powerwall-Dashboard
echo "Backing up Powerwall-Dashboard (influxdb grafana)"
# Backup Powerwall-Dashboard Data
echo "Backing up Powerwall-Dashboard Data (influxdb)"
cd ${DASHBOARD}
tar -zcvf ${BACKUP_FOLDER}/Powerwall-Dashboard.$STAMP.tgz influxdb grafana
tar -zcvf ${BACKUP_FOLDER}/Powerwall-Dashboard.$STAMP.tgz influxdb

# Cleanup Old Backups
echo "Cleaning up old backups"
rm -rf ${DASHBOARD}/influxdb/backups/* # Delete InfluxDB snapshots after backup
find ${BACKUP_FOLDER}/Powerwall-Dashboard.*tgz -mtime +${KEEP} -type f -delete
echo "Done"
```
Expand Down
12 changes: 6 additions & 6 deletions backups/backup.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#!/bin/bash
#
# Backup Script for Powerwall Dashboard
# Backup Script for Powerwall Dashboard Data
# https://github.com/jasonacox/Powerwall-Dashboard
# by Jason Cox - 27 Feb 2022

# Daily Backup for Powerwall-Dashboard
# Daily Backup for Powerwall-Dashboard Data
if [ "$EUID" -ne 0 ]
then echo "Must run as root"
exit
fi

# Set values for your environment
DASHBOARD="/home/user/Powerwall-Dashboard" # Location of Dashboard to backup
DASHBOARD="/home/user/Powerwall-Dashboard" # Location of Dashboard to backup
BACKUP_FOLDER="${DASHBOARD}/backups" # Destination folder for backups
KEEP="5" # Days to keep backup

Expand All @@ -35,10 +35,10 @@ mkdir -p influxdb/backups
chmod g+w influxdb/backups
docker exec influxdb influxd backup -database powerwall /var/lib/influxdb/backups

# Backup Powerwall-Dashboard
echo "Backing up Powerwall-Dashboard (influxdb grafana)"
# Backup Powerwall-Dashboard Data
echo "Backing up Powerwall-Dashboard Data (influxdb)"
cd ${DASHBOARD}
tar -zcvf ${BACKUP_FOLDER}/Powerwall-Dashboard.$STAMP.tgz influxdb grafana
tar -zcvf ${BACKUP_FOLDER}/Powerwall-Dashboard.$STAMP.tgz influxdb

# Cleanup Old Backups
echo "Cleaning up old backups"
Expand Down
9 changes: 3 additions & 6 deletions tools/tesla-history/tesla-history.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,12 +324,9 @@ def tesla_login(email):
if args.debug: print(f"Get SITE_DATA for Site ID {siteid}")
data = battery.api('SITE_DATA')
if args.debug: print(data)
if isinstance(data, teslapy.JsonDict) and 'response' in data:
sitetime = isoparse(data['response']['timestamp'])
else:
sitetime = "No 'live status' returned"
except Exception as err:
sys.exit(f"ERROR: Failed to retrieve SITE_DATA - {err}")
sitetime = isoparse(data['response']['timestamp'])
except:
sitetime = "No 'live status' returned"

# Add site if site id not already in the list
if siteid not in sitelist:
Expand Down
2 changes: 1 addition & 1 deletion upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
set -e

# Set Globals
VERSION="2.6.7"
VERSION="2.7.0"
CURRENT="Unknown"
COMPOSE_ENV_FILE="compose.env"
TELEGRAF_LOCAL="telegraf.local"
Expand Down

0 comments on commit ed99711

Please sign in to comment.