Skip to content

Add fox_pv_ignore option to prevent overwriting empty values from Fox Cloud#3754

Open
manoj125485 wants to merge 4 commits intospringfall2008:mainfrom
manoj125485:patch-1
Open

Add fox_pv_ignore option to prevent overwriting empty values from Fox Cloud#3754
manoj125485 wants to merge 4 commits intospringfall2008:mainfrom
manoj125485:patch-1

Conversation

@manoj125485
Copy link
Copy Markdown

@manoj125485 manoj125485 commented Apr 7, 2026

Prevent Fox Cloud automatic configuration from clobbering PV-related Predbat configuration (notably pv_power and pv_today) in setups where Fox Cloud reports zero/absent PV data (e.g., AC-only battery inverter with separate solar such as Enphase).

Changes:

Gate Fox automatic configuration of pv_today behind a new fox_pv_ignore flag.
Gate Fox automatic configuration of pv_power behind the same fox_pv_ignore flag.

… in predbat config

This is a temporary fix to prevent 0 values being set by Fox Cloud when you have an AC only inverter. I.e. it does not store any pv information for my Enphase solar.

This will allow my setup to continue to work when appying the latest predbat updates.
@springfall2008
Copy link
Copy Markdown
Owner

@copilot This change should be re-done to have an option called 'fox_pv_ignore' rather than based on previous config setting

@manoj125485
Copy link
Copy Markdown
Author

@springfall2008 I have updated as you suggested, thanks.

If you can think of any other attributes not applicable from fox cloud when using Enpahse PV, let me know.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to prevent Fox Cloud automatic configuration from clobbering PV-related Predbat configuration (notably pv_power and pv_today) in setups where Fox Cloud reports zero/absent PV data (e.g., AC-only battery inverter with separate solar such as Enphase).

Changes:

  • Gate Fox automatic configuration of pv_today behind a new fox_pv_ignore flag.
  • Gate Fox automatic configuration of pv_power behind the same fox_pv_ignore flag.

Comment thread apps/predbat/fox.py
Comment thread apps/predbat/fox.py Outdated
Comment thread apps/predbat/fox.py Outdated
Comment on lines +1677 to +1684
if not self.base.get_arg("fox_pv_ignore", default=False):
self.set_arg("pv_today", [f"sensor.{self.prefix}_fox_{device}_pvenergytotal_today" for device in pvs])
self.set_arg("battery_rate_max", [f"sensor.{self.prefix}_fox_{device}_battery_rate_max" for device in batteries])
self.set_arg("battery_power", [f"sensor.{self.prefix}_fox_{device}_invbatpower" for device in batteries])
self.set_arg("grid_power", [f"sensor.{self.prefix}_fox_{device}_meterpower" for device in batteries])
self.set_arg("grid_power_invert", [True for device in batteries])
self.set_arg("pv_power", [f"sensor.{self.prefix}_fox_{device}_pvpower" for device in pvs])
if not self.base.get_arg("fox_pv_ignore", default=False):
self.set_arg("pv_power", [f"sensor.{self.prefix}_fox_{device}_pvpower" for device in pvs])
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Copilot can you suggest a test

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@springfall2008 any idea why copilot is not taking action, would be good to get this change in so I can update predbat regularly?

Comment thread apps/predbat/fox.py Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@manoj125485 manoj125485 changed the title Do not overwrite pv_power & pv_today via Fox Cloud if already defined… Add fox_pv_ignore option to prevent overwriting empty values from Fox Cloud Apr 11, 2026
@manoj125485
Copy link
Copy Markdown
Author

@copilot can you please review this PR and apply any suggestions.

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.

3 participants