New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add growatt_rs232 integration for Growatt inverter with RS232 modbus #37846
Add growatt_rs232 integration for Growatt inverter with RS232 modbus #37846
Conversation
It seems you haven't yet signed a CLA. Please do so here. Once you do that we will be able to review and accept this pull request. Thanks! |
I notice references in the text that will be displayed by the integration, as well as in the main documentation, to a "USB port". I'd like to suggest the this integration follow the precedent of other serial integrations and simply refer to the RS232 port, omitting any mention of USB, since there are plenty of machines that don't require USB converters. At most, a single reference to the possibility of a USB<>RS232 converter would suffice on the documentation page. |
@mrand Thanks for the valuable feedback Your question touches 2 interesting points: In my example below, I have both an RS232 and RS485 usb adapter attached to my rpi. Both showing as a serial. Hardware I wonder though how many people have native serial interfaces. I guess most installations would be rpi based. To use the built-in serial, you need at least a converter chip (such as the max232) attached to the uart for RS232 because of the voltage difference. It is far easier to just use an usb rs232 adapter. A top scorer will also be old computers. I checked my own quite extended junkyard and none has a serial connection any more. So most likely also a lot of usb dongles there too. Industrial sbc’s will most likely have serial interfaces but will be more for the enthusiasts who really know what they are doing. From this my assumption would be that usb serial adaptors are the most used and will only be increasing in the future. Home assistant started in the enthusiast space but is making big efforts to make it easy to use for people without a lot of background. Plug and play. You get a rpi with a case, connect a usb dongle so you don’t have to mess with a hat that does not fit in your shiny new case and no need to worry about raspi-config setting. Move away from yaml and to config flow. From that perspective, starting with the simple usb dongle case but also providing the advanced information would make more sense but I agree it can be prased better so I’ll look into it. Maybe the easiest would be to make a page like the i2c https://www.home-assistant.io/hassio/enable_i2c/ that all serial integrations could refer to for consistency and deduplication. Another thing that comes to mind As I have also seen in some discussions, /dev/ttyUSB0 is not always guaranteed fixed to a specific device which could lead to hard to find issues were serial devices to swap /dev/ttyxxxx links. Let’s gather some feedback from the community on this. BTW same for spi. By researching serial I stumbled upon a very nice config flow that lists the available ports for the user. Core/homeassistant/components/zha/config_flow.py Certainly something to look at for a future version when I have some more time available. To pre-empt another possible remark. Initial growatt inverters only had a serial RS232 db9 connector using a proprietary communication protocol (also used for firmware updates and such) In later firmware versions they started using the rs485 modus protocol on their RS232 db9 connector specified in Growatt PV Inverter Modbus RS485 RTU Protocol V3.14 On later hardware versions a dedicated RS485 connector has been added in addition to the RS232 serial db9 connector. From what I can see in the documentation both provide the same functionality but they use RS485 on their integration boxes so I can imagine the RS232 db9 connection disappearing in the future. For maximum compatibility (and because I have an old inverter without RS485 port) I’ve called it RS232. This is also what is marked on the box and in the documentation. To use the RS485, you need a RS485 usb adapter which are less common than RS232 adapters. I guess everything else work exactly the same but I can’t test it. To be added if someone can confirm. Maybe it is better to call the integration growatt_serial then. There is also a growatt_server that uses the Growatt cloud service. |
Wow - wasn't expecting such a detailed reply! I'm going to pick out a few key points:
That makes sense to me, especially if it supports models which support RS485.
I mostly agree, but it still seems wrong to me to have multiple mentions for something that isn't even required, never mind the inconsistency with other serial integrations.
Yep, it's a known challenge with regard to Linux, the discussion of which I think is beyond the scope of HA integration pages maybe except for a very brief suggestion (maybe labelled "advanced topic"?) to set up a persistent name to prevent it from changing (with maybe with an link to more info on the topic). |
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want integrations for the same brand and device to use the same integration domain. So this should be combined with the existing growatt_server
integration.
Give the user an option to choose between the network and rs233 connection and then set up the correct logic depending on the user choice. It will require a refactor of the existing growatt_server integration first with adding a config flow and config entries. Probably rename to just growatt
.
@MartinHjelmare
|
I don't think it will be confusing. It will be the first question we ask the user, network or rs232. We can also document differences in our docs. |
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. |
Hi, I have a growatt 5000tl xe converter and connector with rs485 output. I am willing to test this "integration" to get logging local. What do I need to do? Where do I need to start? |
There hasn't been any movement for a month here. I'll close now. We're trying to decrease our open PR buffer. Please open a new PR when ready to finish. Thanks! |
Hum. Sorry not sure what you are asking here. I need some help... It was very hard to even find this here, so do not know how and where to start from now. |
My comment was aimed at the PR author. |
Hi @ArdescoConsulting, |
Once Sadly i will be unable to help with that part, but of course I'll be happy to test compatability once the integrations have been merged |
Proposed change
This integration adds communication with the Growatt solar inverter via RS232 Modbus (for people without the network connection).
If you wish so, avoiding the Growatt cloud monitoring keeps your setup more private and safe while having access to most functionality.
Type of change
Additional information
NA
NA
Docs for the new growatt_rs232 integration home-assistant.io#13991
this integration only supports configuration via the UI
uses pypi growattRS232==1.0.0
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.The integration reached or maintains the following Integration Quality Scale:
Although this is my first integration, I have done my best to comply with the Platinum standard but I leave it up to the reviewers to determine the quality.
I would welcome any feedback on how to further improve it. Given my inexperience, please provide feedback with some concrete pointers so I know where to look.
I read them all and hopefully implemented them correctly.