# Changelog

All notable changes to the Domotz MCP Server will be documented in this file.

## [0.1.0] - 2025-06-16

### Added
- **Major Feature**: Persistent MQTT message storage using SQLite database
- New `mqtt_query` tool for querying stored MQTT messages with filtering by topic, time range, and connection
- New `mqtt_subscriptions` tool for managing subscriptions and database settings
- Automatic message storage for all persistent subscriptions
- Configurable message retention policy (default: 7 days)
- Database statistics and monitoring capabilities
- Support for MQTT wildcard pattern matching in queries

### Changed
- Completely redesigned `mqtt_subscribe` tool with persistent storage by default
- Added `persistent` parameter to mqtt_subscribe (defaults to true)
- Subscriptions now continue collecting messages in the background
- Messages are automatically stored in SQLite database for later retrieval

### Fixed
- Fixed MQTT topic pattern matching for wildcards (+ and #)
- Improved subscription management and cleanup

## [0.0.25] - 2025-06-16

### Fixed
- Fixed error response handling in MQTT tools to prevent validation errors
- Changed Promise rejections to resolved error responses to comply with MCP protocol
- Added automatic protocol detection for MQTT broker URLs
- Added debug logging for MQTT connection attempts

### Changed
- Improved error handling to return proper JSON responses instead of throwing errors
- Added URL validation and protocol prefixing for MQTT connections

## [0.0.24] - 2025-06-16

### Fixed
- Fixed MQTT and Home Assistant tool registration issues
- All tools now properly extend MCPTool base class
- Updated tool schemas to use Zod validation
- Resolved "Invalid tool found: missing required properties" warnings

### Changed
- Migrated MQTT tools (mqtt_connect, mqtt_publish, mqtt_subscribe) to use MCPTool base class
- Migrated Home Assistant tools (ha_discover, ha_control) to use MCPTool base class
- Improved consistency across all tool implementations

## [0.0.23] - 2025-06-16

### Added
- Published package to npm registry
- Made available via npx execution

## [0.0.22] - 2025-01-15

### Changed
- Updated documentation with complete MCP configuration examples
- Added environment variable placeholders for MQTT and Home Assistant
- Clarified optional vs required configuration parameters
- Updated USAGE.md with comprehensive setup instructions

## [0.0.21] - 2025-01-15

### Added
- MQTT Integration:
  - `mqtt_connect`: Connect to MQTT brokers with authentication support
  - `mqtt_subscribe`: Subscribe to topics with wildcard support and QoS levels
  - `mqtt_publish`: Publish messages to control IoT devices
- Home Assistant Integration:
  - `ha_discover`: Discover all entities, devices, and areas in Home Assistant
  - `ha_control`: Control Home Assistant entities (lights, switches, climate, etc.)
- Extended IoT device management capabilities
- Support for real-time data streaming via MQTT
- Comprehensive examples for MQTT and Home Assistant usage

### Changed
- Updated README with IoT integration features section
- Added new keywords: mqtt, home-assistant, smart-home

## [0.0.20] - 2025-01-15

### Changed
- Updated package description to mention BMS and IoT monitoring
- Added BMS and IoT-related keywords
- Updated README to clarify BMS features and experimental status

## [0.0.19] - 2025-01-15

### Added
- BMS (Building Management System) integration tools:
  - `bms_connect`: Connect to BMS controllers and discover data points
  - `bms_monitor`: Continuous monitoring with historical data tracking
- Support for multiple BMS controller types (Trend Controls, Honeywell, Johnson Controls)
- HTTP/HTTPS protocol support for web-based BMS interfaces
- Experimental BACnet and Modbus protocol support (requires further development)
- Historical data storage for monitored data points (last 1000 records)
- Automatic alarm detection and status tracking
- Dashboard server for BMS monitoring visualization

### Changed
- Extended MCP server capabilities beyond Domotz API to include IoT/BMS integration

## [0.0.18] - 2025-01-15

### Added
- Command-line argument support for API key (`--api-key=`)

### Fixed
- Version number consistency in index.ts

## [0.0.16-0.0.17] - 2025-01-15

### Fixed
- Various MCP protocol compatibility improvements
- Tool parameter handling

## [0.0.15] - 2025-01-15

### Fixed
- Fixed version mismatch in index.ts (was hardcoded to 0.0.13)
- Server now properly declares tools capability
- Fixed TypeScript compilation issues
- Resolved MCP client connection issues

### Added
- Added comprehensive test scripts for MCP server validation
- Added USAGE.md documentation
- Added .npmignore to exclude unnecessary files from npm package

### Changed
- Updated all tools to use consistent parameter types (string instead of number)
- Improved error handling in tools
- Enhanced logging for better debugging

## [0.0.14] - 2025-01-15

### Fixed
- Initial fixes for MCP server compatibility

## [0.0.13] - 2025-01-15

### Added
- Initial release with Domotz API integration
- Basic tools for agent management and data retrieval
- Core Domotz API integration tools:
  - `get_all_agents`: List all Domotz agents with pagination
  - `get_agent`: Get specific agent details
  - `get_domotz_data`: Generic API endpoint access
  - `bind_webhook`: Configure webhook notifications

## [0.0.12] - 2025-01-14

### Fixed
- Tool discovery issues with mcp-framework
- Error handling improvements

## [0.0.11] - 2025-01-14

### Changed
- Migrated to mcp-framework for automatic tool discovery
- Improved project structure

## [0.0.10] - 2025-01-14

### Fixed
- Package configuration for npm distribution
- Executable permissions

## [0.0.9] - 2025-01-14

### Added
- `bin` field to package.json to enable `npx` execution

### Fixed
- Package executable configuration

## [0.0.8] - 2025-01-14

### Fixed
- Server initialization issue with mcp-framework
- Removed example tool

### Changed
- Improved error handling

## [0.0.7] - 2025-01-13

### Added
- Initial release with basic Domotz API integration
- MCP server implementation using stdio transport
- Environment variable configuration for API credentials