Files
pilot/pilot-v2/config.yaml
Gilles Soulier df871ddf6e Fix Home Assistant MQTT discovery compliance
This commit fixes several issues with the MQTT discovery payload to ensure
full compliance with Home Assistant's MQTT discovery specification and match
the working configuration from the v1 implementation.

Changes:
- Add payload_available ("online") and payload_not_available ("offline") fields
  to EntityConfig struct for proper availability handling in HA
- Make device_info parameters (manufacturer, model, sw_version, suggested_area)
  configurable via config.yaml instead of hardcoded values
- Remove incorrect device_class "power" from cpu_usage sensor (power is for Watts, not %)
- Update config.example.yaml with documented device_info fields

The discovery payload now correctly includes all required fields for HA to
properly register and display the device with its sensors and switches.

Tested on physical PC (asus) with MQTT broker at 10.0.0.3:1883.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-30 07:39:24 +01:00

48 lines
949 B
YAML

# Codex created 2025-12-29_0224
device:
name: $hostname
identifiers: ["$hostname"]
manufacturer: "Asus"
model: "Laptop"
sw_version: "2.0.0"
suggested_area: "Bureau"
mqtt:
host: "10.0.0.3"
port: 1883
username: ""
password: ""
base_topic: "pilot"
discovery_prefix: "homeassistant"
client_id: "$hostname"
keepalive_s: 60
qos: 0
retain_states: true
features:
telemetry:
enabled: true
interval_s: 10
commands:
enabled: true
cooldown_s: 5
dry_run: true
allowlist: ["shutdown", "reboot", "sleep", "screen"]
power_backend:
linux: "linux_logind_polkit" # or linux_sudoers
windows: "windows_service"
screen_backend:
linux: "gnome_busctl" # or x11_xset
windows: "winapi_session" # or external_tool
publish:
heartbeat_s: 30
availability: true
paths:
linux_config: "/etc/pilot/config.yaml"
windows_config: "C:\\ProgramData\\Pilot\\config.yaml"
# Codex modified 2025-12-29_0224