hoymiles-wifi/README.md

98 lines
3.3 KiB
Markdown
Raw Normal View History

2023-11-17 12:07:21 +00:00
# hoymiles-wifi
2023-11-20 13:40:09 +00:00
2024-03-01 08:57:32 +00:00
This Python library facilitates communication with Hoymiles HMS microinverters, specifically targeting the HMS-XXXXW-2T series.
2023-11-17 12:07:21 +00:00
2024-03-01 08:57:32 +00:00
**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.**
2023-11-20 13:40:09 +00:00
2023-11-17 12:07:21 +00:00
## Installation
```
2023-11-17 12:07:53 +00:00
$ pip install hoymiles-wifi
2023-11-17 12:07:21 +00:00
```
## Usage
You can integrate the library into your own project, or simply use it in the command line.
### Command line:
```
2024-02-12 09:13:39 +00:00
hoymiles-wifi [-h] --host HOST [--as-json] <command>
2023-12-20 08:51:49 +00:00
2024-01-30 11:14:52 +00:00
commands:
2024-01-29 11:03:22 +00:00
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,
2024-01-30 11:14:52 +00:00
firmware-update,
restart,
turn-on,
turn-off,
2024-02-06 15:44:15 +00:00
get-information-data,
2024-02-13 07:43:16 +00:00
get-version-info,
heartbeat,
2024-02-12 12:05:26 +00:00
The `--as-json` option is optional and allows formatting the output as JSON.
2023-11-17 12:07:21 +00:00
```
### Python code
```
from hoymiles_wifi.inverter import Inverter
2024-02-08 16:08:55 +00:00
...
inverter = Inverter(<ip_address>)
2024-02-08 16:08:55 +00:00
response = await inverter.<command>
2023-11-17 12:07:21 +00:00
if response:
2023-12-20 08:51:49 +00:00
print(f"Inverter Response: {response}")
2023-11-17 12:07:21 +00:00
else:
2023-12-20 08:51:49 +00:00
print("Unable to get response!")
2023-11-17 12:07:21 +00:00
```
2023-12-20 08:51:49 +00:00
#### Available functions
2024-02-12 08:25:22 +00:00
- `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`: Restart the inverter
- `async_turn_on`: Turn the inverter on
- `async_turn_off`: Turn the inverter off
2023-12-20 08:51:49 +00:00
2023-11-17 12:07:21 +00:00
## Note
Please be aware of the following considerations:
2023-12-06 18:15:04 +00:00
- No DTU Implementation: This library
retrieves information directly from the internal DTU of Hoymiles Wifi
2023-11-17 12:07:21 +00:00
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.
2023-11-20 13:40:09 +00:00
**Compatibility:** While developed for the HMS-800W-T2 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.
2024-01-11 13:09:14 +00:00
## Attribution
A special thank you for the inspiration and codebase to:
- [DennisOSRM](https://github.com/DennisOSRM): [hms-mqtt-publisher](https://github.com/DennisOSRM/hms-mqtt-publisher)
- [henkwiedig](https://github.com/henkwiedig): [Hoymiles-DTU-Proto](https://github.com/henkwiedig/Hoymiles-DTU-Proto)