fix(sensor): read cleaning area from coveredArea, not a station timer#51
fix(sensor): read cleaning area from coveredArea, not a station timer#51jgus wants to merge 3 commits into
Conversation
working_status field 13 is totalDryStationBagTime (a cumulative station timer, constant 18000 = 5 h), which the sensor divided by 10000 and surfaced as a fixed "1.8 m²". The real per-session area is field 2 coveredArea (float32, m²). Decode it via _to_float32 and drop the ÷10000; correct the WorkingStatusField names from the decompiled proto. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Greptile SummaryThis PR fixes the Cleaning Area sensor, which was permanently stuck at 1.8 m² because it was reading protobuf field 13 (
Confidence Score: 5/5Safe to merge — the change is a targeted field-number correction with no impact on unrelated sensors or state. The fix is well-scoped: a wrong protobuf field number and an erroneous divisor are replaced with the correct field and no divisor. The Both copies of Important Files Changed
Sequence Diagram%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant Robot as Narwal Robot
participant MQTT as MQTT Broker
participant Client as NarwalClient
participant State as NarwalState
participant HA as Home Assistant Sensor
Robot->>MQTT: working_status proto message
MQTT->>Client: raw bytes
Client->>Client: blackboxprotobuf decode → dict
Client->>State: update_from_working_status(decoded)
State->>State: _to_float32(decoded["2"])
note over State: field 2 = coveredArea (float32, m²)
State->>State: "cleaning_area = area (float, m²)"
State->>HA: "value_fn: round(cleaning_area, 2) if > 0"
HA-->>HA: Display area in m²
note over State: Previously: int(decoded["13"]) / 10000
note over State: field 13 = totalDryStationBagTime (18000s) → always 1.8 m²
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant Robot as Narwal Robot
participant MQTT as MQTT Broker
participant Client as NarwalClient
participant State as NarwalState
participant HA as Home Assistant Sensor
Robot->>MQTT: working_status proto message
MQTT->>Client: raw bytes
Client->>Client: blackboxprotobuf decode → dict
Client->>State: update_from_working_status(decoded)
State->>State: _to_float32(decoded["2"])
note over State: field 2 = coveredArea (float32, m²)
State->>State: "cleaning_area = area (float, m²)"
State->>HA: "value_fn: round(cleaning_area, 2) if > 0"
HA-->>HA: Display area in m²
note over State: Previously: int(decoded["13"]) / 10000
note over State: field 13 = totalDryStationBagTime (18000s) → always 1.8 m²
Reviews (3): Last reviewed commit: "docs(working-status): correct workingPro..." | Re-trigger Greptile |
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
The decompiled WorkingStatus BuilderInfo marks workingProgress with PbFieldType 0x100 (float32), not double; fix the field-map docstring in both client copies. Also join the cleaning-area sensor comment to one line. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Summary
The Cleaning area sensor is permanently stuck at
1.8 m². It was readingworking_statusfield 13 — which istotalDryStationBagTime, a cumulativestation timer that sits at a constant
18000(5 h) — and dividing it by 10000,yielding a fixed
1.8. The real per-session figure is field 2,coveredArea(float32, m²).
Changes
coveredArea(field 2, float32) and drop the÷10000.WorkingStatusFieldnames to match the app's compiled protobuf(field 13 is the station-bag timer, not area).
How it was found
Field identities were read from the decompiled app's protobuf
BuilderInfo(field tag → name → wire type), then confirmed against live broadcasts.
Testing
tests/test_models.pyupdated; full suite green.