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 robust, unified monitoring solution for home automation systems. It tracks energy usage (HomeWizard), weather data (OpenWeatherMap), and heating/room temperatures (Honeywell Evohome) while storing everything in a centralized SQLite database.

Table of Contents


📦 Installation

This project uses uv for high-performance dependency management.

Method 1: Global Tool (Recommended)

Install dvm-mesura as a global CLI tool on your system:

uv tool install dvm-mesura

Method 2: Local Development

Clone the repository and sync dependencies:

uv sync

🛠 Setup Wizard & Configuration

The suite requires configuration for API keys and credentials. You can handle this easily using the interactive Setup Wizard.

Running the Wizard

# If installed as a tool
mesura-all --setup

# If running locally
uv run mesura-all --setup

The wizard will guide you through:

  • Energy Meter: API URL and polling interval.
  • Weather: OpenWeatherMap API Key, coordinates, and interval.
  • Evohome: Username/Email, Password, and interval.
  • Data Storage: Preferred directory and database mode (Unified vs. Separate).

Configuration Variables

All settings are stored in a .env file in the project directory.

Environment Variable Description CLI Override Default
DATA_DIR Directory for databases/CSVs --data-dir data
ENERGY_API_URL HomeWizard P1 API URL --energy-api http://p1meter-231dbe.local./api/v1/data
ENERGY_INTERVAL Polling frequency --energy-interval 1m
OPENWEATHER_API_KEY OpenWeatherMap API Key --weather-key [None]
WEATHER_INTERVAL Polling frequency --weather-interval 10m
LATITUDE Site latitude --lat 50.83172
LONGITUDE Site longitude --lon 5.76712
EVOHOME_USERNAME Honeywell TCC Username --evohome-user [None]
EVOHOME_PASSWORD Honeywell TCC Password --evohome-pass [None]
EVOHOME_INTERVAL Polling frequency --evohome-interval 5m
SEPARATE_DBS Store data in separate files --separate false

🚀 Usage & CLI Options

Running the Suite

The primary entry point is mesura-all, which starts all configured monitors concurrently.

# Start all monitors
mesura-all

# Run with overrides
mesura-all --energy-interval 30s --separate

Individual Monitors

You can also run monitors independently:

  • mesura-energy: Only Energy Meter
  • mesura-weather: Only OpenWeatherMap
  • mesura-evohome: Only Honeywell Evohome

Inspecting Data

Use mesura-show to quickly view recent database records in CSV format.

# Show last 5 rows of all tables
mesura-show

# Show last 10 rows of weather data
mesura-show --table weather -n 10

🖥 macOS Background Daemon

To run mesura-all continuously in the background (even after restarts), use the built-in mesura-daemon tool.

1. Installation

During installation, the wizard will run to ensure your variables are correct. It will also ask if you want to embed settings directly into the system plist (useful for headless environments).

# Standard install
mesura-daemon --install

# Install if using uvx
uvx dvm-mesura mesura-daemon --install --uvx

2. Management Commands

Command Action
mesura-daemon --check Verify if the daemon is running
mesura-daemon --logs Tail the last 20 lines of daemon output/errors
mesura-daemon --unload Temporarily stop the daemon
mesura-daemon --start Restart an unloaded daemon
mesura-daemon --uninstall Completely remove the daemon from macOS
mesura-daemon --env-check Troubleshoot: Show .env path and active variables

3. Troubleshooting: "Operation not permitted"

macOS TCC (Privacy Protections) blocks background daemons from reading sensitive folders like ~/Documents, ~/Desktop, or ~/Downloads.

If your logs show PermissionError: [Errno 1] Operation not permitted, move your project folder to a non-protected location:

mv ~/Documents/projects/monitor ~/mesura
cd ~/mesura
mesura-daemon --install

4. Troubleshooting: SSL Errors / DigiCert CA

On older versions of macOS, the DigiCert High Assurance Root CA might be missing from the system keychain, leading to SSL errors when connecting to tccna.resideo.com (Evohome).

If you see SSL/TLS certificate verification warnings:

  1. Ensure the SSL_CERT_FILE environment variable is set to your certifi bundle path.
  2. Manually append the DigiCert CA to your bundle:
# Append DigiCert CA to the certifi bundle
curl -L https://cacerts.digicert.com/DigiCertHighAssuranceEVRootCA.pem >> $(uv run python -c "import certifi; print(certifi.where())")

The mesura-daemon tool automatically configures SSL_CERT_FILE in the background for you, and the setup wizard (--setup) will check if this certificate is present.


🛠 Auxiliary Utilities

Migration Tools

  • mesura-combine-db: Migrates historical data from legacy .db files (weatherdata.db, etc.) into the unified monitor.db.
  • mesura-combine-csv: Imports existing CSV logs into the SQLite database while skipping duplicates.

Export Tools

  • mesura-export-csv: Extract SQLite data back into original CSV format for backups or external analysis.

🧪 Testing

Run the comprehensive test suite using pytest:

uv run pytest

The suite includes coverage for polling logic, database schema evolution, and API mocking.

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.6.tar.gz (17.4 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.6-py3-none-any.whl (27.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dvm_mesura-1.1.6.tar.gz
  • Upload date:
  • Size: 17.4 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.6.tar.gz
Algorithm Hash digest
SHA256 f1168b93d057a2398d7a74a9b34dfdbcacf9b1426de56cdf1bfe7c371457e628
MD5 520405a9ce4fddbf4fa05f821188473f
BLAKE2b-256 c69f17e8dcade43361a12bf808948986aa712639db4f9ec1c7e8435c9041e79e

See more details on using hashes here.

Provenance

The following attestation bundles were made for dvm_mesura-1.1.6.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.6-py3-none-any.whl.

File metadata

  • Download URL: dvm_mesura-1.1.6-py3-none-any.whl
  • Upload date:
  • Size: 27.5 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 73c792796a399fe9d276c4d3556de17252684404d637f02a3c827092851ab724
MD5 b2f735954a588a241ae2bf4c1803242f
BLAKE2b-256 130ec8c21e2fb5fbe41d4c42fb0b19d945c70c1595c999afaad9dff528656404

See more details on using hashes here.

Provenance

The following attestation bundles were made for dvm_mesura-1.1.6-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