Python library for Homevolt EMS devices
Project description
pyHomevolt
Python library for Homevolt EMS devices.
Get real-time data from your Homevolt Energy Management System, including:
- Voltage, current, and power measurements
- Battery state of charge and temperature
- Grid, solar, and load sensor data
- Schedule information
Install
pip install pyHomevolt
Example
import asyncio
import aiohttp
import homevolt
async def main():
async with aiohttp.ClientSession() as session:
homevolt_connection = homevolt.Homevolt(
ip_address="192.168.1.100",
password="optional_password",
websession=session,
)
await homevolt_connection.update_info()
device = homevolt_connection.get_device()
print(f"Device ID: {device.device_id}")
print(f"Current Power: {device.sensors['Power'].value} W")
print(f"Battery SOC: {device.sensors['Battery State of Charge'].value * 100}%")
# Access all sensors
for sensor_name, sensor in device.sensors.items():
print(f"{sensor_name}: {sensor.value} ({sensor.type.value})")
# Access device metadata
for device_id, metadata in device.device_metadata.items():
print(f"{device_id}: {metadata.name} ({metadata.model})")
await homevolt_connection.close_connection()
if __name__ == "__main__":
asyncio.run(main())
Example with context manager
import asyncio
import aiohttp
import homevolt
async def main():
async with aiohttp.ClientSession() as session:
async with homevolt.Homevolt(
ip_address="192.168.1.100",
password="optional_password",
websession=session,
) as homevolt_connection:
await homevolt_connection.update_info()
device = homevolt_connection.get_device()
await device.update_info() # Refresh data
print(f"Device ID: {device.device_id}")
print(f"Available sensors: {list(device.sensors.keys())}")
if __name__ == "__main__":
asyncio.run(main())
API Reference
Homevolt
Main class for connecting to a Homevolt device.
Homevolt(ip_address, password=None, websession=None)
Initialize a Homevolt connection.
ip_address(str): IP address of the Homevolt devicepassword(str, optional): Password for authenticationwebsession(aiohttp.ClientSession, optional): HTTP session. If not provided, one will be created.
Methods
async update_info(): Fetch and update device informationget_device(): Get the Device objectasync close_connection(): Close the connection and clean up resources
Device
Represents a Homevolt EMS device.
Properties
device_id(str): Device identifiersensors(dict[str, Sensor]): Dictionary of sensor readingsdevice_metadata(dict[str, DeviceMetadata]): Dictionary of device metadatacurrent_schedule(dict): Current schedule information
Methods
async update_info(): Fetch latest EMS and schedule dataasync fetch_ems_data(): Fetch EMS data specificallyasync fetch_schedule_data(): Fetch schedule data specifically
Data Models
Sensor
value(float | str | None): Sensor valuetype(SensorType): Type of sensordevice_identifier(str): Device identifier for grouping sensors
DeviceMetadata
name(str): Device namemodel(str): Device model
SensorType
Enumeration of sensor types:
VOLTAGECURRENTPOWERENERGY_INCREASINGENERGY_TOTALFREQUENCYTEMPERATUREPERCENTAGESIGNAL_STRENGTHCOUNTTEXTSCHEDULE_TYPE
Exceptions
HomevoltException: Base exception for all Homevolt errorsHomevoltConnectionError: Connection or network errorsHomevoltAuthenticationError: Authentication failuresHomevoltDataError: Data parsing errors
License
GPL-3.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file homevolt-0.1.0.tar.gz.
File metadata
- Download URL: homevolt-0.1.0.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c51435694c4e480181340a29c88c3d1386b5dec51bd3580cfc7e13a64d2cd6c
|
|
| MD5 |
d728ae5dfb4d8be102af23be3cd9d448
|
|
| BLAKE2b-256 |
af9cbfee3fcddd094fc7a1a92d92e0a3d16442f5a08bfad473699be22e7c1c18
|
File details
Details for the file homevolt-0.1.0-py3-none-any.whl.
File metadata
- Download URL: homevolt-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82357f60b47cb36def4e7e7b68c2c4d7e2923287c7a6624b90dbeed78086d756
|
|
| MD5 |
b530a36c331f2a07713982d8aa892f5a
|
|
| BLAKE2b-256 |
27be71dd0d397a967ecc4719da41c67d486a079edf240be8aaff7c16f4abcbb3
|