Add support for AL-KO smart charger devices (ALKO-CHARGER)#46
Open
budisek wants to merge 1 commit into
Open
Conversation
- Fix API category filter: remove hard-coded thingCategory=ALKO-ROBOLINHO
so all registered AL-KO IoT devices are fetched (chargers, batteries, etc.)
- Fix hasattr() checks across all platforms: properties are always defined
on ThingstateStateReported so hasattr() always returned True; replaced
with direct key checks on the raw .attributes dict
- Add comprehensive smart charger entities for model C38-4260 and similar:
- Sensors: input voltage (V), input frequency (Hz), charger error,
operation time, per-slot battery level (%), voltage (V), current (A),
temperature (°C), total charge cycles, RSSI
- Binary sensors: per-slot battery inserted, battery charging
- Switches: charger eco mode (reduced ~1.5 A current),
per-slot storage mode (ON = 60 % limit for winter storage,
OFF = 100 % full charge)
- Add debug WARNING log for non-mower devices to aid future device support
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support for AL-KO smart charger devices (e.g. C 200 Li 36V / model C38-4260) that are registered in the AL-KO inTOUCH app but were previously invisible in Home Assistant.
Root causes fixed
pyalkofetches devices withthingCategory=ALKO-ROBOLINHO, which silently excludes chargers and other non-mower device types. This PR overridesget_devices()in a subclass to remove the filter so all registered devices are returned.hasattr()checks — all attributes are defined as@propertyonThingstateStateReported, sohasattr()always returnedTrueregardless of what the device actually reports. Replaced throughout with direct key checks on the raw.attributesdict.New entities for smart chargers
Sensors
Binary sensors
Switches
Side effects on existing mower support
lawn_mower.py: fixed device filter so mower entities are not created for chargersbutton.py: fixed filter so Reset Blade Life button is not created for chargershasattr()→.attributeskey checks (no functional change for mowers, just correctness)Test plan
Device tested
AL-KO C 200 Li 36V Smart Charger (model
C38-4260, typeALKO-CHARGER)🤖 Generated with Claude Code