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

Dual Inverter Prototype #573

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
4 changes: 2 additions & 2 deletions dashboards/dashboard-alt.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"name": "VAR_TZ",
"type": "constant",
"label": "Timezone",
"value": "America/Los_Angeles",
"value": "America/New_York",
"description": ""
}
],
Expand Down Expand Up @@ -1388,7 +1388,7 @@
]
],
"tags": [],
"tz": "America/Los_Angeles"
"tz": "America/New_York"
},
{
"alias": "off_grid",
Expand Down
2 changes: 1 addition & 1 deletion dashboards/dashboard-min-mean-max.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"name": "VAR_TZ",
"type": "constant",
"label": "Timezone",
"value": "America/Los_Angeles",
"value": "America/New_York",
"description": ""
}
],
Expand Down
2 changes: 1 addition & 1 deletion dashboards/dashboard-no-animation.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"name": "VAR_TZ",
"type": "constant",
"label": "Timezone",
"value": "America/Los_Angeles",
"value": "America/New_York",
"description": ""
}
],
Expand Down
2 changes: 1 addition & 1 deletion dashboards/dashboard-simple.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"name": "VAR_TZ",
"type": "constant",
"label": "Timezone",
"value": "America/Los_Angeles",
"value": "America/New_York",
"description": ""
}
],
Expand Down
2 changes: 1 addition & 1 deletion dashboards/dashboard-solar-only.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"name": "VAR_TZ",
"type": "constant",
"label": "Timezone",
"value": "America/Los_Angeles",
"value": "America/New_York",
"description": ""
}
],
Expand Down
2 changes: 1 addition & 1 deletion dashboards/dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"name": "VAR_TZ",
"type": "constant",
"label": "Timezone",
"value": "America/Los_Angeles",
"value": "America/New_York",
"description": ""
}
],
Expand Down
2 changes: 1 addition & 1 deletion grafana/provisions/datasources/influxdb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ datasources:
- name: InfluxDB (auto provisioned)
type: influxdb
access: proxy
url: http://influxdb:8086
url: http://localhost:8086
database: powerwall
jsonData:
dbName: powerwall
Expand Down
8 changes: 8 additions & 0 deletions grafana/provisions/datasources/sunandmoon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: 1

