Skip to content

more ❤️ for the integration implementation#4

Merged
fake666 merged 9 commits into
masterfrom
feature/modern-integration
Mar 15, 2026
Merged

more ❤️ for the integration implementation#4
fake666 merged 9 commits into
masterfrom
feature/modern-integration

Conversation

@fake666
Copy link
Copy Markdown
Owner

@fake666 fake666 commented Mar 15, 2026

rewrote the whole thing basically. was yaml-only, now has a config flow (UI setup). also fixed the protocol - turns out the status packet is 16 bytes, not 56. we were reading garbage from the next packet for half the sensors lol.

what changed:

  • config flow with connection test
  • DataUpdateCoordinator instead of blocking socket in event loop
  • single sensor class instead of 13 copy-paste classes
  • correct 16-byte protocol with frame markers
  • removed sensors that need active commands (buffer temps, chimney, fan etc)
  • added error sensor
  • yaml config gets auto-imported, shows a repair notice
  • tests (44 of them)
  • github actions CI
  • icon

if you have extra hardware modules (KS04 buffer storage, LUC chimney sensor, etc) and want to help: the integration currently only reads the base status packet. to add support for your module, open an issue with the raw packet log.

to get it, set the log level in your configuration.yaml:

  logger:
    logs:
      custom_components.ledatroniclt3: debug

then check your HA logs for lines like Status packet (16 bytes): ... and include what hardware you have and what values your stove is showing.

or if you're feeling adventurous, PRs welcome :)

fake666 added 9 commits March 15, 2026 19:16
Replace YAML-only setup with GUI config flow including connection test.
Introduce DataUpdateCoordinator with async-compatible socket handling
(timeout, context manager, executor job). Consolidate 13 copy-paste
sensor classes into a single SensorEntity + SensorEntityDescription list.

- Add proper device_info, unique_id, device classes, state classes
- Use native_value/native_unit_of_measurement (modern HA API)
- Replace deprecated device_state_attributes with extra_state_attributes
- Fix 2-byte parsing bug (was *255, now int.from_bytes big-endian)
- Add entity translations for stove states and fan states
- Bump version to 0.1.0
31 tests covering:
- Binary protocol parser: all stove states, fan states, 2-byte values, edge cases
- Config flow: form display, successful connection, connection failure, duplicate abort
- Sensor platform: entity creation, unique IDs, values, attributes, unload
Existing YAML configurations are automatically imported as config entries
on startup. A repair issue prompts the user to remove the YAML config.
Duplicate imports are silently aborted.
The old YAML config was a sensor platform entry (sensor: platform:
ledatroniclt3), not a top-level integration key. The import must
happen via async_setup_platform in sensor.py, not async_setup in
__init__.py. Also keeps the legacy PLATFORM_SCHEMA for validation.
The status packet is 16 bytes (framed by 0e ff ... 0d ff), not 56.
The old implementation read past the packet boundary, producing
garbage values for several sensors.

Protocol corrections from independent analysis:
- Read until 0d ff end marker instead of fixed 56 bytes
- Fix valve actual/target byte positions (byte 2=actual, 3=target)
- Firebed temperature is a 2-byte value (was read as single byte)
- Add error code sensor (overheating, motor fault, power fault, etc.)
- Add starting/initializing state
- Remove sensors that require command requests to the device:
  buffer temps, chimney temp, fan, burns, heating error count
  (these are optional expansion modules - contributions welcome)
- Use English state keys with proper translations
SVG source and PNG exports (256px + 512px hDPI) for use with
HACS and the home-assistant/brands repository.
@fake666 fake666 merged commit 18130a4 into master Mar 15, 2026
2 checks passed
@fake666 fake666 mentioned this pull request Mar 15, 2026
@fake666 fake666 deleted the feature/modern-integration branch March 16, 2026 16:25
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.

1 participant