Skip to content

Skip battery entity creation when hasBattery is false#348

Open
teh-hippo wants to merge 2 commits intomacxq:mainfrom
teh-hippo:pr/solar-only-support
Open

Skip battery entity creation when hasBattery is false#348
teh-hippo wants to merge 2 commits intomacxq:mainfrom
teh-hippo:pr/solar-only-support

Conversation

@teh-hippo
Copy link
Copy Markdown

@teh-hippo teh-hippo commented Mar 3, 2026

I have an ENR-8S (solar only, no battery). The integration already reads hasBattery from the device detail API and stores it in allData["addressbook"], but it creates all 18 battery entities regardless. On my system these are permanently unknown since 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 hasBattery is true. Core entities are unaffected. YAML configuration can override it. The default when the API hasn't responded yet is true, so battery systems aren't affected by a slow first poll.

Also reduces the "Inverter is off-line" log from warning to debug when no battery is fitted, since going offline at night is expected for solar-only setups.

Also includes a fix for iot_class from local_polling to cloud_polling, since the integration uses the FoxESS Cloud API.

Tested on my own system (ENR-8S, solar only). Entity IDs and statistics are preserved.

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.
@teh-hippo teh-hippo force-pushed the pr/solar-only-support branch from 1dc5505 to 61c01e1 Compare March 3, 2026 13:35
The integration uses the FoxESS Cloud API (foxesscloud.com),
not local device communication.
@teh-hippo
Copy link
Copy Markdown
Author

@macxq would you be able to cast your eye over this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant