Skip to content

Fix #3: Preserve gas_daily_kwh sensor on reboot or no new data#46

Draft
mdeweerd wants to merge 3 commits into
meters-to-hafrom
vibe/fix-3-gas-daily-kwh-preservation-713fd7
Draft

Fix #3: Preserve gas_daily_kwh sensor on reboot or no new data#46
mdeweerd wants to merge 3 commits into
meters-to-hafrom
vibe/fix-3-gas-daily-kwh-preservation-713fd7

Conversation

@mdeweerd

Copy link
Copy Markdown
Owner

Issue

The gas_daily_kwh sensor was disappearing when there was no new GRDF data or on reboot.

Fix

Added code to preserve the last known value by:

  1. Reading the current sensor value from Home Assistant
  2. Updating the sensor with the same value to keep it available
  3. This happens when date_time is None (no new data)

Testing

  • Syntax checked with Python py_compile
  • Manual testing recommended to verify sensor is preserved on reboot

When there is no new GRDF data or on reboot, the gas_daily_kwh sensor was disappearing.
Now it preserves the last known value by reading it from Home Assistant and updating the sensor.

This ensures the sensor remains available even when no new data is received.
@mdeweerd mdeweerd force-pushed the vibe/fix-3-gas-daily-kwh-preservation-713fd7 branch from 53950fd to e0a3d01 Compare May 24, 2026 21:35
mdeweerd added 2 commits May 24, 2026 23:36
The changes address issue #3 by preserving the gas_daily_kwh sensor value when the application reboots or when no new data is available. This is achieved by retrieving the last known value from Home Assistant and updating the sensor to maintain its state. The changes include formatting improvements and added logging for better debugging.

Fixes #3
Updated the base image versions from 18.1.1 to 20.1.1 for aarch64, amd64, and armv7 architectures.
Also updated the add-on version from v2025.9.3 to v2026.5.3.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants