MCPcopy Index your code
hub / github.com/buggedcom/HASS-Data-Points

github.com/buggedcom/HASS-Data-Points @0.6.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.6.0 ↗ · + Follow
2,863 symbols 8,636 edges 745 files 306 documented · 11%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Data Points

Data Points

Record meaningful events in Home Assistant and analyze them directly alongside your entity history, long-term statistics, and chart annotations.

Home Assistant HACS Storybook License Release

Screenshot.png Screenshot2.png Screenshot3.png


Overview

Data Points is a Home Assistant integration for recording timestamped events and using them as analytical context across charts, lists, and a dedicated history page.

It helps you answer questions like:

  • What changed?
  • When did it change?
  • What system or entity was affected?
  • Was the change expected?
  • Does the related sensor behavior now look suspicious?

The integration bundles its Lovelace cards and panel frontend automatically. No separate Lovelace resource configuration is required.


Why Data Points is useful

A plain chart tells you what changed. Data Points helps you understand why it changed by combining:

  • raw measurements
  • long-term statistics
  • user-created or automation-created annotations
  • target-aware chart overlays
  • anomaly detection
  • historical date-window comparison

That makes it much easier to investigate heating behavior, energy usage, sensor faults, maintenance effects, occupancy-driven changes, and operational regressions over time.


What Data Points provides

  • Record custom datapoints from automations, scripts, dashboards, and Developer Tools
  • Attach datapoints to entities, devices, areas, or labels
  • Render datapoints directly on history, statistics, and sensor charts
  • Browse, search, edit, delete, and hide datapoints in a dedicated list card
  • Investigate entity history with target rows, per-target analysis options, and date-window comparisons
  • Create chart annotations directly from the chart while exploring data
  • Backend-powered anomaly detection to highlight suspicious behavior
  • Compare a current period against saved historical windows to find drift and regressions

Documentation

Topic Description
Cards & UI All six cards, the history panel, and YAML configuration examples
Recording Datapoints The record action, fields, automation patterns, and examples
History & Analysis Chart features, trend methods, anomaly detection, and date windows
Development Setup, build, tests, i18n, remote HA dev, WebSocket API, and CI

Translations

Data Points ships with both Home Assistant integration translations and frontend card/panel translations.

Included locales

  • English
  • Finnish
  • French 🤖
  • German 🤖
  • Spanish 🤖
  • Portuguese 🤖
  • Simplified Chinese 🤖

English is the source language. Finnish translations were written by a non-native speaker. All other bundled locales are machine-translated — they are usable defaults rather than fully reviewed translations. Improvements are very welcome.

  • Integration/service strings: custom_components/hass_datapoints/translations/*.json
  • Frontend component strings: custom_components/hass_datapoints/src/**/i18n/

Roadmap

Planned features

  • Multiple saved views — persist more than one named chart-and-panel state for reusable investigation setups.
  • Automatic historical period matching — find similar historical periods automatically so the panel can suggest or create date windows.
  • Chart-driven anomaly automation creation — turn chart analysis settings into Home Assistant automations for live monitoring.
  • Automatic anomaly-to-datapoint generation — generate datapoints when configured anomaly conditions are met.
  • Backfilling tools — create datapoints from recent history and long-term statistics after the fact.
  • Anomalies summary card — dedicated card for highlighting current anomalies with deep-links into the history view.
  • Drop-in replacements for HA sensor and statistics cards — equivalents that support datapoint overlays and richer contextual controls.

Themes

  • Operational memory — preserve and reuse saved investigative contexts.
  • Assisted comparison — reduce the manual work needed to find meaningful historical baselines.
  • From analysis to action — let anomaly configuration graduate into automations and auto-generated datapoints.
  • Dashboard-native investigation — bring anomaly surfacing into smaller cards for everyday dashboards.

Installation

HACS

  1. Open HACS.
  2. Go to Integrations.
  3. Add this repository as a custom repository with category Integration.
  4. Install Data Points.
  5. Restart Home Assistant.

Manual

Copy custom_components/hass_datapoints into:

config/custom_components/hass_datapoints

Then restart Home Assistant.


Setup

Add the integration from:

Settings → Devices & Services → Add Integration → Data Points

No YAML setup is required.


Quick start

Record a datapoint from Developer Tools → Actions:

action: hass_datapoints.record
data:
  message: "Heating schedule changed"
  entity_ids:
    - climate.living_room
    - sensor.living_room_temperature
  icon: mdi:radiator
  color: "#ff5722"

Then add the history card to a dashboard:

type: custom:hass-datapoints-history-card
title: Living room
entities:
  - sensor.living_room_temperature
hours_to_show: 72

See Recording Datapoints and Cards & UI for the full reference.

Extension points exported contracts — how you extend this code

RendererLike (Interface)
Minimal interface covering the ChartRenderer methods used in this file. [1 implementers]
custom_components/hass_datapoints/src/cards/sensor/sensor-chart/sensor-chart.ts
ChartHit (Interface)
Typed shape of a renderer hit returned by drawAnnotations*.
custom_components/hass_datapoints/src/cards/sensor/sensor-chart/sensor-chart.ts
LovelaceCardRegistration (Interface)
(no doc)
custom_components/hass_datapoints/src/register.ts
Window (Interface)
(no doc)
custom_components/hass_datapoints/src/register.ts
HTMLElementTagNameMap (Interface)
(no doc)
custom_components/hass_datapoints/src/molecules/collapsed-options-menu/collapsed-options-menu.ts

Core symbols most depended-on inside this repo

get
called by 466
custom_components/hass_datapoints/anomaly_cache.py
msg
called by 405
custom_components/hass_datapoints/src/lib/i18n/localize.ts
addEventListener
called by 317
custom_components/hass_datapoints/src/lib/workers/__tests__/history-analysis-client.spec.ts
normalizeHistorySeriesAnalysis
called by 88
custom_components/hass_datapoints/src/lib/domain/history-series.ts
set
called by 72
custom_components/hass_datapoints/anomaly_cache.py
createMockHass
called by 52
custom_components/hass_datapoints/src/test-support/mock-hass.ts
async_record
called by 50
custom_components/hass_datapoints/store.py
hexToRgba
called by 48
custom_components/hass_datapoints/src/lib/util/color.ts

Shape

Method 1,501
Function 815
Class 352
Interface 192
Route 3

Languages

TypeScript72%
Python28%

Modules by API surface

custom_components/hass_datapoints/src/panels/datapoints/datapoints.ts155 symbols
custom_components/hass_datapoints/src/cards/history/history-chart/history-chart.ts96 symbols
tests/test_websocket_api.py94 symbols
tests/test_sensor.py92 symbols
tests/test_anomaly_detection.py80 symbols
custom_components/hass_datapoints/sensor.py79 symbols
custom_components/hass_datapoints/src/lib/chart/chart-interaction.ts74 symbols
tests/test_store.py66 symbols
custom_components/hass_datapoints/src/lib/chart/chart-renderer.ts59 symbols
custom_components/hass_datapoints/src/atoms/interactive/range-timeline/range-timeline.ts56 symbols
tests/test_sensor_monitors.py51 symbols
custom_components/hass_datapoints/src/panels/datapoints/context/types.ts49 symbols

For agents

$ claude mcp add HASS-Data-Points \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact