-
Notifications
You must be signed in to change notification settings - Fork 16
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 H3 support #167
Merged
Merged
Add H3 support #167
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This probably wants double-checking against StealthChesnut/HA-FoxESS-Modbus#95 (comment) |
Argh, looks like the formatter version used by your action is different to the one I have installed... That or it's a configuration difference. |
I also want to disable the EPS sensors by default |
…actory Previously, the EntityFactory knew all of the addressses that the entity it described would rely on. This was passed to the InverterModelConnectionTypeProfile, which compiled the list of all addresses the controller cared about. Move to a model where the entity itself specifies its addresses. Instead of the addresses being passed through the InverterModelConnectionTypeProfile, instead we now record an entity/s addresses when it registers with the controller (and remove them when it unregisters). This doesn't change much right now, but it has two important consequences: 1. An entity's addresses can now be set when it is instantiated, rather than being fixed on its description. This lets an entity have different addresses depending on the inverter model it's placed on. 2. We now have the option of unregistering an entity when it's disabled, so it won't get updates.
The idea here is that we have a single list of entities descriptions. Each descriptions says the types of inverters and connection types it supports, and for each combination the address(es) of the register(s) it relys on. When we come to actually create the entities, we filter to the ones which support our inverter / connection type combination, and use the address from that combination. This caught a bug in the LAN sensors: the inverter/ambient sensors were swapped for AUX, but not for LAN.
Turns out that the H3 uses the input registers for everything.
Also add the following registers to other types, which were identified in the YAML file: - input_energy_total - input_energy_today - load_energy_total - load_energy_today load_energy_total duplicates load_power_total, and it's got the consistent name, so remove load_power_total
See discussion in nathanmarlor#121
… integration sensor I'd like to move to using the proper register at some point, but we'll do that as part of an entity schema migration.
I think this is now pretty much there... I'll merge tomorrow. |
This was referenced Apr 24, 2023
Closed
Closed
Thanks, moved to #197. Would you mind joining me there? |
canton7
added a commit
to canton7/foxess_modbus
that referenced
this pull request
May 30, 2023
This was originally fixed in nathanmarlor#168, but nathanmarlor#167 seems to have accidentally reverted it. Fixes: nathanmarlor#299
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First off, it's probably worth doing this one commit by commit... It's pretty large in parts! Sorry.
This comes in a few stages (see the commit messages for more details)
It turns out that whoever wrote the H3 YAML file managed to identify some registers that we didn't, so copy those across for all register types:
(load_energy_total duplicates load_power_total, and it's got the consistent name, so remove load_power_total)