datasources:
- name: Sun and Moon (auto provisioned)
type: fetzerch-sunandmoon-datasource
jsonData:
latitude: 40.44062
longitude: -79.995888
4 changes: 2 additions & 2 deletions influxdb/influxdb.sql
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ CREATE RETENTION POLICY alerts ON powerwall duration INF replication 1
CREATE CONTINUOUS QUERY cq_autogen ON powerwall BEGIN SELECT mean(home) AS home, mean(solar) AS solar, mean(from_pw) AS from_pw, mean(to_pw) AS to_pw, mean(from_grid) AS from_grid, mean(to_grid) AS to_grid, last(percentage) AS percentage INTO powerwall.autogen.:MEASUREMENT FROM (SELECT load_instant_power AS home, solar_instant_power AS solar, abs((1+battery_instant_power/abs(battery_instant_power))*battery_instant_power/2) AS from_pw, abs((1-battery_instant_power/abs(battery_instant_power))*battery_instant_power/2) AS to_pw, abs((1+site_instant_power/abs(site_instant_power))*site_instant_power/2) AS from_grid, abs((1-site_instant_power/abs(site_instant_power))*site_instant_power/2) AS to_grid, percentage FROM raw.http) GROUP BY time(1m), month, year fill(linear) END
CREATE CONTINUOUS QUERY cq_autogen_current ON powerwall BEGIN SELECT mean(home) AS home_current, mean(solar) AS solar_current, mean(pw) AS pw_current, mean(grid) AS grid_current INTO powerwall.autogen.:MEASUREMENT FROM (SELECT load_instant_total_current AS home, solar_instant_total_current AS solar, battery_instant_total_current AS pw, site_instant_total_current AS grid FROM raw.http) GROUP BY time(1m), month, year fill(linear) END
CREATE CONTINUOUS QUERY cq_autogen_voltage ON powerwall BEGIN SELECT mean(home) AS home_voltage, mean(solar) AS solar_voltage, mean(pw) AS pw_voltage, mean(grid) AS grid_voltage INTO powerwall.autogen.:MEASUREMENT FROM (SELECT load_instant_average_voltage AS home, solar_instant_average_voltage AS solar, battery_instant_average_voltage AS pw, site_instant_average_voltage AS grid FROM raw.http) GROUP BY time(1m), month, year fill(linear) END
CREATE CONTINUOUS QUERY cq_kwh ON powerwall RESAMPLE EVERY 1m BEGIN SELECT integral(home)/1000/3600 AS home, integral(solar)/1000/3600 AS solar, integral(from_pw)/1000/3600 AS from_pw, integral(to_pw)/1000/3600 AS to_pw, integral(from_grid)/1000/3600 AS from_grid, integral(to_grid)/1000/3600 AS to_grid INTO powerwall.kwh.:MEASUREMENT FROM autogen.http GROUP BY time(1h), month, year tz('America/Los_Angeles') END
CREATE CONTINUOUS QUERY cq_daily ON powerwall RESAMPLE EVERY 1h BEGIN SELECT sum(home) AS home, sum(solar) AS solar, sum(from_pw) AS from_pw, sum(to_pw) AS to_pw, sum(from_grid) AS from_grid, sum(to_grid) AS to_grid INTO powerwall.daily.:MEASUREMENT FROM powerwall.kwh.http GROUP BY time(1d), month, year tz('America/Los_Angeles') END
CREATE CONTINUOUS QUERY cq_kwh ON powerwall RESAMPLE EVERY 1m BEGIN SELECT integral(home)/1000/3600 AS home, integral(solar)/1000/3600 AS solar, integral(from_pw)/1000/3600 AS from_pw, integral(to_pw)/1000/3600 AS to_pw, integral(from_grid)/1000/3600 AS from_grid, integral(to_grid)/1000/3600 AS to_grid INTO powerwall.kwh.:MEASUREMENT FROM autogen.http GROUP BY time(1h), month, year tz('America/New_York') END
CREATE CONTINUOUS QUERY cq_daily ON powerwall RESAMPLE EVERY 1h BEGIN SELECT sum(home) AS home, sum(solar) AS solar, sum(from_pw) AS from_pw, sum(to_pw) AS to_pw, sum(from_grid) AS from_grid, sum(to_grid) AS to_grid INTO powerwall.daily.:MEASUREMENT FROM powerwall.kwh.http GROUP BY time(1d), month, year tz('America/New_York') END
CREATE CONTINUOUS QUERY cq_monthly ON powerwall RESAMPLE EVERY 1h BEGIN SELECT sum(home) AS home, sum(solar) AS solar, sum(from_pw) AS from_pw, sum(to_pw) AS to_pw, sum(from_grid) AS from_grid, sum(to_grid) AS to_grid INTO powerwall.monthly.:MEASUREMENT FROM powerwall.daily.http GROUP BY time(365d), month, year END
CREATE CONTINUOUS QUERY cq_pw_temps ON powerwall BEGIN SELECT mean(PW1_temp) AS PW1_temp, mean(PW2_temp) AS PW2_temp, mean(PW3_temp) AS PW3_temp, mean(PW4_temp) AS PW4_temp, mean(PW5_temp) AS PW5_temp, mean(PW6_temp) AS PW6_temp INTO powerwall.pwtemps.:MEASUREMENT FROM (SELECT PW1_temp, PW2_temp, PW3_temp, PW4_temp, PW5_temp, PW6_temp FROM raw.http) GROUP BY time(1m), month, year fill(linear) END
CREATE CONTINUOUS QUERY cq_pw_tempsb ON powerwall BEGIN SELECT mean(PW7_temp) AS PW7_temp, mean(PW8_temp) AS PW8_temp, mean(PW9_temp) AS PW9_temp, mean(PW10_temp) AS PW10_temp, mean(PW11_temp) AS PW11_temp, mean(PW12_temp) AS PW12_temp INTO powerwall.pwtemps.:MEASUREMENT FROM (SELECT PW7_temp, PW8_temp, PW9_temp, PW10_temp, PW11_temp, PW12_temp FROM raw.http) GROUP BY time(1m), month, year fill(linear) END
Expand Down
18 changes: 8 additions & 10 deletions powerwall.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ services:
container_name: influxdb
hostname: influxdb
restart: unless-stopped
network_mode: host
volumes:
- type: bind
source: ./influxdb.conf
Expand All @@ -12,13 +13,11 @@ services:
- type: bind
source: ./influxdb
target: /var/lib/influxdb
ports:
- "${INFLUXDB_PORTS:-8086:8086}"
env_file:
- influxdb.env

