pgx
PGX — Lightweight Postgres for AI agents. Written in Rust. Thousands of isolated databases in one runtime. 🐘
翻譯準備中
尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證This application collects data from your Tesla Powerwall gateway to assist in monitoring your home electricity consumption. It does this by giving you detailed information about your energy consumption and production during your differnt tariff (billing rate) periods.
翻譯準備中
取自儲存庫 README
正在載入完整 README。
檢視完整 README ↗This application collects data from your Tesla Powerwall gateway to assist in monitoring your home electricity consumption. It does this by giving you detailed information about your energy consumption and production during your differnt tariff (billing rate) periods.
{ Show Report Snapshots HERE }
Most solar systems include monitoring to help you see how much energy your system is producing and they may help you monitor your consumption. Tesla does a pretty good job of this but there is room for improvement especially when you are on a Time Of Use plan for the you consume.
Most people simply try to avoid consuming power during the Peak billing rates and shift usage to cheaper Off-Peak rates. It just makes sense. But the catch is your solar production is happening during the day mostly during On-Peak rate periods. Which means that your solar system is never getting you credits for the Off-Peak energy your are consuming. This would not be bad except that most energy providers do not pay you very well for solar over production. This means that during the On-Peak billing period you produce 500 extra kwhs a month On-Peak they DO NOT subtract those kwhs from your Off-Peak consumption. They credit you for your over production at a much lower rate than even your Off-Peak consumption.
On Peak OverProduction: 500 kwh * 0.055 $/kwh = $27.50
Off Peak Consumption: 500 kwh * 0.106 $/kwh = $53.00
This shows that when your solar is overproducing if you avoid over producing and shift your consumption to on-peak you will save a decent amount each month which of course will add up substantially over the life of your solar system.
Savings over system lifetime: $53 - $27.50 * 12 months * 25 years = 7650$
We monitor your system collecting how much power your are importing and exporting for each Tariff Period. We make this information available to you via a web application.
Switching to a Time of Use usually means you pay less on nights and weekends and more during weekdays (M-F) during business hours or later in the evening. For example here is a real world Time Of Use plan:
| Tariff | Period | Consumption | Buyback |
|---|---|---|---|
| On-Peak | Monday - Friday 8am - 8pm | 0.233 $/kwh | 0.055 $/kwh |
| Off-Peak | Monday - Friday 12am-8am, 8pm-12am, 24/7 on weekends | 0.106 $/kwh | 0.47 $/kwh |
Your solar production is mostly On-Peak and a single Tesla Powerwall 2 has 11.5 kwh of storage so it usually fills up during the day and we use it's power to avoid paying for grid kwhs at night. Except, if we charge our EV or do other energy heavy things like a lot of cooking or laundry. In these cases our natural behavior makes us consume Off-Peak grid electricity (kwh) and we avoid doing energy intensive things during the day because the energy costs are so much higher (.23$ vs. .10$). With PwUsage we have more information to make decisions.
{{ Expand this to show screen shots which help make decisions based on ToU details }}
Tariff - A rate per kwh for electricity that you purchase from the grid and usually a separate rate for selling back to the grid.
Tariff Period - A range of time and the tariff it is being bill at. Example: Monday 8am-8pm Tariff: On-Peak
cmd/next-app/example.env to cmd/next-app/.envcmd/next-app/.env with your developer credentials.cd cmd/next-app
npm install
npm run dev
cmd/ios-app (see cmd/ios-app/README.md).If you're starting from an empty DB for the Next.js app:
Create the schema:
cd cmd/next-app
./create-db.sh
This creates cmd/next-app/pwusage.db with the required tables and foreign keys.
Point the app at it by setting DATABASE_URL (in cmd/next-app/.env or your shell), e.g.:
DATABASE_URL="file:pwusage.db"
Start the Next.js dev server:
cd cmd/next-app
npm install
npm run dev # start the web app
Authenticate via the UI (or copy an existing access token into AppSettings)
The GitHub Actions workflow (.github/workflows/ci.yml) automates building, testing, database backups, migrations, and deployments to Vercel.
To configure CI/CD, set the following secrets in your GitHub repository (Settings > Secrets and variables > Actions):
| Secret Name | Required For | Description |
|---|---|---|
DATABASE_URL | Production Migrations & Backups | The production PostgreSQL database connection string. Used to run migrations and perform backups before migrations. |
DEV_DATABASE_URL | Migration Verification & Previews | The development/preview PostgreSQL database connection string. Used to verify migrations on PRs and configure preview deployments. |
CRON_SECRET | Migrations | The API secret used to authorize sub-daily cron triggers. The migration job replaces the {{CRON_SECRET}} placeholder in SQL migration files with this secret at deploy time. |
BACKUP_BLOB_READ_WRITE_TOKEN | Database Backups | Read-write token for a private Vercel Blob store. Used to upload database backups before migrations run. Never use a public store: backups contain user data and Tesla tokens. |
VERCEL_TOKEN | Vercel Deployment | Vercel Personal Access Token used to authenticate deployments. |
VERCEL_ORG_ID | Vercel Deployment | Vercel Organization ID. |
VERCEL_PROJECT_ID | Vercel Deployment | Vercel Project ID. |
DISCORD_WEBHOOK | Notifications | Discord webhook URL used to send deployment status notifications. |