Skip to content

RTK base station position_mode reports link mode but reads fix quality field #858

Description

@h3sim0

The problem

Title: RTK base station position_mode sensor decodes fix quality with RTKPositionMode enum

Description

The RTK base station exposes a position_mode sensor that reports a link mode (RTK_OVER_DATALINK / RTK_OVER_INTERNET), but the underlying field is the base station's RTK fix quality, not a link mode. The two values are decoded with the same enum, so the sensor shows a plausible-looking but incorrect state.

Details

There are two position_mode sensors, sourced from different fields:

  1. Mower device — custom_components/mammotion/sensor.py (~line 376):
value_fn=lambda mower_data: RTKPositionMode(
    mower_data.report_data.basestation_info.rtk_status
).name

This is correct. RTKPositionMode documents itself as decoding rpt_basestation_info.rtk_status, referencing SignalHelper.RTKPositionModeType from the APK.

  1. RTK base station device — custom_components/mammotion/sensor.py (~line 583):
value_fn=lambda rtk_data: RTKPositionMode(rtk_data.rtk_status).name

Here rtk_data is RTKBaseStationDevice. Its rtk_status field is documented in pymammotion/data/model/device.py as coming from base.to_app (ResponseBasestationInfoT) and meaning "RTK fix quality". The same docstring explicitly notes that the mower-side relay data lives on MowerDevice.report_data.basestation_info and not on this model.

So the same attribute name carries different semantics in the two structures, and the base station's fix quality is being decoded as a link mode.

Impact

On my setup the app is configured for "RTK over Datalink":

  • sensor.<mower>_position_modeRTK_OVER_DATALINK (correct)
  • sensor.<rtk>_position_modeRTK_OVER_INTERNET (incorrect)

A raw value of 1 maps to RTK_OVER_INTERNET in RTKPositionMode, while in RTKStatus the same value would be SINGLE. The sensor is misleading because the wrong value looks like a legitimate configuration state rather than an obvious error.

Suggested fix

Either decode RTKBaseStationDevice.rtk_status with the fix-quality enum (RTKStatus) and rename the sensor key accordingly (e.g. rtk_fix_quality), or drop the sensor if the field is not reliably interpretable. I could not determine from the code whether this field follows the RTKStatus value scale (0/1/2/4/5) or a different one — the docstring only says "fix quality" — so that likely needs confirmation against the APK or device traces.

Environment

  • Device: Luba mini 800 + RTK base station
  • RTK link mode configured in app: RTK over Datalink
  • Home Assistant: 2026.8.2
  • Mammotion-HA: v0.6.4

What Mammotion device are you using?

Luba mini AWD 800

What version of the Mammotion integration are you using?

v0.6.4

What version of Home Assistant Core are you running?

core-2026.8.2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions