hass.tibber_prices/docs/developer
Julian Pawlowski 51a99980df feat(sensors)!: add configurable median/mean display for average sensors
Add user-configurable option to choose between median and arithmetic mean
as the displayed value for all 14 average price sensors, with the alternate
value exposed as attribute.

BREAKING CHANGE: Average sensor default changed from arithmetic mean to
median. Users who rely on arithmetic mean behavior may use the price_mean attribue now, or must manually reconfigure
via Settings → Devices & Services → Tibber Prices → Configure → General
Settings → "Average Sensor Display" → Select "Arithmetic Mean" to get this as sensor state.

Affected sensors (14 total):
- Daily averages: average_price_today, average_price_tomorrow
- 24h windows: trailing_price_average, leading_price_average
- Rolling hour: current_hour_average_price, next_hour_average_price
- Future forecasts: next_avg_3h, next_avg_6h, next_avg_9h, next_avg_12h

Implementation:
- All average calculators now return (mean, median) tuples
- User preference controls which value appears in sensor state
- Alternate value automatically added to attributes
- Period statistics (best_price/peak_price) extended with both values

Technical changes:
- New config option: CONF_AVERAGE_SENSOR_DISPLAY (default: "median")
- Calculator functions return tuples: (avg, median)
- Attribute builders: add_alternate_average_attribute() helper function
- Period statistics: price_avg → price_mean + price_median
- Translations: Updated all 5 languages (de, en, nb, nl, sv)
- Documentation: AGENTS.md, period-calculation.md, recorder-optimization.md

Migration path:
Users can switch back to arithmetic mean via:
Settings → Integrations → Tibber Prices → Configure
→ General Settings → "Average Sensor Display" → "Arithmetic Mean"

Impact: Median is more resistant to price spikes, providing more stable
automation triggers. Statistical analysis from coordinator still uses
arithmetic mean (e.g., trailing_avg_24h for rating calculations).

Co-developed-with: GitHub Copilot <copilot@github.com>
2025-12-08 17:53:40 +00:00
..
docs feat(sensors)!: add configurable median/mean display for average sensors 2025-12-08 17:53:40 +00:00
src docs: Add BMC logo SVG file to the images directory 2025-12-06 02:35:39 +00:00
static chore: Update logo and icons for Tibber Prices Integration 2025-12-07 19:00:32 +00:00
versioned_docs/version-v0.21.0 docs: add version snapshot v0.21.0 and cleanup old versions [skip ci] 2025-12-07 21:05:21 +00:00
.gitignore git commit -m "feat(docs): add dual Docusaurus sites with custom branding and Giscus integration 2025-12-06 01:37:06 +00:00
docusaurus.config.ts chore: Update logo and icons for Tibber Prices Integration 2025-12-07 19:00:32 +00:00
package-lock.json git commit -m "feat(docs): add dual Docusaurus sites with custom branding and Giscus integration 2025-12-06 01:37:06 +00:00
package.json git commit -m "feat(docs): add dual Docusaurus sites with custom branding and Giscus integration 2025-12-06 01:37:06 +00:00
README.md git commit -m "feat(docs): add dual Docusaurus sites with custom branding and Giscus integration 2025-12-06 01:37:06 +00:00
sidebars.ts feat(coordinator): implement repairs system for proactive user notifications 2025-12-07 20:51:43 +00:00
tsconfig.json git commit -m "feat(docs): add dual Docusaurus sites with custom branding and Giscus integration 2025-12-06 01:37:06 +00:00
versions.json docs: add version snapshot v0.21.0 and cleanup old versions [skip ci] 2025-12-07 21:05:21 +00:00

Website

This website is built using Docusaurus, a modern static website generator.

Installation

yarn

Local Development

yarn start

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

Build

yarn build

This command generates static content into the build directory and can be served using any static contents hosting service.

Deployment

Using SSH:

USE_SSH=true yarn deploy

Not using SSH:

GIT_USER=<Your GitHub username> yarn deploy

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the gh-pages branch.