-
Notifications
You must be signed in to change notification settings - Fork 72
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.. remove ignored files, update ignore list #265
Comments
Hi @YesThatAllen - I would love a PR for this! Thank for your help. 🙏 |
Here's a start to the work.. all feedback is welcome. I've got a question regarding timezones.. I wonder if the diff I'm about to paste in could be handled in a separate issue regarding timezone support, but maybe I'm setting my tz to Chicago the wrong way, resulting in the diff. I'm mostly curious about the change in the TZ related diffI still have this diff after running the update script % git --no-pager diff
diff --git a/dashboard.json b/dashboard.json
index b09a845..cadbd04 100644
--- a/dashboard.json
+++ b/dashboard.json
@@ -34,7 +34,7 @@
"name": "VAR_TZ",
"type": "constant",
"label": "Timezone",
- "value": "America/Los_Angeles",
+ "value": "America/Chicago",
"description": ""
}
],
diff --git a/dashboards/dashboard-min-mean-max.json b/dashboards/dashboard-min-mean-max.json
index 5af17d6..052f288 100644
--- a/dashboards/dashboard-min-mean-max.json
+++ b/dashboards/dashboard-min-mean-max.json
@@ -27,7 +27,7 @@
"name": "VAR_TZ",
"type": "constant",
"label": "Timezone",
- "value": "America/Los_Angeles",
+ "value": "America/Chicago",
"description": ""
}
],
diff --git a/dashboards/dashboard-no-animation.json b/dashboards/dashboard-no-animation.json
index 4bac66e..da5b73c 100644
--- a/dashboards/dashboard-no-animation.json
+++ b/dashboards/dashboard-no-animation.json
@@ -27,7 +27,7 @@
"name": "VAR_TZ",
"type": "constant",
"label": "Timezone",
- "value": "America/Los_Angeles",
+ "value": "America/Chicago",
"description": ""
}
],
diff --git a/dashboards/dashboard-simple.json b/dashboards/dashboard-simple.json
index 6fcd549..d61d870 100644
--- a/dashboards/dashboard-simple.json
+++ b/dashboards/dashboard-simple.json
@@ -27,7 +27,7 @@
"name": "VAR_TZ",
"type": "constant",
"label": "Timezone",
- "value": "America/Los_Angeles",
+ "value": "America/Chicago",
"description": ""
}
],
diff --git a/dashboards/dashboard.json b/dashboards/dashboard.json
index b09a845..cadbd04 100644
--- a/dashboards/dashboard.json
+++ b/dashboards/dashboard.json
@@ -34,7 +34,7 @@
"name": "VAR_TZ",
"type": "constant",
"label": "Timezone",
- "value": "America/Los_Angeles",
+ "value": "America/Chicago",
"description": ""
}
],
diff --git a/influxdb/influxdb.sql b/influxdb/influxdb.sql
index 3beb4b4..99976e7 100644
--- a/influxdb/influxdb.sql
+++ b/influxdb/influxdb.sql
@@ -13,8 +13,8 @@ CREATE RETENTION POLICY grid ON powerwall duration INF replication 1
CREATE RETENTION POLICY pod ON powerwall duration INF replication 1
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_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/Chicago') 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/Chicago') 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
diff --git a/telegraf.conf b/telegraf.conf
index b7f786f..a702cab 100644
--- a/telegraf.conf
+++ b/telegraf.conf
@@ -115,12 +115,12 @@
[[processors.date]]
tag_key = "month"
date_format = "Jan"
- timezone = "America/Los_Angeles"
+ timezone = "America/Chicago"
[[processors.date]]
tag_key = "year"
date_format = "2006"
- timezone = "America/Los_Angeles"
+ timezone = "America/Chicago"
# Alert Data
[[inputs.http]]
diff --git a/tz b/tz
index 49244fc..c7aac92 100644
--- a/tz
+++ b/tz
@@ -1 +1 @@
-America/Los_Angeles
+America/Chicago
%
|
The Yes, it is a hack, but the timezone localization required in all those files didn't allow for an external reference. |
Gotcha.. Once we're done with #269, there will be FAR fewer diffs showing, and in my mind, those will be easier to mentally ignore. Addressing the "hack" is fodder for a later date/issue. |
Unfortunately, I can't update to the current version due to the following reason:
Any idea what might be causing this (the last upgrades never failed)? Some files in ~/Powerwall-Dashboard/influxdb belong to the user root, but as far as I understood, I'm not supposed to run ./upgrade as root:
Is it possible that my installation is now corrupted since ./upgrade has already started doing some changes when it failed? I guess that at least the timezone has been changed? |
Yep
Correct. there are a number of ways we might handle this, but the simplest fix for now is to not attempt to create that |
The git operations were called before anything too drastic was attempted on the local setup, so your data should be fine. (I assume your dashboard is still running and that you can see the grafana interface?)
The upgrade script should set it back to the timezone you've specified in |
Merged! @jaydkay thanks for opening this! This shows a gap in test rigs where I do not have active backup scripts running that change permissions. You should be able to run Minor correction on timezone - It is set in the |
@jaydkay I believe I was able to replicate a setup similar to yours (with backup owned by root) and the latest upgrade worked without error. |
Hi @YesThatAllen and @jasonacox, thanks a lot for your quick support! Unfortunately, probably due to the failed upgrade from 2.9.3 to 2.9.6 I now get the following error:
The upgrade seems to think that I got 2.9.6 installed, but that upgrade failed, so I should still be with 2.9.3. Any idea how to proceed from here? |
try starting with and if you may need to use git checkout to reset a file or two. Post back if there's issues you can't readily get past, or with other findings? |
Okay, so:
and
Sorry, I have no idea how to fix this... |
try |
Okay, this gives:
|
oh.. this is about line endings. you've got the new
and try pulling again? |
Okay, removed the file and ran
|
Gotcha.. so yeah you'd want to remove those as well. For others playing the home game; the following command, run from the repo's root, would be the thing: rm rf .gitattributes .editorconfig dashboards/archive/dashboard-animation.json dashboards/archive/dashboard-grid.json dashboards/archive/dashboard-new.json dashboards/archive/dashboard-orig.json dashboards/archive/dashboard-v2.8.2.json dashboards/archive/dashboard-v2.8.3.json dashboards/archive/dashboard-v2.9.0.json dashboards/archive/dashboard-v2.9.1.json grafana/.keep tools/solar-only/grafana/.keep tools/solar-only/influxdb/.keep v6.5.1/grafana/.keep v6.5.1/influxdb/.keep (leave out the |
Okay, seems we're getting closer... ;) Deleted all the files and tried again:
I suppose I can now try to normally invoke the |
Yep, the script had failed on the |
Upgrade will show same version, but you want to continue (technically you should always be able to re-install same version). Also, can you run @YesThatAllen should we add anything to |
Yes, |
The change in 2.9.7 which removed Other changes to the upgrade & backup scripts are fodder for separate issues. |
I started putting my thoughts separate issues:
I imagine we can close this issue once it goes a while without addition related issues like @jaydkay pointed out. |
Another benefit I hoped to get from this cleanup was to remove the pretty incessant logging of this statement in the grafana docker container:
I ended up git-pulling and updating my local without the script, then updating docker itself, so the containers restarted. I was still seeing that error.. I don't know enough about how docker populates its containers to know if the I was able to remove it manually by using the terminal in the container & running
What I actually did
I assume that no one who's starting this project fresh would see that message. Woot? |
I noticed we still have a dashboard.json at the top level and a slightly newer copy at dashboards/dashboard.json. Should we cleanup the one at the top level and keep them all in the dashboards folder? |
The original purpose of the dashboards folder was to collect user submitted "Alternative Dashboards" as the README.md says. If we move the default dashboard there, we would need to update the setup instructions in |
I'm fine leaving it in the root folder, but then we should remove the duplicate in the dashboards folder. The one in dashboards had some slight tweaks to two of the queries. |
I think that proves that we should clean it up and just use the one in the dashboards folder. It is logical and shouldn't be difficult for the community to figure out. I updated the instructions including the setup.sh and upgrade.sh references to the new location. Thanks for raise this @jgleigh ! 🙏 |
What about to use template files and create the final ones from them? |
this is an offer for me to help, I'm looking for confirmation & maybe some guidance
Problem
I'm seeing a number of changes in my local git gui which could be prevented with some cleanup.
Enhancement
.DS_Store
files in the repo which are ignored & show as diffs.keep
files can ensure folders are in place upon git checkoutAdditional context
I've been running cross platform dev teams for a while. Not everyone knows about a
.gitattributes
file or.editorconfig
.I'm not super familiar with how to help the actionable code, but I can sure clean up a repo. 😄
I plan on opening a PR with changes soon, I'll have some questions about how best stuff should work.
My local diff in the moment:
The text was updated successfully, but these errors were encountered: