Skip to content

Activity log shows no history for numeric sensors #29

Description

@iTerminate

Symptom

Opening the activity log from a graph (a) shows history for a binary_sensor entity, but shows nothing (or "(no history available)") for a numeric sensor.* entity (e.g. a temperature sensor). Same gap on the main screen's a/i activity log.

--demo mode hides this bug entirely — its fake logbook fabricates on/off/open/closed entries for every requested entity_id, including numeric sensors.

Root cause

Every log surface (GraphPreviewScreen._load_events, HACLI._load_activity_log) is fed exclusively by HAClient.fetch_logbook. Home Assistant's logbook — both the REST /api/logbook endpoint and the WS logbook/get_events command — deliberately excludes "continuous" sensors (any sensor.* carrying unit_of_measurement/state_class) from its results. hatty isn't dropping anything client-side: logbook.normalize_entries only skips non-dict items, and the one domain branch in logbook.state_detail only affects the label of binary_sensor entries, never inclusion.

Fix

The data already exists — it's the same /api/history/period rows used to draw the plot. Synthesize logbook-shaped state entries from history for continuous sensors and merge them into the log on both surfaces, rendering the entity's unit in the line (e.g. 21.5 °C).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions