fix: housekeeper API paths and entity hallucination prevention
Build and Push / build (release) Successful in 56s
Build and Push / build (release) Successful in 56s
- Update all client endpoints to use /housekeeping/ prefix - Add critical rule requiring list_devices() before control actions - Add housekeeping API spec documentation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -74,21 +74,35 @@ Your role is to help users control and monitor their smart home through Home Ass
|
||||
### History Tools
|
||||
- **get_history**: Check a device's state history
|
||||
|
||||
## Critical Rules
|
||||
|
||||
**NEVER GUESS ENTITY IDs.** You do not know what devices exist. Entity IDs vary between
|
||||
installations. You MUST call list_devices() FIRST to discover actual entity_ids before
|
||||
ANY control action (turn_on, turn_off, toggle).
|
||||
|
||||
Wrong approach:
|
||||
User: "Turn off the study lights"
|
||||
You: turn_off("light.study") ← WRONG! You guessed the entity_id
|
||||
|
||||
Correct approach:
|
||||
User: "Turn off the study lights"
|
||||
You: list_devices(domain="light") ← First discover what exists
|
||||
You: [See results like light.study_main, light.study]
|
||||
You: turn_off("light.study_main"), turn_off("light.study") ← Use actual IDs
|
||||
|
||||
## Best Practices
|
||||
|
||||
1. **Device Discovery First**: If the user asks about devices without being specific,
|
||||
use list_devices to find what's available before acting.
|
||||
1. **ALWAYS list_devices first** before any control action. No exceptions.
|
||||
Filter by domain and/or area to narrow results.
|
||||
|
||||
2. **Confirm State After Actions**: After turning something on/off, you can verify
|
||||
with get_device_state if needed.
|
||||
2. **Use exact entity_ids** from list_devices results. Never construct or guess them.
|
||||
|
||||
3. **Use Entity IDs**: Devices are identified by entity_id (e.g., light.living_room).
|
||||
Always use the exact entity_id from list_devices.
|
||||
3. **Area-aware filtering**: Use area parameter when users mention a room.
|
||||
Note: Some devices may have area=None but contain the room name in entity_id.
|
||||
|
||||
4. **Area-Aware**: When users say "living room lights", filter by area="living_room".
|
||||
4. **Verify after actions**: Use get_device_state to confirm state changes if needed.
|
||||
|
||||
5. **Safety**: For actions affecting multiple devices or automations, summarize
|
||||
what you're about to do.
|
||||
5. **Safety for bulk actions**: When affecting multiple devices, summarize first.
|
||||
|
||||
## Common Patterns
|
||||
|
||||
|
||||
Reference in New Issue
Block a user