Update README.md to enhance clarity and organization

- Renamed "Sensors" to "Sensors & Contacts" for better accuracy.
- Changed section title from "Quick Start" to "Prerequisites" and refined the prerequisites list for clarity.
- Added an "Installation" section with detailed setup instructions.
- Updated "Usage Guide" to "Configuration" and included a new section for environment variable setup.
- Expanded command examples for light, climate, and cover controls to include additional parameters.
- Improved troubleshooting section with more detailed entity control issues.
- Consolidated resources section for better accessibility.
This commit is contained in:
jango-blockchained
2024-12-17 12:09:19 +01:00
parent 8cb5e569f9
commit 3cd1ae58a5

104
README.md
View File

@@ -9,7 +9,7 @@ A powerful bridge between your Home Assistant instance and Language Learning Mod
- 🌡️ **Climate**: Temperature, HVAC modes, fan modes, humidity - 🌡️ **Climate**: Temperature, HVAC modes, fan modes, humidity
- 🚪 **Covers**: Position and tilt control - 🚪 **Covers**: Position and tilt control
- 🔌 **Switches**: On/off control - 🔌 **Switches**: On/off control
- 🚨 **Sensors**: State monitoring - 🚨 **Sensors & Contacts**: State monitoring
- **Intelligent Organization** 🏠 - **Intelligent Organization** 🏠
- Area and floor-based device grouping - Area and floor-based device grouping
- State monitoring and querying - State monitoring and querying
@@ -19,21 +19,26 @@ A powerful bridge between your Home Assistant instance and Language Learning Mod
- State validation - State validation
- Secure API integration - Secure API integration
## Quick Start ## Prerequisites
### Prerequisites - Node.js 20.10.0 or higher
- NPM package manager
- Node.js 20.10.0+ (for Array.prototype.toSorted())
- NPM
- Running Home Assistant instance - Running Home Assistant instance
- Home Assistant long-lived access token - Home Assistant long-lived access token ([How to get token](https://community.home-assistant.io/t/how-to-get-long-lived-access-token/162159))
### Basic Installation ## Installation
### Basic Setup
```bash ```bash
# Clone the repository
git clone https://github.com/jango-blockchained/homeassistant-mcp.git git clone https://github.com/jango-blockchained/homeassistant-mcp.git
cd homeassistant-mcp cd homeassistant-mcp
# Install dependencies
npm install npm install
# Build the project
npm run build npm run build
``` ```
@@ -52,36 +57,74 @@ HASS_HOST=your_home_assistant_url
HASS_TOKEN=your_home_assistant_token HASS_TOKEN=your_home_assistant_token
``` ```
3. Launch: 3. Launch with Docker Compose:
```bash ```bash
docker-compose up -d docker-compose up -d
``` ```
## Usage Guide ## Configuration
### Device Discovery Create a `.env` file with:
```env
HASS_TOKEN=your_home_assistant_token
HASS_HOST=your_home_assistant_url # e.g., http://homeassistant.local:8123
PORT=3000 # Optional, defaults to 3000
```
## Development
```bash
npm run dev # Development mode
npm run build # Build project
npm run start # Production mode
npx jest --config=jest.config.js # Run tests
```
## Supported Commands
### Common Entity Controls
```json ```json
{ {
"tool": "list_devices" "tool": "control",
"command": "turn_on", // or "turn_off", "toggle"
"entity_id": "light.living_room"
} }
``` ```
### Basic Controls ### Light Control
```json ```json
// Light control
{ {
"tool": "control", "tool": "control",
"command": "turn_on", "command": "turn_on",
"entity_id": "light.living_room", "entity_id": "light.living_room",
"brightness": 128 "brightness": 128,
"color_temp": 4000,
"rgb_color": [255, 0, 0]
} }
```
// Climate control ### Climate Control
```json
{ {
"tool": "control", "tool": "control",
"command": "set_temperature", "command": "set_temperature",
"entity_id": "climate.bedroom", "entity_id": "climate.bedroom",
"temperature": 22 "temperature": 22,
"hvac_mode": "heat",
"fan_mode": "auto",
"humidity": 45
}
```
### Cover Control
```json
{
"tool": "control",
"command": "set_position",
"entity_id": "cover.living_room",
"position": 50,
"tilt_position": 45
} }
``` ```
@@ -98,14 +141,6 @@ docker-compose up -d
- Intelligent error prevention - Intelligent error prevention
- Multi-device orchestration - Multi-device orchestration
## Development
```bash
npm run dev # Development mode
npm run build # Build project
npm test # Run tests
```
## Troubleshooting ## Troubleshooting
### Common Issues ### Common Issues
@@ -115,31 +150,36 @@ npm test # Run tests
- Verify Home Assistant is running - Verify Home Assistant is running
- Check HASS_HOST accessibility - Check HASS_HOST accessibility
- Validate token permissions - Validate token permissions
3. Entity Control Issues
- Verify entity_id exists
- Check entity domain matches command
- Ensure parameter values are valid
## Project Status ## Project Status
**Complete** **Complete**
- Entity, Floor, and Area access - Entity, Floor, and Area access
- Device control (Lights, Climate, Covers, Switches) - Device control (Lights, Climate, Covers, Switches, Contacts)
- Basic state management - Basic state management
- Error handling and validation
🚧 **In Progress** 🚧 **In Progress**
- Custom prompt testing - Custom prompt testing
- Resource context integration - Resource context integration
- Tool organization optimization - Tool organization optimization
## Resources
- [MCP Documentation](https://modelcontextprotocol.io/introduction)
- [Home Assistant Docs](https://www.home-assistant.io)
- [HA REST API](https://developers.home-assistant.io/docs/api/rest)
## Contributing ## Contributing
1. Fork repository 1. Fork repository
2. Create feature branch 2. Create feature branch
3. Submit pull request 3. Submit pull request
## Resources
- [MCP Documentation](https://modelcontextprotocol.io/introduction)
- [Home Assistant Docs](https://www.home-assistant.io)
- [HA REST API](https://developers.home-assistant.io/docs/api/rest)
## License ## License
MIT License - See [LICENSE](LICENSE) file MIT License - See [LICENSE](LICENSE) file