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

Repo cleanup and maintenance #269

Merged
merged 18 commits into from
May 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 21 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
YesThatAllen marked this conversation as resolved.
Show resolved Hide resolved
trim_trailing_whitespace = true

# json files don't want a final newline
[*.json]
insert_final_newline = false

# Tab indentation (no size specified)
[*.md]
trim_trailing_whitespace = false
2 changes: 0 additions & 2 deletions .github/ISSUE_TEMPLATE/other.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,3 @@ labels: ''
assignees: ''

---


35 changes: 31 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,40 @@
sandbox/
# Ignore common local files
.DS_Store

# VisualStudio
.vs/

# VisualStudio code
# https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

# Local Settings
compose.env
grafana.env
pypowerwall.env
telegraf.local

# Local Dev files
*.bak
backups/*.tgz
influxdb/run-once-*.sql.done

sandbox/

grafana/alerting/
grafana/csv/
grafana/grafana.db
grafana/plugins/

influxdb/meta/
influxdb/wal/
influxdb/data/
pypowerwall.env

weather/uploadtest.sh
weather/weather411.conf
weather/weather411.conf.orig
.DS_Store
/.vs
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ Run the interactive setup script that will ask you for your Powerwall details an
* _For Windows 11 users, see the [Windows 11 Instructions](https://github.com/jasonacox/Powerwall-Dashboard#windows-11-instructions) below._

Follow the **[Grafana Setup](https://github.com/jasonacox/Powerwall-Dashboard#grafana-setup)** instructions provided (or see below) to complete the setup.



## Option 2 - Manual Install

If you prefer, you can perform the same steps that `setup.sh` performs.
Expand Down Expand Up @@ -87,7 +86,7 @@ You will want to set your local timezone by editing `pypowerwall.env`, `telegraf
[OpenWeatherMap]
# Register and get APIKEY from OpenWeatherMap.org
APIKEY = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
# Enter your location in latitude and longitude
# Enter your location in latitude and longitude
LAT = xxx.xxxx
LON = yyy.yyyy
```
Expand All @@ -100,7 +99,7 @@ You will want to set your local timezone by editing `pypowerwall.env`, `telegraf

### InfluxDB

* Connect to the Influx database to import setup commands:
* Connect to the Influx database to import setup commands:

```bash
docker exec -it influxdb influx -import -path=/var/lib/influxdb/influxdb.sql
Expand Down Expand Up @@ -149,7 +148,7 @@ Check the logs of the services using:
docker logs -f grafana
```

* Docker terminating with `error 139`: InfluxDB does not run reliably on older models of Raspberry Pi.
* Docker terminating with `error 139`: InfluxDB does not run reliably on older models of Raspberry Pi.
* Grafana Error: Invalid interval string, expecting a number followed by one of "Mwdhmsy" - This indicates that the Grafana setup for InfluxDB is missing the time unit, "s", in the "Min time interval" field:
- Min time interval: `5s`

Expand Down Expand Up @@ -244,7 +243,7 @@ InfluxDB is configured to use a infinite retention policy (see [influxdb.sql](..
### Credits

* This project is based on the great work by mihailescu2m at [https://github.com/mihailescu2m/powerwall_monitor](https://github.com/mihailescu2m/powerwall_monitor) and has been modified to use pypowerwall as a proxy to the Powerwall and includes solar String, Inverter and Powerwall Temperature graphs for Powerwall+ systems.
* Grafana at https://github.com/grafana/grafana
* Grafana at https://github.com/grafana/grafana
* Telegraf at https://github.com/influxdata/telegraf
* InfluxDB at https://github.com/influxdata/influxdb
* pyPowerwall at https://github.com/jasonacox/pypowerwall
Expand Down
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
theme: jekyll-theme-cayman
theme: jekyll-theme-cayman
6 changes: 3 additions & 3 deletions compose.env.sample
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Environment variables for docker compose.
#
#
# GRAFANAUSER - may need to be adjusted for cases such as rootless docker.
# See issue #22,
# See issue #22,
# https://github.com/jasonacox/Powerwall-Dashboard/issues/22#issuecomment-1253076441)
GRAFANAUSER="1000:1000"
GRAFANAUSER="1000:1000"
3 changes: 0 additions & 3 deletions dashboards/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ This dashboard graphs min(), mean() and max() values for the Solar, Home, Grid a

<img width="863" alt="image" src="https://user-images.githubusercontent.com/836718/224519614-76dcab24-deb3-42fe-a0ba-9f4837af7ee8.png">


## No Animation

This dashboard provides the original time series "Live Monitoring" graph but removes the Powerwall flow animation panel.
Expand All @@ -17,7 +16,6 @@ This dashboard provides the original time series "Live Monitoring" graph but rem

<img width="864" alt="image" src="https://user-images.githubusercontent.com/836718/224519662-f29a044a-34d8-4d1f-9220-bebfe7172cd3.png">


## Simple

Similar to the above, this dashboard provides a basic time series graph and meter data but without any of the Powerwall+ or extended data.
Expand All @@ -27,4 +25,3 @@ Similar to the above, this dashboard provides a basic time series graph and mete
## Submit Your Dashboard

Do you have a great dashboard? Do you think others might be able to use it? If so, submit a PR so we can get it added.

6 changes: 3 additions & 3 deletions dashboards/powerflow-animation.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
})
}
window.addEventListener('resize', function(e){ scale(); }, false);

// Display Firmware Version
function showversion() {
var pwver = window.location.protocol + "//" + window.location.hostname + ":8675/version";
Expand All @@ -51,7 +51,7 @@
setTimeout(showversion, 60000);
}
showversion();

// Load Animation from pyPowerwall
var powerFrame = document.getElementById('frame8675');
powerFrame.onload = function() {
Expand All @@ -61,4 +61,4 @@
scale();
}
powerFrame.src = window.location.protocol + "//" + window.location.hostname + ":8675/";
</script>
</script>
Binary file removed grafana/.DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions grafana/.keep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

2 changes: 0 additions & 2 deletions grafana/README.md

This file was deleted.

1 change: 0 additions & 1 deletion influxdb.conf
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,3 @@ bind-address = "127.0.0.1:8088"
[tls]
min-version = ""
max-version = ""

Binary file removed influxdb/.DS_Store
Binary file not shown.
2 changes: 0 additions & 2 deletions influxdb/README.md

This file was deleted.

1 change: 1 addition & 0 deletions influxdb/backups/.keep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 0 additions & 1 deletion location.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,3 @@
</script>
</body>
</html>

9 changes: 4 additions & 5 deletions powerwall.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ services:
restart: always
user: "1000:1000"
command: [
"telegraf",
"--config",
"/etc/telegraf/telegraf.conf",
"telegraf",
"--config",
"/etc/telegraf/telegraf.conf",
"--config-directory",
"/etc/telegraf/telegraf.d"
]
Expand All @@ -53,7 +53,7 @@ services:
- type: bind
source: ./telegraf.local
target: /etc/telegraf/telegraf.d/local.conf
read_only: true
read_only: true
depends_on:
- influxdb
- pypowerwall
Expand Down Expand Up @@ -96,4 +96,3 @@ services:
- WEATHERCONF=/var/lib/weather/weather411.conf
depends_on:
- influxdb

5 changes: 0 additions & 5 deletions pypowerwall.sample

This file was deleted.

4 changes: 2 additions & 2 deletions telegraf.local.sample
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# The local configuration file should be named "telegraf.local".
# Upgrade.sh does not modify this file.
#
#
# The following sample adds some power and energy data from the solar meter
# as a measurement called "solarmeter" (used in a three phase monitoring example)

Expand Down Expand Up @@ -47,4 +47,4 @@
# return new_metric
# else:
# return metric
# '''
# '''
6 changes: 3 additions & 3 deletions tools/ecowitt-weather-history/ecowitt-weather-history.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@

Overview:
Historical weather data from Ecowitt API can be imported into your
Powerwall Dashboard graphs by repeatedly calling the historical API with a short time range and a short interval`.
Powerwall Dashboard graphs by repeatedly calling the historical API with a short time range and a short interval.

Usage:
* Subscribe to the Ecowitt API as described here
https://github.com/jasonacox/Powerwall-Dashboard/tree/main/weather/contrib/ecowitt#ecowitt-local-weather-server

* Install the required python modules:
pip install python-dateutil influxdb

Expand Down Expand Up @@ -506,7 +506,7 @@ def get_weather_history(start, end):
print(f"* Loading data for time: [{curr.astimezone(influxtz)}]")
try:
dtstart = curr.date()
dtend = dtstart
dtend = dtstart
dtend += interval
url = f"{ecoapi}&start_date={dtstart}%2000:00:00&end_date={dtend}%2023:59:59"
response = session.get(url, timeout=TIMEOUT)
Expand Down
1 change: 1 addition & 0 deletions tools/solar-only/grafana/.keep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

2 changes: 0 additions & 2 deletions tools/solar-only/grafana/README.md

This file was deleted.

1 change: 1 addition & 0 deletions tools/solar-only/influxdb/.keep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

2 changes: 0 additions & 2 deletions tools/solar-only/influxdb/README.md

This file was deleted.

Binary file removed v6.5.1/grafana/.DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions v6.5.1/grafana/.keep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

2 changes: 0 additions & 2 deletions v6.5.1/grafana/README.md

This file was deleted.

Binary file removed v6.5.1/influxdb/.DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions v6.5.1/influxdb/.keep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

2 changes: 0 additions & 2 deletions v6.5.1/influxdb/README.md

This file was deleted.

5 changes: 0 additions & 5 deletions v6.5.1/pypowerwall.sample

This file was deleted.