A modern Python gateway for interfacing with Rehau Neasmart 2.0 heating/cooling systems via Modbus protocol. Features a RESTful API, automatic data persistence, and comprehensive monitoring capabilities.
# Setup
python -m venv venv
source venv/bin/activate # or `venv\Scripts\activate` on Windows
pip install -r requirements.txt
# Configure
cp data/config.json.example data/config.json
# Edit data/config.json with your Modbus settings and zone structure
# Run
python src/main.py
# API available at http://localhost:5001
# Configure
cp data/config.json.example data/config.json
cp env.example .env
# Edit config.json and .env files
# Run
docker-compose up -d
# API available at http://localhost:5000
The gateway supports flexible configuration options:
Separate files for better organization:
config/
├── server.json # Modbus connection
├── zones.json # Building structure
├── api.json # API settings
└── features.json # Feature flags
Quick start:
cp -r config.example config
# Edit config/server.json and config/zones.json
Single file approach (still supported):
// data/config.json
{
"server": { "type": "tcp", "address": "192.168.1.100", "port": 502 },
"modbus": { "slave_id": 240 },
"structures": [
{
"base_id": 1,
"base_label": "First Floor",
"zones": [
{ "id": 1, "label": "Living Room" },
{ "id": 2, "label": "Kitchen" }
]
}
]
}
For deployment-specific values and secrets:
# Development
export NEASMART_DEBUG_MODE=true
export NEASMART_LOG_LEVEL=DEBUG
# Production
export NEASMART_API_KEY=your-secret-key
export NEASMART_DEBUG_MODE=false
export NEASMART_DATABASE_PATH=/var/lib/neasmart/registers.db
📖 Complete configuration guide: docs/guides/CONFIGURATION.md
The gateway provides a RESTful API for monitoring and controlling your heating/cooling system:
- Temperature monitoring - Read current zone temperatures
- Zone management - Control individual zones and get labels
- System health - Monitor gateway and Modbus connection status
- Pump operations - Control and monitor circulation pumps
- Mixed groups - Handle complex zone configurations
📖 Full API reference: docs/api/README.md
🚀 Interactive API docs: http://localhost:5001/docs
(when running)
# Setup development environment
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# Run tests
python -m pytest tests/
# Start development server with auto-reload
python src/main.py
📖 Development guide: docs/development/SETUP.md
📖 Quick commands: docs/development/QUICKSTART.md
- Configuration Guide - Complete configuration reference
- API Documentation - REST API reference
- Architecture Overview - System design and components
- Hardware Setup - Waveshare PoE Gateway setup
- Migration Guide - Upgrading from older versions
📖 All documentation: docs/README.md
- Modbus TCP/Serial - Connect via Ethernet or RS485
- RESTful API - JSON API with OpenAPI/Swagger documentation
- Data Persistence - SQLite database with automatic fallback
- Circuit Breaker - Automatic fault detection and recovery
- Health Monitoring - System status and diagnostics endpoints
- Docker Support - Production-ready containerized deployment
- Temperature Control - Multi-zone temperature management
- Pump Control - Circulation pump monitoring and control
Gateway won't start:
# Check configuration
python -c "from src.config import load_config; print('Config OK')"
# Check Modbus connection
telnet 192.168.1.100 502
API not accessible:
# Check if running
curl http://localhost:5001/health
# Check logs
tail -f data/gateway.log
No zone data:
- Verify
structures
array exists inconfig.json
- Check Modbus slave_id matches your device (usually 240 or 241)
- Ensure proper network connectivity to Modbus device
📖 Complete troubleshooting: docs/guides/CONFIGURATION.md#troubleshooting
Contributions are welcome! Please read our Contributing Guide first.
- Issues: GitHub Issues
- Discussions: GitHub Discussions
MIT License - see LICENSE file for details.