Add fox_pv_ignore option to prevent overwriting empty values from Fox Cloud#3754
Add fox_pv_ignore option to prevent overwriting empty values from Fox Cloud#3754manoj125485 wants to merge 4 commits intospringfall2008:mainfrom
Conversation
… 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.
|
@copilot This change should be re-done to have an option called 'fox_pv_ignore' rather than based on previous config setting |
|
@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. |
There was a problem hiding this comment.
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_todaybehind a newfox_pv_ignoreflag. - Gate Fox automatic configuration of
pv_powerbehind the samefox_pv_ignoreflag.
| 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]) |
There was a problem hiding this comment.
@Copilot can you suggest a test
There was a problem hiding this comment.
@springfall2008 any idea why copilot is not taking action, would be good to get this change in so I can update predbat regularly?
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
@copilot can you please review this PR and apply any suggestions. |
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.