Skip to content

Feature Request: Expose LWT as Binary Sensor via MQTT Auto-Discovery #241

@MiguelAngelLV

Description

@MiguelAngelLV

Describe the solution you'd like

lnxlink already publishes an MQTT LWT (Last Will and Testament) topic (ON / OFF) to indicate client availability. However, this is only used internally as an availability_topic and is not exposed as a standalone entity in Home Assistant.

To use the PC power state in automations, users must:

  • Manually create an MQTT sensor/binary_sensor, or
  • Rely on availability of other entities (less clear and harder to reuse)

Proposed Solution

Expose the LWT topic as a binary sensor via MQTT auto-discovery:

{
  "name": "PC Power State",
  "state_topic": "lnxlink/<hostname>/lwt",
  "payload_on": "ON",
  "payload_off": "OFF",
  "device_class": "running",
  "unique_id": "<hostname>_lwt"
}

Simpler automations (no manual config required)

  • Clear ON/OFF representation of PC state
  • More robust: MQTT LWT ensures it eventually switches to offline even after crashes
  • Better UX, especially for new users
  • Summary

Expose LWT as a binary sensor to provide a simple and reliable way to track PC power state in Home Assistant.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions