github 3dg1luk43/ha_creality_ws v0.6.5

8 hours ago

Release Notes (v0.6.5)

This release rolls up everything added since 0.6.4 (including items trialed in 0.6.5-alpha), with polish and docs.

Highlights

  • Image: Current print preview now attempted for all supported printers
    • Tries HTTPS, then HTTP at /downloads/original/current_print_image.png
    • Shows placeholder when not applicable; cached to avoid flicker
    • Fetches only when relevant (self-testing/printing)
    • Records attempted printer-local URLs in diagnostics (http_urls_accessed cache)
    • Removed previous K1-family only gating; all supported models attempt the path
  • Lovelace card UX
    • Power chip (optional): optimistic, pinned to the far right
    • Light chip: strictly mirrors HA entity state (no optimistic override)
    • Auto resource registration (storage mode); cache-busting supported
    • New card config keys: power, show_power_button to enable/position the Power chip
  • Diagnostics
    • Service ha_creality_ws.diagnostic_dump returns data in the UI and logs a backup file path
    • Includes printer-local HTTP URL attempts for support (no cloud; only printer-local endpoints)
  • Terminology
    • UI labels may use "Chamber" instead of "Box"; entity IDs and fields are unchanged

Other Improvements

  • Robust onboarding: waits briefly for model/hostname and promotes capabilities from early telemetry
  • Capability caching refinements: new chamber cache keys (_cached_has_chamber_sensor, _cached_has_chamber_control, _cached_max_chamber_temp) with legacy box_* mirrors preserved
  • Sensor label updates: "Box Temperature" → "Chamber Temperature" (UID box_temperature unchanged); "Max Chamber Temperature" display name (UID max_box_temp unchanged)
  • Number entity label updated for K2 chamber target control: "Chamber Target" (legacy unique_id retained)
  • Heuristic promotions when early telemetry exposes boxTemp/targetBoxTemp/maxBoxTemp and lightSw
  • Diagnostics crawl: shallow HTTPS/HTTP root fetch collects same-host href/src links; stores printer-local endpoints only
  • Persistent notification handling made fully async (awaited) to avoid task warnings
  • Model-specific camera handling (WebRTC for K2 family via built-in go2rtc; MJPEG otherwise)
  • Power button behavior clarified: optimistic window (~2s) then reconciles with HA state
  • Visual editor schema cleaned (removed duplicates; added new power fields)
  • Copilot instructions expanded (image platform, diagnostics URL cache, UI behavior)
  • Lint and minor cleanup (import ordering, duplicate key removal); ruff clean

Upgrading

  • If using the bundled card, perform a hard refresh after update:
    • Desktop: Ctrl+F5 (Windows/Linux), ⌘+Shift+R (macOS)
    • Mobile: App Settings → Reload resources
  • If you previously used YAML resources, verify the resource points to /ha_creality_ws/k_printer_card.js (type: module)

Known Notes

  • The preview image path is the commonly-used location; some non-standard firmwares may not expose it. The entity will show a placeholder in that case and record fetch attempts in diagnostics.
  • K2 WebRTC streaming requires Home Assistant 2025.11+ for native go2rtc. On older versions, configure an external go2rtc ≥ 1.9.11 in Options.

Lint / Tests / Compatibility

  • Tests: Pytest suite passing (tools/tests all green)
  • Lint: Ruff passes with no warnings/errors
  • Syntax: Full package compile successful
  • Backward compatibility: No changes to unique IDs or protocol field names; legacy box_* keys mirrored by new chamber_* keys; labels only adjusted for display

Bug Fixes

  • Fixed TypeError in diagnostic service (diagnostic_dump) where persistent_notification.async_create was incorrectly awaited, causing startup or service call failures. The function is now invoked without awaiting to ensure compatibility.

Entity Updates

This release standardizes entity metadata and domains for better HA interoperability:

  • Added device_class and native unit_of_measurement (or unit via HA modern attributes) to all temperature, distance, percentage, time, and progress sensors where applicable.
  • Light domain migration: switch.printer_lightlight.printer_light (light now exposes on/off with correct icon and can integrate with light groups/scenes).
  • Fan domain migration: number.fan_Xfan.fan_X (speed control now uses native fan percentage / preset features where supported).
  • Material used sensor enhanced:
    • Added distance device_class (e.g., filament length) and supports HA unit conversion (mm/m selection via UI if you adjust global length units).
  • Axis position sensors (X, Y, Z):
    • Added distance device_class and leverage HA unit conversion (e.g., mm ↔ cm if user changes length preference).
  • Ensured unchanged unique_ids during domain transitions; integration handles entity registry updates gracefully.
  • Internal zeroing logic preserved: when printer is off or stale, numeric sensors show 0 and text sensors show "N/A".

Light Entity Compliance

  • Added supported_color_modes={onoff} and color_mode=onoff to eliminate HA 2025.3 deprecation warning for lights without brightness/color.

Real-Time Flow Sensor Adjustment

  • Native unit retained as engineering unit mm³/s (molten filament volumetric flow).
  • Dropped device_class to prevent HA validation warnings (HA core does not list mm³/s among accepted volume_flow_rate units).
  • No unit conversion performed to keep values intuitive for printer users.

Support & Diagnostics

Use the ha_creality_ws.diagnostic_dump service from Developer Tools → Services to collect data for troubleshooting. You can copy the diagnostic data directly from the service response.

Thanks

@hawky358 for quick testing on K2 family
@holdestmade for great suggestions

What's Changed

Full Changelog: v0.6.4...v0.6.5

Don't miss a new ha_creality_ws release

NewReleases is sending notifications on new releases.