Skip to content

Commit 28fb883

Browse files
authored
Merge pull request #32 from JasperE84/v2.0.5-dev
V2.0.5 dev
2 parents e32d295 + 123d406 commit 28fb883

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ Take the following steps to achieve this:
172172
# Changelog
173173
| Version | Description |
174174
| --- | --- |
175+
| 2.0.5 | Bugfix for incorrect fusionsolar northbound API docs, which state active_power for inverters returns kW, but in fact returns W |
175176
| 2.0.4 | Bugfix for fusionsolar cumulative energy quirk where cumulative energy provided by dashboard shortly decreases with the days production |
176177
| 2.0.3 | Bugfix in scheduler |
177178
| 2.0.2 | Default to kW in home assistant with 3 digit precision suggestion |

main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
2020
streamHandler.setFormatter(formatter)
2121
logger.addHandler(streamHandler)
22-
logger.info("PyFusionSolarDataRelay 2.0.4 started")
22+
logger.info("PyFusionSolarDataRelay 2.0.5 started")
2323

2424
# Config
2525
conf = Conf(logger).read_and_validate_config()

modules/fetch_fusion_solar_open_api.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,12 @@ def fetch_fusionsolar_grid_meter_device_kpis(self) -> List[FusionSolarMeterMeasu
161161
inverter_measurements = []
162162
for api_measurement in api_measurement_list:
163163
try:
164-
active_power_w = float(api_measurement["dataItemMap"]["active_power"]) * 1000
164+
# Do not multiply by 1000, fusionsolar returns W instead of kW despite docs saying kW
165+
active_power_w = float(api_measurement["dataItemMap"]["active_power"])
165166

166-
# fix for fusionsolar openapi quirk
167-
# active_power_w = 0 if int(active_power_w) == -65230000000 else active_power_w
167+
# Fix for fusionsolar meter device quirk, set to 0 of power drawn is greater than 16bits maxout (66.55MW) plus 10MW pv capacity
168+
quirk_threshold_w = float(-66553500 + 10000000)
169+
active_power_w = 0 if active_power_w < quirk_threshold_w else active_power_w
168170

169171
except KeyError as missing_key:
170172
self.logger.error(f"Key '{missing_key}' is missing from FusionSolarOpenAPI grid meter measurement. Skipping this device.")

modules/relay_fusionsolar_kiosk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def write_pvdata_to_pvoutput(self, kiosk_measurement: FusionSolarInverterMeasure
5959
# Log but do not raise, other outputs should proceed.
6060
self.logger.exception(f"Error writing PV data to PVOutput.org for fusionsolar kiosk [{kiosk_settings.descriptive_name}] with kkid [{kiosk_settings.api_kkid}]: {e}")
6161
else:
62-
self.logger.debug(f"Skipping publishing to InfluxDB, module disabled, or PVOutput disabled in fusionsolar kiosk config.")
62+
self.logger.debug(f"Skipping publishing to PvOutput, module disabled, or PVOutput disabled in fusionsolar kiosk config.")
6363

6464
def publish_pvdata_to_mqtt(self, kiosk_measurement: FusionSolarInverterMeasurement, kiosk_settings: FusionSolarKioskSettings):
6565
if self.conf.mqtt_module_enabled and kiosk_settings.output_mqtt:

modules/relay_fusionsolar_open_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def write_pvdata_to_pvoutput(self, inverter_measurement: FusionSolarInverterMeas
7979
f"Error writing PV data to PVOutput.org for fusionsolar open_api [{inverter_measurement.settings_descriptive_name}] with dev_id [{inverter_measurement.settings_device_id}]: {e}"
8080
)
8181
else:
82-
self.logger.debug(f"Skipping publishing to InfluxDB, module disabled, or PVOutput disabled in fusionsolar open_api config.")
82+
self.logger.debug(f"Skipping publishing to PvOutpu, module disabled, or PVOutput disabled in fusionsolar open_api config.")
8383

8484
def publish_pvdata_to_mqtt(self, inverter_measurement: FusionSolarInverterMeasurement):
8585
if self.conf.mqtt_module_enabled and ((inverter_measurement.settings is not None and inverter_measurement.settings.output_mqtt) or self.conf.fusionsolar_open_api_mqtt_for_discovered_dev):

0 commit comments

Comments
 (0)