pypowerwall:
image: jasonacox/pypowerwall:0.12.0t66
image: jasonacox/pypowerwall:0.12.3.t68
container_name: pypowerwall
hostname: pypowerwall
restart: unless-stopped
Expand All @@ -27,10 +26,10 @@ services:
source: .auth
target: /app/.auth
user: "${PWD_USER:-1000:1000}"
ports:
- "${PYPOWERWALL_PORTS:-8675:8675}"
network_mode: host
environment:
- PW_AUTH_PATH=.auth
- PW_AUTH_PATH_1=.auth
- PW_AUTH_PATH_2=.auth
env_file:
- pypowerwall.env

Expand All @@ -40,6 +39,7 @@ services:
hostname: telegraf
restart: unless-stopped
user: "${PWD_USER:-1000:1000}"
network_mode: host
command: [
"telegraf",
"--config",
Expand Down Expand Up @@ -74,12 +74,11 @@ services:
hostname: grafana
restart: unless-stopped
user: "${PWD_USER:-1000:1000}"
network_mode: host
volumes:
- type: bind
source: ./grafana
target: /var/lib/grafana
ports:
- "${GRAFANA_PORTS:-9000:9000}"
env_file:
- grafana.env
depends_on:
Expand All @@ -91,13 +90,12 @@ services:
hostname: weather411
restart: unless-stopped
user: "${PWD_USER:-1000:1000}"
network_mode: host
volumes:
- type: bind
source: ./weather
target: /var/lib/weather
read_only: true
ports:
- "${WEATHER411_PORTS:-8676:8676}"
environment:
- WEATHERCONF=/var/lib/weather/weather411.conf
depends_on:
Expand Down
27 changes: 17 additions & 10 deletions telegraf.conf
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,25 @@
###############################################################################

[[outputs.influxdb]]
urls = ["http://influxdb:8086"]
urls = ["http://localhost:8086"]
database = "powerwall"
skip_database_creation = false
retention_policy = "raw"

[[inputs.http]]
urls = [
"http://pypowerwall:8675/aggregates",
"http://pypowerwall:8675/soe",
"http://pypowerwall:8675/strings",
"http://pypowerwall:8675/temps/pw",
"http://pypowerwall:8675/freq",
"http://pypowerwall:8675/pod"
"http://localhost:8675/aggregates",
"http://localhost:8675/soe",
"http://localhost:8675/strings",
"http://localhost:8675/temps/pw",
"http://localhost:8675/freq",
"http://localhost:8675/pod",
"http://localhost:8685/aggregates",
"http://localhost:8685/soe",
"http://localhost:8685/strings",
"http://localhost:8685/temps/pw",
"http://localhost:8685/freq",
"http://localhost:8685/pod"
]
method = "GET"
insecure_skip_verify = true
Expand All @@ -115,17 +121,18 @@
[[processors.date]]
tag_key = "month"
date_format = "Jan"
timezone = "America/Los_Angeles"
timezone = "America/New_York"

[[processors.date]]
tag_key = "year"
date_format = "2006"
timezone = "America/Los_Angeles"
timezone = "America/New_York"

# Alert Data
[[inputs.http]]
urls = [
"http://pypowerwall:8675/alerts/pw"
"http://localhost:8675/alerts/pw",
"http://localhost:8685/alerts/pw"
]
name_override = "alerts"
method = "GET"
Expand Down
2 changes: 1 addition & 1 deletion tz
Original file line number Diff line number Diff line change
@@ -1 +1 @@
America/Los_Angeles
America/New_York