Skip to content

[FEATURE] Improve service UX: Replace mower_serial text input with dynamic dropdown selector #51

Description

@WhyLev

## Is your feature request related to a problem?

Currently, all services that target a specific mower require users to manually enter the mower's serial number as a text field. This creates several problems:

  1. Typing errors – Users frequently mistype the 16-character alphanumeric serial number, causing service calls to fail with "No mower instance found" errors.
  2. Poor user experience – Users must remember or look up their mower's serial number, which is not user-friendly.
  3. No validation – The text field doesn't validate if the entered serial exists, leading to runtime errors.
  4. Multiple mowers confusion – With multiple mowers, users have to know which serial belongs to which mower, increasing cognitive load.
  5. Security risk – Users might accidentally target the wrong mower due to typos.

This is particularly frustrating for users who have multiple mowers or for new users who are still learning the integration.


## Describe the solution you'd like

Replace the text input for mower_serial with a dynamic dropdown selector in all services:

UI Changes

Before (Text input):

┌──────────────────────────────────────────────────┐
│ Serialnumber: [______________________________]  │
└──────────────────────────────────────────────────┘

After (Dropdown):

┌──────────────────────────────────────────────────┐
│ Mower: [▼ 0123456789ABC ]                       │
│        ├─ 0123456789ABC (Front Garden)          │
│        ├─ 9876543210DEF (Back Garden)           │
│        └─ 1122334455GHI (Side Garden)           │
└──────────────────────────────────────────────────┘

Technical Implementation

  1. Update services.yaml: Change all mower_serial selectors from text to select with dynamic options:

    mower_serial:
      name: Mower
      description: Select the mower you want to control.
      required: false
      selector:
        select:
          options: []
          custom_value: true
          mode: dropdown
  2. Fallback logic: The existing find_instance_for_mower_service_call() already handles None correctly:

    • If only one mower is configured → automatically uses that mower
    • If multiple mowers are configured → dropdown shows all options
  3. Service names: Change "Serialnumber" to "Mower" for better UX

  4. Optional manual input: Keep custom_value: true so users can still manually type a serial if needed (e.g., for testing or scripts)

Services Affected

  • command
  • smartmowing
  • delete_alert
  • delete_alert_all
  • read_alert
  • read_alert_all
  • download_map
  • set_calendar_slot
  • set_predictive_mowing_window
  • border_cut

## Describe alternatives you've considered

  1. Keep text input but add validation – Could validate on the backend and return better error messages, but still requires manual typing.
  2. Auto-detect single mower – Already implemented. If only one mower exists, use it automatically. But for multiple mowers, users still need manual input.
  3. Add service targets – Home Assistant has service targets, but they are less flexible and don't solve the discovery issue.
  4. Device-based service calls – Let users call services directly on the device entity (like Lawn Mower entity). This already works for some services but not all.

Why the dropdown is better:

  • No typing required, eliminates typos
  • Shows all available mowers clearly
  • Users see the mower names (if configured)
  • Consistent with Home Assistant's design patterns
  • Works in UI, automations, and scripts

## Additional context

User Benefits

  • For single mower users: Field is optional, auto-selects the only mower
  • For multiple mower users: Clear dropdown with all options visible
  • For automation users: Can still use mower_serial as text in YAML (backward compatible)
  • For new users: No need to find the serial number

Design Principles

  • Discoverability: Users immediately see available mowers
  • Error prevention: No typos possible
  • Efficiency: One click instead of typing 16 characters
  • Flexibility: Still supports manual entry if needed

Activity

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

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions