Skip to main content

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-2T 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-800W-2T
  • Hoymiles DTU WLite

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 [--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

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 data
  • async_get_real_data_hms(): Retrieve real-time data
  • async_get_real_data(): Retrieve real-time data
  • async_get_config(): Retrieve configuration information
  • async_network_info(): Retrieve network information
  • async_app_information_data(): Retrieve application information data
  • async_app_get_hist_power(): Retrieve historical power data
  • async_set_power_limit(power_limit): Set the power limit of the inverter (0-100%)
  • async_set_wifi(wifi_ssid, wifi_password): Configure the wifi network
  • async_firmware_update(): Update to latest firmware
  • async_restart_dtu: Restart the DTU
  • async_turn_on_inverter: Turn the inverter on
  • async_turn_off_inverter: Turn the inverter off
  • async_get_information_data: Retrieve information data
  • async_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


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

hoymiles_wifi-0.2.3-py3-none-any.whl (37.0 kB view details)

Uploaded Python 3

File details

Details for the file hoymiles_wifi-0.2.3-py3-none-any.whl.

File metadata

File hashes

Hashes for hoymiles_wifi-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8d4a1909365a229bf1afb40655aa7ee54eeae995ef6a6c0bb9212b57935af90c
MD5 699cbe98d0be01bd31c16fd83d202534
BLAKE2b-256 954a88bba2b100bd45219cbbf57765670b14640fa9c1c62c74572799a7b022a3

See more details on using hashes here.

Supported by

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