Skip to content
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

added solarman provider and template for deye-hybrid-3p-solarman #16067

Closed
wants to merge 5 commits into from

Conversation

tlmnb
Copy link

@tlmnb tlmnb commented Sep 12, 2024

I've added a new provider for the solarman protocol which is used by the LSW-3 data logger. The protocol description can be found here. In general it is modbus with a layer on top. Unfortunately I had to copy a lot from the modbus provider as I didn't want to add this provider into the modbus provider. Maybe there might be a more elegant way. I also appreciate some feedback as I recently started developing in golang.
I'll add a PR to update the documentation later

@andig
Copy link
Member

andig commented Sep 14, 2024

Great PR, thank you!

This is a lot of code and added complexity. I'm not convinced yet that we should add this. Are these devices wide-spread? Are there any alternative solutions like HA modules or similar?

Regarding choice of implementation: while a provider is a working approach- shouldn't this rather be a meter type instead? Is it absolutely necessary to duplicate such a large amount of modbus code?

@andig andig added the enhancement New feature or request label Sep 14, 2024
@andig andig marked this pull request as draft September 14, 2024 13:03
@deadrabbit87
Copy link
Contributor

deadrabbit87 commented Sep 15, 2024

I would be in favour of it. The Deye is relatively sensitive with regard to the RTU mode.

An identical manufacturer is Sunsynk, for example.

I didn't know a solution with Home Assistant and Solarman

@andig andig added devices Specific device support and removed enhancement New feature or request labels Sep 15, 2024
@tlmnb
Copy link
Author

tlmnb commented Sep 17, 2024

Thank you for your feedback.
Regarding the question how much these devices are used, here in the development area all (~60) houses were equipped with deye inverters using a lsw-3 data logger stick which uses the solarman protocol. I know at least one other neighbor who wants to use evcc for charging his ev.
See also this discussion.

The question whether it should be implemented as a meter or a provider, it is true that the data logger sticks are only used for inverters. From what I know no other devices use this way of communication. Therefore I guess it should be a meter.

Anyhow I will try to find a solution to avoid the large amount of duplicated code.

@PeterPablo
Copy link

Regarding the question of relevance. LSE-3 (ethernet) or LSW-3 (wifi) data loggers are used with SofarSolar inverters. This can be seen from the linked discussion of @tlmnb. FYI @cschlipf

@andig
Copy link
Member

andig commented Sep 17, 2024

Anyhow I will try to find a solution to avoid the large amount of duplicated code.

Just thinking loud:

In general it is modbus with a layer on top.

is there any chance we could use ModbusRTU/TCP as underlying protocol and wrap that in a meter implementation (instead of reimplementing the entire modbus stack)? If not: could we potentially (not sure this would technically be better) add something like a ModbusSolarMan solarmanPackager and/or ModbusSolarManOverTCP to evcc-io/modbus?

@andig
Copy link
Member

andig commented Sep 17, 2024

Regarding the question of relevance. LSE-3 (ethernet) or LSW-3 (wifi) data loggers are used with SofarSolar inverters.

Can they been integrated any other way than an implementation in evcc?

@PeterPablo
Copy link

PeterPablo commented Sep 17, 2024 via email

@andig
Copy link
Member

andig commented Sep 17, 2024

@PeterPablo what do you mean- that integration is already available?

@tlmnb
Copy link
Author

tlmnb commented Sep 18, 2024

In general it is modbus with a layer on top.

is there any chance we could use ModbusRTU/TCP as underlying protocol and wrap that in a meter implementation (instead of reimplementing the entire modbus stack)? If not: could we potentially (not sure this would technically be better) add something like a ModbusSolarMan solarmanPackager and/or ModbusSolarManOverTCP to evcc-io/modbus?

I had a look how the underlying client from grid-x implements the communication variants. I think I found here a way that I can also implement a client by using their interfaces. In my opinion I have to implement something like this for the solarman protocol.
So that would mean that the low-level communication would be still handled by the grid-x modbus client only the way how the messages are build would be custom.
But this would mean that the modbus provider would need an additional modbus type.

@PeterPablo what do you mean- that integration is already available?

I think he just wanted to emphasize that the lsw-3/solarman devices exists but are not implemented yet.

@andig
Copy link
Member

andig commented Sep 20, 2024

But this would mean that the modbus provider would need an additional modbus type.

Not if you make the result a meter or just its own type. Lets see how it looks when the basic interface is implemented.

@andig
Copy link
Member

andig commented Sep 25, 2024

Closing until updated

@andig andig closed this Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devices Specific device support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants