This Python library facilitates communication with Hoymiles HMS microinverters, specifically targeting the HMS-XXXXW-T2 series.
Project description
hoymiles-wifi
This Python library facilitates communication with Hoymiles DTUs and the HMS-XXXXW-2T HMS microinverters, utilizing protobuf messages.
For the Home Assistant integration have a look here: https://github.com/suaveolent/ha-hoymiles-wifi
Disclaimer: This library is not affiliated with Hoymiles. It is an independent project developed to provide tools for interacting with Hoymiles HMS-XXXXW series micro-inverters featuring integrated WiFi DTU. Any trademarks or product names mentioned are the property of their respective owners.
Supported Devices
The library was successfully tested with:
- Hoymiles HMS-400W-1T
- Hoymiles HMS-800W-2T
- Hoymiles DTU-WLite
- Hoymiles DTU-Pro
Installation
$ pip install hoymiles-wifi
Usage
You can integrate the library into your own project, or simply use it in the command line.
Command line:
hoymiles-wifi [-h] --host HOST [--local_addr IP_OF_INTERFACE_TO_USE] [--as-json] <command>
commands:
get-real-data-new,
get-real-data-hms,
get-real-data,
get-config,
network-info,
app-information-data,
app-get-hist-power,
set-power-limit,
set-wifi,
firmware-update,
restart-dtu,
turn-on-inverter,
turn-off-inverter,
get-information-data,
get-version-info,
heartbeat,
identify-dtu,
identify-inverters,
identify-meters,
The `--as-json` option is optional and allows formatting the output as JSON.
Python code
from hoymiles_wifi.dtu import DTU
...
dtu = DTU(<ip_address>)
response = await dtu.<command>
if response:
print(f"DTU Response: {response}")
else:
print("Unable to get response!")
Available functions
async_get_real_data_new()
: Retrieve real-time dataasync_get_real_data_hms()
: Retrieve real-time dataasync_get_real_data()
: Retrieve real-time dataasync_get_config()
: Retrieve configuration informationasync_network_info()
: Retrieve network informationasync_app_information_data()
: Retrieve application information dataasync_app_get_hist_power()
: Retrieve historical power dataasync_set_power_limit(power_limit)
: Set the power limit of the inverter (0-100%)async_set_wifi(wifi_ssid, wifi_password)
: Configure the wifi networkasync_firmware_update()
: Update to latest firmwareasync_restart_dtu()
: Restart the DTUasync_turn_on_inverter()
: Turn the inverter onasync_turn_off_inverter()
: Turn the inverter offasync_get_information_data()
: Retrieve information dataasync_heartbeat()
: Request a heartbeat message from the DTU
Note
Please be aware of the following considerations:
- No DTU Implementation: This library retrieves information directly from the (internal) DTU of Hoymiles Wifi inverters.
Caution
Use this library responsibly and be aware of potential risks. There are no guarantees provided, and any misuse or incorrect implementation may result in undesirable outcomes. Ensure that your inverter is not compromised during communication.
Known Limitations
Update Frequency: The library may experience limitations in fetching updates, potentially around twice per minute. The inverter firmware may enforce a mandatory wait period of approximately 30 seconds between requests.
Compatibility: While developed for the HMS-800W-2T inverter, compatibility with other inverters from the series is untested at the time of writing. Exercise caution and conduct thorough testing if using with different inverter models.
Attribution
A special thank you for the inspiration and codebase to:
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 Distributions
Built Distribution
File details
Details for the file hoymiles_wifi-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: hoymiles_wifi-0.3.0-py3-none-any.whl
- Upload date:
- Size: 34.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb15e61fba84dd00ad49cdd491b9f27c3c521d21e203860c1afc6a60d08f6945 |
|
MD5 | 94c10c8d656c7d886c448a35475b5672 |
|
BLAKE2b-256 | b15afe794387871a7466a0d5a6a117606e442532a1e7f99bd2145ff6833c0c90 |