Skip to main content

StaticBadge

License PyPI version Supported Python versions PyPI downloads Code style: ruff Linter: ruff pre-commit.ci status Dependabot Updates

mausy5043-common

A Python 3.12+ library providing common functions and classes for interacting with various devices and services, including HomeWizard energy monitors, Sessy home batteries, SQLite3 databases, and meteorological calculations.

Requirements

  • Python 3.12 or higher
  • Dependencies: numpy, pandas, pyarrow, python-homewizard-energy, sessypy, zeroconf

NOTE: Before using the SQLite3 functions, ensure the SQLite3 server/client and default Python package are installed.

Installation

python3 -m pip install mausy5043-common

Modules

funfile

File operation utilities.

  • cat(file_name: str) -> str: Read a file into a variable.

funmeteo

Meteorological calculations and conversions.

  • moisture(temperature, relative_humidity, pressure) -> np.ndarray: Calculate moisture content of air (kg/m³).
  • wet_bulb_temperature(temperature, relative_humidity) -> float: Calculate wet bulb temperature (°C).
  • saturation_vapor_pressure(temperature) -> ArrayLike: Compute saturation vapor pressure (hPa).
  • dew_point_temperature(temperature, relative_humidity) -> ArrayLike: Compute dew point temperature (°C).
  • relative_humidity_t2(T1, RH1, T2) -> ArrayLike: Calculate new relative humidity after a temperature change.

libsqlite3

SQLite3 database interaction.

  • SqlDatabase: A class to interact with SQLite3 databases, supporting data queuing, insertion, and retrieval.

funzeroconf

ZeroConf service discovery for network devices.

  • discover_devices(search_time: float = 60.0) -> dict: Discover services on the network using Zeroconf.
  • get_ip(service: str, filtr: str = "", timeout: float = 60.0) -> list[str]: Retrieve IP addresses for a given service.
  • prune_services(devices: dict, services: list[str]) -> dict: Filter devices by supported services.
  • filter_properties(devices: dict, service: str, filtr: str) -> dict: Filter devices by property contents.

funhomewizard

HomeWizard energy monitor integration.

  • HomeWizard_V1: Class for interacting with HomeWizard P1-dongle (API v1).
  • HomeWizard_V2: Class for interacting with HomeWizard devices (API v2).
  • MyHomeWizard: High-level class to discover and connect to HomeWizard devices, supporting both API versions.

funsessy

Sessy home battery integration.

  • Sessy_v1: Class for interacting with Sessy batteries (API v1).
  • MySessyBattery: High-level class to connect and retrieve data from Sessy batteries.

Usage Examples

Meteorological Calculations

from mausy5043_common.funmeteo import moisture, wet_bulb_temperature

# Calculate moisture content
temperature = 25.0  # °C
relative_humidity = 60.0  # %
pressure = 1013.25  # hPa
moisture_content = moisture(temperature, relative_humidity, pressure)

# Calculate wet bulb temperature
wet_bulb = wet_bulb_temperature(temperature, relative_humidity)

SQLite3 Database

from mausy5043_common.libsqlite3 import SqlDatabase

db = SqlDatabase(
    database="example.db",
    table="measurements",
    insert="INSERT INTO measurements VALUES (?, ?, ?)",
)
db.queue({"timestamp": "2024-01-01", "value": 42})
db.insert()

HomeWizard Integration

from mausy5043_common.funhomewizard import MyHomeWizard

hw = MyHomeWizard(serial="YOUR_SERIAL", token="YOUR_TOKEN", debug=True)
hw.connect()
measurement = hw.get_measurement()

Sessy Battery Integration

from mausy5043_common.funsessy import MySessyBattery

battery = MySessyBattery(ip="192.168.1.100", user="admin", token="password", debug=True)
battery.connect()
measurement = battery.get_measurement()

ZeroConf Discovery

from mausy5043_common.funzeroconf import discover_devices, get_ip

# Discover all devices
devices = discover_devices(search_time=30.0)

# Get IP addresses for HomeWizard devices
homewizard_ips = get_ip(service="_homewizard", filtr="HWE-P1")

License

This project is licensed under the MIT License - see LICENSE for details.

Release files for mausy5043-common 2.13.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mausy5043-common 2.13.3
File Size Uploaded
mausy5043_common-2.13.3.tar.gz 123.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mausy5043-common 2.13.3
File Interpreter ABI Platform
mausy5043_common-2.13.3-py3-none-any.whl Python 3 none any Details

Total release size: 153.1 kB

Release files / mausy5043_common-2.13.3.tar.gz

Download URL mausy5043_common-2.13.3.tar.gz
Size 123.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d20be26f9151ce332c9742e02bc10163dff1763517afa5ffd62a002c236ce3cd
BLAKE2b-256 checksum
How to use checksums
32f6853746c866ce59c49a60ceef4360718e93e82af1a6c79712a3bfc7b77b1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / mausy5043_common-2.13.3-py3-none-any.whl

Download URL mausy5043_common-2.13.3-py3-none-any.whl
Size 29.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
76fc841b3bd37279f9b1bc5863cccff3ae673b5b693a8735a05432b488c3f5f9
BLAKE2b-256 checksum
How to use checksums
39f7e41b24ea486d66b8b2bd812247c3cc70b8c4547cc1a14a81ace8c5f571fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

2.13.3 This release

2 release files

2.12.4

2 release files

2.12.2

2 release files

2.12.1

2 release files

2.11.7

2 release files

2.11.6

2 release files

2.11.3

2 release files

2.11.2

2 release files

2.11.1

2 release files

2.10.6

2 release files

2.10.5

2 release files

2.10.4

2 release files

2.10.3

2 release files

2.10.2

2 release files

2.10.1

2 release files

2.8.2

2 release files

2.6.1

2 release files

2.4.6

2 release files

2.4.5

2 release files

2.4.4

2 release files

2.4.3

2 release files

2.4.2

2 release files

2.4.1

2 release files

2.2.7

2 release files

2.2.6

2 release files

2.2.5

2 release files

2.2.4

2 release files

2.2.3

2 release files

2.2.2

2 release files

2.2.1

2 release files

2.1.1

2 release files

1.12.2

2 release files

1.10.1

2 release files

1.8.2

2 release files

1.8.1

2 release files

1.6.8

2 release files

1.6.7

2 release files

1.6.6

2 release files

1.6.5

2 release files

1.6.2

2 release files

1.6.1

2 release files

1.4.10

2 release files

1.4.9

2 release files

1.4.8

2 release files

1.4.7

2 release files

1.4.4

2 release files

1.4.3

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page