Code Monkey home page Code Monkey logo

ha-must-inverter's Introduction

Must inverter integration for Home Assistant

GitHub Release GitHub Activity License Project Maintenance

Buy me a coffee!

Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.

The Home Assistant Must Solar Inverter Plugin is a custom integration that adds support for monitoring and controlling Must solar inverters within the Home Assistant platform. This plugin enables you to retrieve real-time data, such as power production, battery status, and more, directly from your Must solar inverter.

Features

  • Real-time Monitoring: View live data from your Must solar inverter, including power production, battery status, and other relevant information.
  • Integration with Home Assistant: Seamlessly integrate Must solar inverter data into your Home Assistant setup.
  • Control Functionality: Control certain aspects of your Must solar inverter directly through Home Assistant.
image image

Supported Devices

This integration is tested using a Must Solar PV18-3024 VPM (aka PV1800). However, it should work with other models that use the same communication protocol, such as the PH1800 and EP1800 series.

This integration will have the wrong min and max range for writable voltages when using it with 12v or 48v inverters (mostly because my model is 24v and I don't own other models to reverse engineer). If you see some values that don't make sense for your inverter, please open an issue or a pull request.

Disclaimer

This integration is not officially supported by Must Solar, I'm not affiliated with Must Solar in any way. This integration is based on reverse engineering the communication protocol used by the Must Solar inverters and by resources found online. Use it at your own risk.

Caution

There are some modbus registers that cannot be reversed to their original value after being written and can have a huge effect on the inverter operation, such as the calibration coefficients (these entities are disabled by default). This integration DOES NOT write any information to the device via modbus unless you manually change an entity value.

Installation

HACS (Home Assistant Community Store)

If you have HACS just search for Must Inverter and install it from there. Or alternatively, click here.

Manual Installation

  1. Download the latest release from the GitHub repository.
  2. Extract the downloaded archive.
  3. Copy the custom_components/must_inverter directory to your Home Assistant config directory.
  4. Restart Home Assistant.

After a correct installation, your configuration directory should look like this:

    └── ...
    └── configuration.yaml
    └── secrets.yaml
    └── custom_components
        └── must_inverter
            └── __init__.py
            └── config_flow.py
            └── const.py
            └── ...

Usage

  1. Open the Home Assistant UI.
  2. Navigate to "Configuration" -> "Integrations."
  3. Click the "+" button to add a new integration.
  4. Search for "Must Inverter" and select it.
  5. Enter the required configuration for your serial setup (USB, TCP, or UDP).

image

Support and Contributions

For bug reports, feature requests, or general questions, please create an issue on the GitHub repository.

Contributions are welcome! Feel free to fork the repository, make changes, and submit a pull request.

Acknowledgments

This plugin would not have been possible without the valuable contributions of the following individuals and their projects on reversing engineering the Must solar inverter:

Their efforts have paved the way for the development of this Home Assistant integration.

License

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


ha-must-inverter's People

Contributors

dependabot[bot] avatar mukaschultze avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ha-must-inverter's Issues

error reading modbus data at address ******

System Health details

System Information

version core-2024.1.6
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.11.6
os_name Linux
os_version 6.1.71-haos
arch x86_64
timezone Africa/Cairo
config_dir /config
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 4994
Installed Version 1.34.0
Stage running
Available Repositories 1382
Downloaded Repositories 16
Home Assistant Cloud
logged_in true
subscription_expiration July 14, 2024 at 3:00 AM
relayer_connected true
relayer_region us-east-1
remote_enabled true
remote_connected true
alexa_enabled false
google_enabled true
remote_server us-east-1-6.ui.nabu.casa
certificate_status ready
instance_id 087c330f972d4b5894898f6f7cff68ee
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 11.4
update_channel stable
supervisor_version supervisor-2023.12.1
agent_version 1.6.0
docker_version 24.0.7
disk_total 468.7 GB
disk_used 40.4 GB
healthy true
supported true
board generic-x86-64
supervisor_api ok
version_api ok
installed_addons Mosquitto broker (6.4.0), Log Viewer (0.17.0), Check Home Assistant configuration (3.11.0), File editor (5.7.0), Z-Wave JS (0.4.3), AirCast (4.2.0), Home Assistant Google Drive Backup (0.112.1), ESPHome (2023.12.9), Advanced SSH & Web Terminal (17.0.5), AdGuard Home (5.0.2), Samba share (12.2.0), DeepStack (2021.09.1), Exadel CompreFace (1.1.0), Filebrowser (2.23.0_12), Portainer (2.19.4-3), Double Take (1.13.11.8), Network UPS Tools (0.13.0), InfluxDB (5.0.0), Frigate (0.13.1)
Dashboards
dashboards 1
resources 5
views 8
mode storage
Recorder
oldest_recorder_run January 24, 2024 at 6:47 AM
current_recorder_run February 1, 2024 at 11:25 PM
estimated_db_size 321.76 MiB
database_engine sqlite
database_version 3.41.2
Sonoff
version 3.5.4 (a4a8c5f)
cloud_online 3 / 4
local_online 3 / 3

Checklist

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

I am always getting the following error after a few minutes of successfully connecting and getting data of the inverter

Logger: custom_components.must_inverter
Source: custom_components/must_inverter/init.py:211
Integration: Must Inverter (documentation, issues)
First occurred: February 1, 2024 at 11:26:30 PM (8555 occurrences)
Last logged: 1:23:45 PM

error reading modbus data at address 20001
error reading modbus data at address 20101
error reading modbus data at address 25201
error reading modbus data at address 15201
error reading modbus data at address 10101
Traceback (most recent call last):
File "/config/custom_components/must_inverter/init.py", line 211, in read_modbus_data
response = await self._client.read_holding_registers(address=register[0], count=register[1], slave=0x04)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pymodbus/client/mixin.py", line 107, in read_holding_registers
return self.execute(
^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pymodbus/client/base.py", line 147, in execute
raise ConnectionException(f"Not connected[{self!s}]")
pymodbus.exceptions.ConnectionException: Modbus Error: [Connection] Not connected[AsyncModbusSerialClient /dev/ttyUSB0:0]

I have used different methods and different adaptors, but getting the same issue
When i reload the integration, it fixes it for a few minutes, then stops again so I have to reload the integration again

I have made an automation to automatically reload the integration when getting this error from the log

I have a must PV1800 3k inverter, now connected through the RJ 45 port to a USB to RS485 Converter Adapter then to my HA instance

Reproduction steps

  1. Successfully connected to the inverter via RS485 and serial
    2.After a few minutes, i get the error reading modbus data at address 20001 etc
    3.have to reload the integration for it to pull data again from the inverter
    ...

Debug logs

Logger: custom_components.must_inverter
Source: custom_components/must_inverter/__init__.py:211
Integration: Must Inverter (documentation, issues)
First occurred: February 1, 2024 at 11:26:30 PM (8555 occurrences)
Last logged: 1:23:45 PM

error reading modbus data at address 20001
error reading modbus data at address 20101
error reading modbus data at address 25201
error reading modbus data at address 15201
error reading modbus data at address 10101
Traceback (most recent call last):
  File "/config/custom_components/must_inverter/__init__.py", line 211, in read_modbus_data
    response = await self._client.read_holding_registers(address=register[0], count=register[1], slave=0x04)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pymodbus/client/mixin.py", line 107, in read_holding_registers
    return self.execute(
           ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pymodbus/client/base.py", line 147, in execute
    raise ConnectionException(f"Not connected[{self!s}]")
pymodbus.exceptions.ConnectionException: Modbus Error: [Connection] Not connected[AsyncModbusSerialClient /dev/ttyUSB0:0]

Diagnostics dump

No response

Wrong numbers for 12v must

System Health details

Incorrect (for 12v invert.) adjustment values

Checklist

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

Hi there thanks for your awesome work.
As you said it shows correct numbers from direct reading but adjustment sliders correct for 24v model
Знімок екрана 2024-07-22 о 18 11 30

Reproduction steps

  1. Installed
    2.Connected
    3.Observed

Debug logs

no debug logs

Diagnostics dump

No response

ERROR (MainThread) [homeassistant] Error doing job: Exception in callback SerialTransport._read_ready()

System Health details

System Information

version core-2024.4.0
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.12.2
os_name Linux
os_version 6.6.16-haos
arch x86_64
timezone Europe/Kyiv
config_dir /config
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 5000
Installed Version 1.34.0
Stage running
Available Repositories 1400
Downloaded Repositories 7
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 12.0
update_channel stable
supervisor_version supervisor-2024.03.1
agent_version 1.6.0
docker_version 24.0.7
disk_total 30.8 GB
disk_used 10.0 GB
healthy true
supported true
board ova
supervisor_api ok
version_api ok
installed_addons Mosquitto broker (6.4.0), Z-Wave JS (0.4.5), Z-Wave JS UI (3.4.0), Studio Code Server (5.15.0), Advanced SSH & Web Terminal (17.2.0), Matter Server (5.4.1), Duck DNS (1.16.0), File editor (5.8.0), ESPHome (2024.3.1), Zigbee2MQTT (1.36.1-1), Log Viewer (0.17.0)
Dashboards
dashboards 2
resources 0
views 11
mode storage
Recorder
oldest_recorder_run March 25, 2024 at 06:02
current_recorder_run April 4, 2024 at 09:53
estimated_db_size 94.35 MiB
database_engine sqlite
database_version 3.44.2

Checklist

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

The installation process of this integration was fine.
But after a few mins I've noticed some lagging of HA in general. See more detail in the Debug logs section.
My MUST inverter has this name: Must 3000W 24V 60A (PV18-3024VPM)

Reproduction steps

  1. Common installation process integration
  2. Add all needed credentials (in this case it is USB or serial, another fields are default value)
  3. Enable this integration

Debug logs

return await component.async_unload_entry(entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 202, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
ValueError: aded!

2024-04-04 23:06:35.747 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Must Inverter for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 724, in async_unload
    result = await component.async_unload_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 145, in async_unload_entry
    return await component.async_unload_entry(entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 202, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!
2024-04-04 23:06:35.769 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Must Inverter for binary_sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 724, in async_unload
    result = await component.async_unload_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/binary_sensor/__init__.py", line 245, in async_unload_entry
    return await component.async_unload_entry(entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 202, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!
2024-04-04 23:06:35.791 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Must Inverter for number
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 724, in async_unload
    result = await component.async_unload_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/number/__init__.py", line 126, in async_unload_entry
    return await component.async_unload_entry(entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 202, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!
2024-04-04 23:06:35.850 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Must Inverter for select
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 724, in async_unload
    result = await component.async_unload_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/select/__init__.py", line 116, in async_unload_entry
    return await component.async_unload_entry(entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 202, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!
2024-04-04 23:06:35.882 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Must Inverter for switch
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 724, in async_unload
    result = await component.async_unload_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/switch/__init__.py", line 106, in async_unload_entry
    return await component.async_unload_entry(entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 202, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!
2024-04-04 23:06:35.960 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Must Inverter for button
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 724, in async_unload
    result = await component.async_unload_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/button/__init__.py", line 79, in async_unload_entry
    return await component.async_unload_entry(entry)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 202, in async_unload_entry
    raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!

Diagnostics dump

No response

How to connect inverter physically to Home Assistant OS (run on Raspberry Pi) to use your integration

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

Sorry for a dumb question im noob :). I put it here, cos i do not know how to ask a question in other way.

How to connect inverter physically to Home Assistant OS (run on Raspberry Pi) to use your integration. Should i use official usb wifi plug, or use some cables such as rj45 or usb cable to connect inverter to HA. Can you explane this, please. Thanks in advance

Describe the solution you'd like

Sorry for a dumb question im noob :). I put it here, cos i do not know how to ask a question in other way.

Describe alternatives you've considered

Sorry for a dumb question im noob :). I put it here, cos i do not know how to ask a question in other way.

Additional context

Sorry for a dumb question im noob :). I put it here, cos i do not know how to ask a question in other way.

Support for official wifi USB plug

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

https://pt.aliexpress.com/item/1005003231633440.html?spm=a2g0o.order_list.order_list_main.5.4426caa4cG0Xmp&gatewayAdapt=glo2bra

This is suposed to be MUST oficial wifi device.
SMART ESS is really poor as management and monitoring app.
Home Assistant should be better to monitor device

Describe the solution you'd like

Set host and port to use this adapter to monitor MUST PV-1800 over wifi
Home Assistant should be better to monitor device

Describe alternatives you've considered

SMART ESS APP is working fine

Additional context

If remote access is needed to this device over internet, i can arrange a NAT to ip address of developer to conect it.
20240325_201415
20240325_201437

possibility of adding online data registry option from the shinemonitor page

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

Hi, excellent work
Is it possible to add an online data registration option from the shinemonitor page?

https://solarmust.shinemonitor.com

if possible read online parameters of must inverter connect to internet

shinemonitor

Describe the solution you'd like

a possible solution for people who do not have the equipment in the same physical location as the home assistant device

Describe alternatives you've considered

use api for shinemonitor web page:

https://github.com/itsmariodias/shinemonitor-reporter-mqtt

Additional context

https://github.com/dylangmiles/docker-must-homeassistant/tree/main
another option

Add arrow direction bit flags properties

Please add new property Arrow Flag

25279 RO Arrow Flag bit   Refer to the frame Arrow Flag bit

Arrow Flag bit

Bit |   | meaning
0 | PVFlag | 0:Inexistence                   1:Existence
1 | LoadFlag | 0:Inexistence                   1:Existence
2 | BattFlag | 0:Inexistence                   1:Existence
3 | GridFlag | 0:Inexistence                   1:Existence
4 | PV-to-Machine-Arrow | 0:Disconnect                   1:PV-to-Machine
5 | Machine-to-Load-Arrow | 0:Disconnect         1:Machine-to-Load
6 | Machine-Batt-Arrow | 00:Disconnect 01:Machine-to-Batt 10:Batt-to-Machine 11:Connect
7
8 | Machine-Grid-Arrow | 00:Disconnect 01:Machine-to-Grid 10:Grid-to-Machine 11:Connect
9
10 | reserved |  
11 | reserved |  
12 | reserved |  
13 | reserved |  
14 | reserved |  
15 | reserved |  

image

PH1800_PV1800_EP1800_PV3500_EP3500_RS485_Modbud_RTU_communication.xlsx

Thanks a lot for support.

Speedup modbus response

Hello, pleae answer. How I can change scan_interval to less?. I see like 10-13 seconds between responses. Thanks a lot for help.

Add support for 10kW 48V inverters

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

First of all - Thanks for your work!

I got a PH1800 10048 hybrid inverter.
First it was connected to the cloud via stock dongle. Monitoring via SmartESS mobile app.
The app is pretty poor, but what was really weird, is that there were TWO devices instead of only ONE (since I got only one inverter).
First I thought is was a duplicate and deleted one of them. But after some time it has re-appeared.
Then I realized that one of those devices (second one) doesn't show any solar activity info. This is probably because I have PV connected only to 1st tracker, 2nd MPPT tracker is not in use.
And finally the amount of energy used from the Grid (according to 1st device) was way smaller then on the meter of my supplier company. But it was nearly equal to the sum of 1st+2nd devices.
So, looks like my inverter it basically 2 inverters combined in one.
This is pretty annoying, cuz I cannot get all info in one peace.

Yesterday I finally received modbus to wifi dongle. After some configurations I've managed to add my PH1800 to HA.
It found one device (which I thought was grate), but it seems like it is 1st device only.
So I don't get real info from inverter, only half.

Describe the solution you'd like

It would be nice either to have a possibility to add second device, and handle data merging in HA.

Describe alternatives you've considered

Or to combine the data in this integration, which I suppose is much harder to do.

Additional context

This is Smart ESS App
Screenshot_20240809_111501_SmartESS

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.