Skip to main content

franklinwh-ha-cloud-analytics

The FranklinWH cloud's energy reporting, shared by the FranklinWH bridges. It sits next to a bridge's own (local) analytics behind a Local / Cloud switch: the same controls, two different sources, and the page always says which one it is showing.

  • Periods: Day (5-min), Day (hourly), Week, Month, Year, Lifetime, with a date picker, ‹ › stepping and Today.
  • Filters: a chip per series to show or hide it; Line | Area | Bars for any period; stacked bars as an energy balance. All remembered in the browser.
  • Readout: hover or tap the chart for every value at that time.
  • Chart: home load, solar, battery (discharge +, charge −) and grid (import +, export −) in the site's time zone.
  • Totals: solar production (to home, battery, grid), battery flows (discharged by destination, charged by source), grid flows (imported / exported) and home load (by source), each value with how sure the source is of it.
  • History: imported into the bridge's own database (closed months once, the current month refreshed) for monthly, annual and lifetime totals, queries and download.

Status: phase 1 (periods, chart payload, panel). The phased plan is in direct-connect-bridge #215.

How a bridge uses it

The bridge keeps the cloud credentials, its routes and its database. This package makes the cloud calls through franklinwh-cloud, builds one payload per period, and ships a dependency-free panel the bridge mounts under its Analytics page.

import franklinwh_ha_cloud_analytics as ca

cache = ca.Cache()                       # one per bridge; keyed by gateway below

# GET /api/analytics/cloud?period=month&date=2026-11-05
payload = await ca.fetch(client, "month", date(2026, 11, 5), today=site_today,
                         cache=cache, key=gateway_id)

client is a logged-in franklinwh-cloud client for the gateway, and site_today is today's date in the site's own time zone. Serve ca.static_dir() at /cloud-analytics/, then:

<link rel="stylesheet" href="cloud-analytics/cloud-analytics.css">
<script src="cloud-analytics/cloud-analytics.js"></script>
<script>FWHCloudAnalytics.mount(el, {endpoint: "api/analytics/cloud",
                                    params: () => ({gateway: currentGatewayId})});</script>

mount() returns {reload(), exportData("csv" | "json"), setPeriod(p), period()}. A host with one period picker for its local and cloud views passes {periodPicker: false, period: p}, calls setPeriod(p) from its picker and remembers the period itself; the panel then draws no picker. FWHCloudAnalytics.PERIODS lists the periods as [value, label]. The host puts the export buttons where its own analytics has them; exportData downloads the shown period (fwh-cloud-<period>-<date>.csv), every series the cloud returned, empty where it has none.

python -m franklinwh_ha_cloud_analytics.demo serves the panel over made-up data.

Periods

Period Library call Chart
Day (5-min) get_power_by_day(day) lines, kW
Day (hourly) get_power_by_day(day), added up per hour bars, kWh
Week get_power_details(2, its Monday) bars per day, kWh
Month get_power_details(3, the 1st) bars per day, kWh
Year get_power_details(4, 1 January) bars per month, kWh
Lifetime get_power_details(5, today) bars per year, kWh

A Day request to get_power_details returns a single bucket, so both Day views read the 5-minute power. There, home, battery and grid are sums of the cloud's directional flows (solar → home, grid → battery, …), so they're marked derived (≈). Every series carries the weakest evidence rating of the fields it uses (franklinwh-cloud's field dictionary); INFERRED ones are labelled. No data stays null, never 0. Signs: battery discharge +, charge −; grid import +, export −.

Caching: a period that today falls in is kept for 5 minutes, a finished one for 6 hours. The cloud's rate limit is per account, shared with the FranklinWH app.

Licence

MIT

Metadata

Release files for franklinwh-ha-cloud-analytics 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for franklinwh-ha-cloud-analytics 0.1.6
File Size Uploaded Provenance Actions
franklinwh_ha_cloud_analytics-0.1.6.tar.gz 24.9 kB With provenance Details for franklinwh_ha_cloud_analytics-0.1.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for franklinwh-ha-cloud-analytics 0.1.6
File Interpreter ABI Platform Actions
franklinwh_ha_cloud_analytics-0.1.6-py3-none-any.whl Python 3 none any Details for franklinwh_ha_cloud_analytics-0.1.6-py3-none-any.whl

Total release size: 45.8 kB

Release files / franklinwh_ha_cloud_analytics-0.1.6.tar.gz

Download URL franklinwh_ha_cloud_analytics-0.1.6.tar.gz
Size 24.9 kB
Tags Source
SHA-256 checksum
How to use checksums
f2744f486bc827c7aab5174956377cb6dbb2ff2bb0e1ce71fac203e05a17b9d0
BLAKE2b-256 checksum
How to use checksums
8a7947d960d5d52a803937500342c7c9b2fcb2f62ef982c4c2982a5592d457fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.

Transparency log

Release files / franklinwh_ha_cloud_analytics-0.1.6-py3-none-any.whl

Download URL franklinwh_ha_cloud_analytics-0.1.6-py3-none-any.whl
Size 20.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dffb40c4acc76e31b5a5a06a43bfd1e17690dbb4b7301f5b3d7e67cbc923b72f
BLAKE2b-256 checksum
How to use checksums
908acf78e9f2818adc481ff690e54be81d36b8f4c1154dea0633b0bc094bc303
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.

Transparency log

Security for franklinwh-ha-cloud-analytics 0.1.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for franklinwh_ha_cloud_analytics-0.1.6.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page