Major updates: - Complete Rust rewrite (pilot-v2/) with working MQTT client - Fixed MQTT event loop deadlock (background task pattern) - Battery telemetry for Linux (auto-detected via /sys/class/power_supply) - Home Assistant auto-discovery for all sensors and switches - Comprehensive documentation (AVANCEMENT.md, CLAUDE.md, roadmap) - Docker test environment with Mosquitto broker - Helper scripts for development and testing Features working: ✅ MQTT connectivity with LWT ✅ YAML configuration with validation ✅ Telemetry: CPU, memory, IP, battery (Linux) ✅ Commands: shutdown, reboot, sleep, screen (dry-run tested) ✅ HA discovery and integration ✅ Allowlist and cooldown protection Ready for testing on real hardware. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2.0 KiB
2.0 KiB
Tests MQTT (manuel)
Pre-requis
- Broker MQTT accessible
- Config YAML valide
- Lancement de
pilot-v2 - Outil de test:
scripts/mqtt_send.py(optionnel)
Checklist
- Availability:
pilot/<device>/availabilitypublieonline. - Status:
pilot/<device>/statuspublie un JSON valide, mis a jour sur le heartbeat. - Capabilities:
pilot/<device>/capabilitiespublie un JSON valide. - Telemetrie:
pilot/<device>/state/cpu_usage/memory_*/ip_address. - Power state:
pilot/<device>/state/power_state(on/off/sleep/unknown/idle). - Commandes:
pilot/<device>/cmd/shutdown/setpayloadOFF-> action (dry_run si active).pilot/<device>/cmd/reboot/setpayloadOFF-> action (dry_run si active).pilot/<device>/cmd/sleep/setpayloadOFF-> action (dry_run si active).pilot/<device>/cmd/screen/setpayloadON/OFF.
- Etats commandes:
pilot/<device>/state/shutdown->ONouOFF.pilot/<device>/state/reboot->ONouOFF.pilot/<device>/state/sleep->ONouOFF.pilot/<device>/state/screen->ONouOFF.
- HA discovery: entites visibles dans Home Assistant.
Exemples d'envoi
python3 scripts/mqtt_send.py --host 127.0.0.1 --port 1883 --device monpc --action shutdown --value OFF
python3 scripts/mqtt_send.py --host 127.0.0.1 --port 1883 --device monpc --action screen --value ON
Checklist pas a pas
- Lancer le binaire (ou
scripts/run_pilot.sh). - Verifier
availability:- Topic:
pilot/<device>/availability
- Topic:
- Verifier
status:- Topic:
pilot/<device>/status
- Topic:
- Verifier telemetrie:
- Topic:
pilot/<device>/state/cpu_usage
- Topic:
- Envoyer une commande OFF:
python3 scripts/mqtt_send.py --device <device> --action shutdown --value OFF
- Verifier l'etat commande:
- Topic:
pilot/<device>/state/shutdown
- Topic:
Notes
- En mode
dry_run: true, aucune action systeme n'est executee. - Verifier les logs pour confirmer la reception des commandes.