Skip to main content

Home automation monitoring suite for energy (HomeWizard), weather (OpenWeatherMap), and heating (Honeywell Evohome)

Project description

dvm-mesura - Home Automation Monitoring Suite

A comprehensive monitoring solution for home automation systems with energy meter polling, weather data collection, and SQLite storage.

Quick Start

Prerequisites

This project uses uv for dependency management.

# Install dependencies and create virtual environment
uv sync

# Install dependencies and create virtual environment
uv sync

# Run interactive setup to create .env
uv run mesura-all --setup

Configuration

Required .env File

Create a .env file in the monitor directory:

# Evohome Credentials
EVOHOME_EMAIL=your_email@example.com
EVOHOME_PASSWORD=your_password_here

# OpenWeatherMap API
OPENWEATHER_API_KEY=your_api_key_here

API Configuration

Energy Meter: Edit API_URL in src/dvm_mesura/energymeter.py:

API_URL = "http://p1meter-231dbe.local./api/v1/data"

Features and Usage

1. Energy Meter Polling

Continuously polls P1 Energy Meter API and logs data to SQLite and CSV.

Features:

  • Configurable polling intervals (10s to 120m)
  • CSV output with automatic flattening of nested JSON
  • SQLite database for time-series analysis
  • On-screen table display with key metrics
  • Interactive keyboard controls ('L' for header)

Usage:

# Default poll (1 minute)
uv run mesura-energy

2. Weather Data Collection

Fetches weather data from OpenWeatherMap API and correlates with heating data.

Features:

  • OpenWeatherMap API integration
  • CSV and SQLite logging with timestamps
  • Configurable polling intervals
  • Weather condition tracking

Usage:

# Default poll (10 minutes)
uv run mesura-weather

3. Room Temperature Polling

Fetches temperature data from Honeywell Evohome API.

Features:

  • Evohome TCC API integration
  • CSV and SQLite logging for room-level data
  • Standardized CLI arguments

Usage:

# Default poll (5 minutes)
uv run mesura-evohome

Unified vs Separate Databases

By default, all monitors share a single database:

  • sqlite3 data/monitor.db

Alternatively, you can use separate databases per monitor:

uv run mesura-all --separate

Command Line Overrides

All environment variables can be overridden via CLI flags:

  • --weather-key: OpenWeatherMap API Key
  • --evohome-user: Evohome Username
  • --evohome-pass: Evohome Password
  • --lat / --lon: Location coordinates
  • --data-dir: Data storage path

Auxiliary Scripts

mesura-combine-db

If you previously used separate databases or legacy scripts (e.g., weatherdata.db, rooms.db) and wish to migrate this historical data into the unified tracking file, use the utility script:

uv run mesura-combine-db --data-dir data --target-db monitor.db

This script intelligently automatically detects legacy databases matching predefined mappings (e.g., transferring rooms.db:readings into monitor.db:evohome). It inserts data while avoiding duplicate timestamps.

mesura-combine-csv

If you have legacy CSV files (energy.csv, weatherdata.csv, temp.csv, etc.) and want to migrate their data into the unified SQLite database, you can use:

uv run mesura-combine-csv --data-dir data --target-db monitor.db

Similar to the database merging script, it maps these CSVs to the appropriate tables (energy, weather, evohome) and automatically skips duplicate records based on timestamps.

mesura-export-csv

If you want to extract the data stored in the unified SQLite database back into raw CSV format (e.g., for external backups or analysis), you can use the export script. This script reads the tables from monitor.db and overwrites energy.csv, weather.csv, and evohome.csv in the data directory using identical database schemas.

uv run mesura-export-csv --data-dir data --source-db monitor.db

mesura-show

To quickly inspect the latest data in the database, you can use the mesura-show command. It displays the most recent rows for each table (energy, weather, evohome) in CSV format. By default, it shows the last 5 rows.

# Show the last 5 rows of all tables
uv run mesura-show

# Show the last 10 rows
uv run mesura-show -n 10

# Show a specific table
uv run mesura-show --table energy

This creates:

  • sqlite3 data/energy.db
  • sqlite3 data/weather.db
  • sqlite3 data/evohome.db

Folder Structure

monitor/
├── pyproject.toml     # Project metadata and dependencies
├── uv.lock           # Frozen dependencies
├── .env               # Environment variables (required)
├── .gitignore         # Git ignore file
├── logs/              # Log directory
├── src/               # Source code
│   └── dvm_mesura/   # Core package
│       ├── energymeter.py
│       ├── openweathermap.py
│       └── evohome.py
├── data/              # Data storage (SQLite & CSV files)
│   ├── energy.db / energy.csv
│   ├── rooms.db / rooms.csv
│   └── weatherdata.db / weatherdata.csv
├── tests/             # Unit tests
└── docs/              # Documentation

Data Flow

graph TD
    A[Monitor Scripts] --> B[CSV Storage]
    A --> C[SQLite Storage]
    B --> D[Historical Analysis]
    C --> E[Grafana / Business Intelligence]

Testing

Run tests using uv:

uv run pytest

Related Projects

  • evohome-async - Async client for Honeywell TCC API
  • SQLite - Relational database
  • Grafana - Visualization platform
  • Home Assistant - Home automation platform

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dvm_mesura-1.1.4.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dvm_mesura-1.1.4-py3-none-any.whl (26.3 kB view details)

Uploaded Python 3

File details

Details for the file dvm_mesura-1.1.4.tar.gz.

File metadata

  • Download URL: dvm_mesura-1.1.4.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dvm_mesura-1.1.4.tar.gz
Algorithm Hash digest
SHA256 20fd6ad1980dcdee391635bd2657229c7983e8f1652d29bab0c98e7f2e412c0a
MD5 305d1723aa7b4447ef6048ec4584c809
BLAKE2b-256 f9086f86c1471ff55f18b96df9744f02452ca2afcb4f592dfd2dffd052f6c6dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for dvm_mesura-1.1.4.tar.gz:

Publisher: publish.yaml on divyavanmahajan/monitor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dvm_mesura-1.1.4-py3-none-any.whl.

File metadata

  • Download URL: dvm_mesura-1.1.4-py3-none-any.whl
  • Upload date:
  • Size: 26.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dvm_mesura-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 44eb08e5b5ffd5d9838d2738012540b6ab425cfc72dbfc94e55e635c62e0cee3
MD5 a63a8856fd7da91d99afeabb823121bd
BLAKE2b-256 839cc4d0e157404e73b46379b935581d2722135df049b315db7a001d87e39e4a

See more details on using hashes here.

Provenance

The following attestation bundles were made for dvm_mesura-1.1.4-py3-none-any.whl:

Publisher: publish.yaml on divyavanmahajan/monitor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page