Improve WiButler 1 lights and button handling#13
Open
philw113 wants to merge 10 commits into
Open
Conversation
- Detect lights based on SWT/BRI_LVL components instead of only DimminActuators - Skip devices with "taster" or "reconnect" in the name when creating lights - Ignore BTNRECON in binary_sensor setup, keep only real button channels (BTN_0/BTN_1/BTN_A0/BTN_B0, …) - Tested with WiButler 1: lights now appear as light.*, buttons as binary_sensor.*, reconnect entities are gone
- Only register real button channels (BTN_0, BTN_1, BTN_A0, BTN_B0, …) as binary_sensors - Skip BTNRECON completely so reconnect status is not exposed as an entity - Result: push buttons stay as binary_sensor.*, reconnect entities disappear and can be removed in Home Assistant - Tested with WiButler 1: normal button behaviour is unchanged, UI is cleaner
CLAUDE.md, MODULES.md, FORK-NOTES.md added for integration with the srv-homelab workspace. Fork-Notes documents the divergence from upstream patrickweh/ha-wibutler (sync point cab4be0, two local commits, uncommitted climate.py work, deferred upstream merge). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Local work that has been running on the production HA instance for some time, now committed to the fork. Replaces the minimal climate.py with: - Comfort/Eco preset support via PRESET_COMFORT / PRESET_ECO - CTSP/ETSP setpoint discovery (with _prf_N_ profile variants) - RTSPMODE bonus path tried first; falls back to TSP write when device rejects the mode component (many devices return 422) - Eco fallback: TSP - 2.0 C when no ETSP component is exposed - Comfort fallback: 21.0 C default - FloorHeatingController added to supported device types - Tolerance-based preset state heuristic (+/- 0.5 C) - WebSocket update filtered by device_id (was missing) - Helper functions for raw <-> degC conversion ((raw/2)+10) - Clamp to MIN 5.0 / MAX 30.0 C Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Since HA Core 2026.5.x (Python 3.14 + newer aiohttp) the WibutlerHub
setup fails with JSONDecodeError around position 161320 when fetching
/api/devices on hubs with many devices. aiohttp's internal json()
decoder breaks the ~160 KB response. response.text() + json.loads
reads the whole body first and parses cleanly.
Symptom in HA logs:
File "custom_components/wibutler/api.py", line 81, in _request
return await response.json()
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 1 column 161321
Effect of bug: hub.get_devices() returns None -> all Wibutler entities
go unavailable on HA start.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
SUPPORT_BRIGHTNESS was removed from homeassistant.components.light
in HA Core 2026.5, causing the wibutler light platform to crash on
import with:
ImportError: cannot import name 'SUPPORT_BRIGHTNESS' from
'homeassistant.components.light'
Replaced with the modern color_mode API:
- Class attributes _attr_supported_color_modes = {ColorMode.BRIGHTNESS}
and _attr_color_mode = ColorMode.BRIGHTNESS
- Removed the obsolete supported_features property
Surfaced after the api.py JSONDecodeError fix (d21626d); previously
hidden because the JSON crash aborted setup before light.py imports.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Nachpflege nach Notion-REP-Anlage (Projekte-DB). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
PROJEKT-PLAYBOOK §12.4 Schritt 4 verlangt notify-on-failure.yml + Health-Check-Stub fuer service-Repos. Hier uebersprungen, da kein CI und der Live-Stand in der HA-VM laeuft, nicht im Repo. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Setzt die in ADR-001 dokumentierte Strategie um: - manifest.json: version 1.0.0 -> 1.0.1+philw113-fork-2026-05-19 (PEP-440-Build-Metadata-Suffix, von Semver-Vergleich ignoriert), documentation auf Fork-URL umgehaengt, codeowners um @philw113 erweitert - .github/workflows/upstream-watch.yml: Cron-Action (Mo 09:00 UTC) + workflow_dispatch. Fetcht patrickweh/main, vergleicht mit .github/upstream-last-seen, schickt ntfy bei neuen Commits, commited last-seen-SHA zurueck. - .github/upstream-last-seen: initial cf8916b (Patrick's "Bump version to 1.2.0" vom 2026-03-07) - docs/decisions/001-fork-pflege-strategie.md: ADR mit Optionen + Entscheidung + Implementierung + Konsequenzen - FORK-NOTES.md: Strategie-Sektion + Sync-Prozess + ueberarbeitete Commit-Liste, Convention-Abweichung-Block angepasst Naechster Schritt (User-Action): HACS-Custom-Repo von patrickweh/ha-wibutler auf philw113/ha-wibutler umstellen. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <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 improves support for WiButler 1:
SWT/BRI_LVL) instead of onlytype == "DimminActuators".lightentities.BTNRECONinbinary_sensorsetup so reconnect status is not exposed as an entity.Motivation / Problem
With WiButler 1 all my light actuators showed up only as
BTNRECON/binary_sensorin Home Assistant.There were no usable
light.*entities and a lot of “Reconnect” entities that don’t make sense in HA.What changed (files)
custom_components/wibutler/light.pylightentities when a device exposesSWTand/orBRI_LVLSUPPORT_BRIGHTNESS)custom_components/wibutler/binary_sensor.pyBTN_*(real buttons) onlyBTNRECONentirelyResult (tested on my setup)
Outcome:
light.*and can be switched/dimmed.binary_sensor.*.Breaking changes
None expected. Name-based skip is conservative and only filters obvious non-light devices.
Notes
Happy to adjust detection logic (e.g. component-only, stricter filters) if you prefer.