Skip to content

Commit

Permalink
Merge pull request #439 from s-crypt/main
Browse files Browse the repository at this point in the history
Use raw variable for timezone
  • Loading branch information
jasonacox authored Mar 10, 2024
2 parents ef3c70b + b202484 commit 4c752dc
Show file tree
Hide file tree
Showing 10 changed files with 176 additions and 170 deletions.
8 changes: 7 additions & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
# RELEASE NOTES

## v4.0.5 - Dashboard Updates

* Updated timezone variable in `dashboard.json` to tz:text to ensure the Time Zone string is output as-is. This will make upgrading Grafana easier later on and future-proof the variables by @s-crypt in #439.
* Removed $tz from any queries that do not have a GROUP BY statement by @s-crypt in #439.
* Updated pyPowerwall Proxy t42 - Adds Power Flow Animation style (set PW_STYLE="solar") for Solar-Only display. Removes the Powerwall image and related text to display a Grid + Solar + Home power flow animation.

## v4.0.4 - Cloud Grid Status

* Update to pyPowerwall v0.7.9 - Bug fix to render correct grid status for Solar-Only systems on `cloud mode` (see https://github.com/jasonacox/Powerwall-Dashboard/issues/437)
* Update to pyPowerwall v0.7.9 - Bug fix to render correct grid status for Solar-Only systems on cloud mode (see #437)

## v4.0.3 - Cloud Mode Fixes

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0.4
4.0.5
52 changes: 26 additions & 26 deletions dashboards/dashboard-alt.json
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@
"measurement": "http",
"orderByTime": "ASC",
"policy": "autogen",
"query": "SELECT \"mean_load_instant_power\" FROM \"http\" WHERE $timeFilter tz('$tz')",
"query": "SELECT \"mean_load_instant_power\" FROM \"http\" WHERE $timeFilter ",
"rawQuery": false,
"refId": "A",
"resultFormat": "time_series",
Expand Down Expand Up @@ -728,7 +728,7 @@
]
],
"tags": [],
"tz": "$tz"
"tz": "${tz:text}"
},
{
"alias": "Grid Usage",
Expand Down Expand Up @@ -773,7 +773,7 @@
]
],
"tags": [],
"tz": "$tz"
"tz": "${tz:text}"
},
{
"alias": "Charge",
Expand Down Expand Up @@ -1084,7 +1084,7 @@
"measurement": "http",
"orderByTime": "ASC",
"policy": "default",
"query": "SELECT (1+from_solar/abs(from_solar))*from_solar/2 FROM (SELECT integral(solar)/1000/3600 - integral(to_pw)/1000/3600 - integral(to_grid)/1000/3600 AS from_solar FROM autogen.http WHERE $timeFilter tz('$tz'))",
"query": "SELECT (1+from_solar/abs(from_solar))*from_solar/2 FROM (SELECT integral(solar)/1000/3600 - integral(to_pw)/1000/3600 - integral(to_grid)/1000/3600 AS from_solar FROM autogen.http WHERE $timeFilter )",
"rawQuery": true,
"refId": "A",
"resultFormat": "time_series",
Expand All @@ -1103,7 +1103,7 @@
]
],
"tags": [],
"tz": "$tz"
"tz": "${tz:text}"
},
{
"alias": "From Powerwall",
Expand Down Expand Up @@ -1134,7 +1134,7 @@
]
],
"tags": [],
"tz": "$tz"
"tz": "${tz:text}"
},
{
"alias": "From Grid",
Expand Down Expand Up @@ -1165,7 +1165,7 @@
]
],
"tags": [],
"tz": "$tz"
"tz": "${tz:text}"
}
],
"title": "Power Flow",
Expand Down Expand Up @@ -1369,7 +1369,7 @@
"measurement": "http",
"orderByTime": "ASC",
"policy": "raw",
"query": "SELECT min(\"grid_status\") FROM \"grid\".\"http\" WHERE $timeFilter GROUP BY time($__interval) fill(previous) tz('$tz')",
"query": "SELECT min(\"grid_status\") FROM \"grid\".\"http\" WHERE $timeFilter GROUP BY time($__interval) fill(previous) tz('${tz:text}')",
"rawQuery": true,
"refId": "A",
"resultFormat": "time_series",
Expand Down Expand Up @@ -1397,7 +1397,7 @@
"uid": "${DS_INFLUXDB}"
},
"hide": false,
"query": "SELECT min(\"grid_status\") + 1 FROM \"grid\".\"http\" WHERE grid_status = 0 and $timeFilter GROUP BY time($__interval) fill(null) tz('$tz')",
"query": "SELECT min(\"grid_status\") + 1 FROM \"grid\".\"http\" WHERE grid_status = 0 and $timeFilter GROUP BY time($__interval) fill(null) tz('${tz:text}')",
"rawQuery": true,
"refId": "B",
"resultFormat": "time_series"
Expand Down Expand Up @@ -2406,7 +2406,7 @@
"type": "influxdb",
"uid": "${DS_INFLUXDB}"
},
"query": "SELECT fp FROM (SELECT sum(\"from_pw\") * $avg_buy_per_kwh AS fp FROM kwh.http WHERE $timeFilter tz('$tz'))",
"query": "SELECT fp FROM (SELECT sum(\"from_pw\") * $avg_buy_per_kwh AS fp FROM kwh.http WHERE $timeFilter )",
"rawQuery": true,
"refId": "A",
"resultFormat": "time_series"
Expand All @@ -2418,7 +2418,7 @@
"uid": "${DS_INFLUXDB}"
},
"hide": false,
"query": "SELECT s - (tp + tg) FROM (SELECT sum(\"solar\") * $avg_buy_per_kwh AS s, sum(\"to_pw\") * $avg_buy_per_kwh AS tp, sum(\"to_grid\") * $avg_buy_per_kwh AS tg FROM kwh.http WHERE $timeFilter tz('$tz'))",
"query": "SELECT s - (tp + tg) FROM (SELECT sum(\"solar\") * $avg_buy_per_kwh AS s, sum(\"to_pw\") * $avg_buy_per_kwh AS tp, sum(\"to_grid\") * $avg_buy_per_kwh AS tg FROM kwh.http WHERE $timeFilter )",
"rawQuery": true,
"refId": "B",
"resultFormat": "time_series"
Expand All @@ -2430,7 +2430,7 @@
"uid": "${DS_INFLUXDB}"
},
"hide": false,
"query": "SELECT tgg FROM (SELECT sum(\"to_grid\") * $avg_sell_per_kwh AS tgg FROM kwh.http WHERE $timeFilter tz('$tz'))",
"query": "SELECT tgg FROM (SELECT sum(\"to_grid\") * $avg_sell_per_kwh AS tgg FROM kwh.http WHERE $timeFilter )",
"rawQuery": true,
"refId": "C",
"resultFormat": "time_series"
Expand All @@ -2442,7 +2442,7 @@
"uid": "${DS_INFLUXDB}"
},
"hide": false,
"query": "SELECT tgg + (s - tp - tg ) + fp FROM (SELECT sum(\"to_pw\") * $avg_buy_per_kwh AS tp, sum(\"solar\") * $avg_buy_per_kwh AS s, sum(\"to_grid\") * $avg_buy_per_kwh AS tg, sum(\"from_pw\") * $avg_buy_per_kwh AS fp, sum(\"to_grid\") * $avg_sell_per_kwh AS tgg FROM kwh.http WHERE $timeFilter tz('$tz'))",
"query": "SELECT tgg + (s - tp - tg ) + fp FROM (SELECT sum(\"to_pw\") * $avg_buy_per_kwh AS tp, sum(\"solar\") * $avg_buy_per_kwh AS s, sum(\"to_grid\") * $avg_buy_per_kwh AS tg, sum(\"from_pw\") * $avg_buy_per_kwh AS fp, sum(\"to_grid\") * $avg_sell_per_kwh AS tgg FROM kwh.http WHERE $timeFilter )",
"rawQuery": true,
"refId": "D",
"resultFormat": "time_series"
Expand Down Expand Up @@ -2515,7 +2515,7 @@
"type": "influxdb",
"uid": "${DS_INFLUXDB}"
},
"query": "SELECT (1+from_solar/abs(from_solar))*from_solar/2 FROM (SELECT integral(solar)/1000/3600 - (integral(to_pw) - integral(grid_to_pw))/1000/3600 - integral(to_grid)/1000/3600 AS from_solar FROM (SELECT from_solar, solar, to_pw, to_grid, ((from_grid - home - solar) + ABS((from_grid - home - solar))) / 2 AS grid_to_pw FROM autogen.http WHERE $timeFilter tz('$tz')))",
"query": "SELECT (1+from_solar/abs(from_solar))*from_solar/2 FROM (SELECT integral(solar)/1000/3600 - (integral(to_pw) - integral(grid_to_pw))/1000/3600 - integral(to_grid)/1000/3600 AS from_solar FROM (SELECT from_solar, solar, to_pw, to_grid, ((from_grid - home - solar) + ABS((from_grid - home - solar))) / 2 AS grid_to_pw FROM autogen.http WHERE $timeFilter ))",
"rawQuery": true,
"refId": "A",
"resultFormat": "time_series"
Expand All @@ -2531,7 +2531,7 @@
"measurement": "http",
"orderByTime": "ASC",
"policy": "autogen",
"query": "SELECT integral(\"from_pw\") / 1000 / 3600 FROM \"autogen\".\"http\" WHERE $timeFilter tz('$tz')",
"query": "SELECT integral(\"from_pw\") / 1000 / 3600 FROM \"autogen\".\"http\" WHERE $timeFilter ",
"rawQuery": true,
"refId": "B",
"resultFormat": "time_series",
Expand All @@ -2556,7 +2556,7 @@
]
],
"tags": [],
"tz": "$tz"
"tz": "${tz:text}"
},
{
"alias": "From Grid",
Expand All @@ -2569,7 +2569,7 @@
"measurement": "http",
"orderByTime": "ASC",
"policy": "autogen",
"query": "SELECT (integral(from_grid) - integral(grid_to_pw))/1000/3600 AS from_grid FROM (SELECT from_grid, ((from_grid - home - solar) + ABS((from_grid - home - solar))) / 2 AS grid_to_pw FROM autogen.http WHERE $timeFilter tz('$tz'))",
"query": "SELECT (integral(from_grid) - integral(grid_to_pw))/1000/3600 AS from_grid FROM (SELECT from_grid, ((from_grid - home - solar) + ABS((from_grid - home - solar))) / 2 AS grid_to_pw FROM autogen.http WHERE $timeFilter )",
"rawQuery": true,
"refId": "C",
"resultFormat": "time_series",
Expand All @@ -2594,7 +2594,7 @@
]
],
"tags": [],
"tz": "$tz"
"tz": "${tz:text}"
}
],
"title": "Self-Powered",
Expand Down Expand Up @@ -2949,7 +2949,7 @@
]
],
"tags": [],
"tz": "$tz"
"tz": "${tz:text}"
}
],
"timeFrom": "1M",
Expand Down Expand Up @@ -3100,7 +3100,7 @@
"value": "0"
}
],
"tz": "$tz"
"tz": "${tz:text}"
}
],
"timeFrom": "1M",
Expand Down Expand Up @@ -3245,7 +3245,7 @@
]
],
"tags": [],
"tz": "$tz"
"tz": "${tz:text}"
}
],
"timeFrom": "1M",
Expand Down Expand Up @@ -3405,7 +3405,7 @@
]
],
"tags": [],
"tz": "$tz"
"tz": "${tz:text}"
},
{
"alias": "To Grid",
Expand Down Expand Up @@ -3454,7 +3454,7 @@
]
],
"tags": [],
"tz": "$tz"
"tz": "${tz:text}"
}
],
"timeFrom": "1M",
Expand Down Expand Up @@ -3632,7 +3632,7 @@
"measurement": "http",
"orderByTime": "ASC",
"policy": "kwh",
"query": "SELECT sum(\"home\") FROM \"kwh\".\"http\" WHERE (\"home\" > 0) GROUP BY time(1d) fill(null) tz('$tz')",
"query": "SELECT sum(\"home\") FROM \"kwh\".\"http\" WHERE (\"home\" > 0) GROUP BY time(1d) fill(null) tz('${tz:text}')",
"rawQuery": true,
"refId": "B",
"resultFormat": "time_series",
Expand Down Expand Up @@ -3682,7 +3682,7 @@
"measurement": "http",
"orderByTime": "ASC",
"policy": "kwh",
"query": "SELECT sum(\"solar\") FROM \"kwh\".\"http\" WHERE (\"solar\" > 0) GROUP BY time(1d) fill(0) tz('$tz')",
"query": "SELECT sum(\"solar\") FROM \"kwh\".\"http\" WHERE (\"solar\" > 0) GROUP BY time(1d) fill(0) tz('${tz:text}')",
"rawQuery": true,
"refId": "A",
"resultFormat": "time_series",
Expand Down Expand Up @@ -3715,7 +3715,7 @@
"uid": "${DS_INFLUXDB}"
},
"hide": false,
"query": "SELECT sum(\"from_grid\") - sum(\"to_grid\") as \"grid\" FROM \"kwh\".\"http\" WHERE $timeFilter GROUP BY time(1d) fill(0) tz('$tz')",
"query": "SELECT sum(\"from_grid\") - sum(\"to_grid\") as \"grid\" FROM \"kwh\".\"http\" WHERE $timeFilter GROUP BY time(1d) fill(0) tz('${tz:text}')",
"rawQuery": true,
"refId": "C",
"resultFormat": "time_series"
Expand Down
Loading

0 comments on commit 4c752dc

Please sign in to comment.