Skip battery entity creation when hasBattery is false#348
Open
teh-hippo wants to merge 2 commits intomacxq:mainfrom
Open
Skip battery entity creation when hasBattery is false#348teh-hippo wants to merge 2 commits intomacxq:mainfrom
teh-hippo wants to merge 2 commits intomacxq:mainfrom
Conversation
Skip battery entity creation when the FoxESS API reports hasBattery=false. Adds optional hasBattery config override. Reduces log noise for solar-only systems going offline at night.
1dc5505 to
61c01e1
Compare
The integration uses the FoxESS Cloud API (foxesscloud.com), not local device communication.
Author
|
@macxq would you be able to cast your eye over this? |
This file contains hidden or 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
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.
I have an ENR-8S (solar only, no battery). The integration already reads
hasBatteryfrom the device detail API and stores it inallData["addressbook"], but it creates all 18 battery entities regardless. On my system these are permanentlyunknownsince there's no battery to report values.This moves the battery-specific entities (Bat SoC, Bat Temperature, Bat Charge/Discharge Power, MinSoC, Residual Energy, etc.) into a conditional block that only runs when
hasBatteryis true. Core entities are unaffected. YAML configuration can override it. The default when the API hasn't responded yet istrue, so battery systems aren't affected by a slow first poll.Also reduces the "Inverter is off-line" log from
warningtodebugwhen no battery is fitted, since going offline at night is expected for solar-only setups.Also includes a fix for
iot_classfromlocal_pollingtocloud_polling, since the integration uses the FoxESS Cloud API.Tested on my own system (ENR-8S, solar only). Entity IDs and statistics are preserved.