Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,6 @@ dmypy.json

# Project specific ignores
/config.yaml
/cache/**/*.json
/cache/**/*.json

.idea
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,12 @@ All configuration is done through environment variables or an optional `.env` fi
| influxdb_v2_token | Token for InfluxDBv2, only required if influx2=True | XXXXXXX |

### PVOutput.org Settings
| Parameter | Description | Default |
| --- | --- | --- |
| pvoutput_module_enabled | Can be `True` or `False`, determines if PVOutput.org API is enabled | False |
| pvoutput_record_url | API url for PVOutput.org live output posting | [Click url](https://pvoutput.org/service/r2/addstatus.jsp)
| pvoutput_api_key | API Key for PVOutput.org | yourapikey |
| Parameter | Description | Default |
|--------------------------|---------------------------------------------------------------------|------------------------------------------------------------|
| pvoutput_module_enabled | Can be `True` or `False`, determines if PVOutput.org API is enabled | False |
| pvoutput_record_url | API url for PVOutput.org live output posting | [Click url](https://pvoutput.org/service/r2/addstatus.jsp) |
| pvoutput_api_key | API Key for PVOutput.org | yourapikey |
| pvoutput_skip_zero_power | Flag to skip events with zero power (i.e. in the night) | False |

### MQTT Settings
| Parameter | Description | Default |
Expand Down
1 change: 1 addition & 0 deletions modules/conf_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ class PyFusionSolarSettings(BaseSettings):
pvoutput_module_enabled: bool = Field(default=False)
pvoutput_record_url: str = Field(default="https://pvoutput.org/service/r2/addstatus.jsp")
pvoutput_api_key: str = Field(default="yourapikey")
pvoutput_skip_zero_power: bool = Field(default=False)

# MQTT
mqtt_module_enabled: bool = Field(default=False)
Expand Down
2 changes: 1 addition & 1 deletion modules/relay_fusionsolar_open_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def write_pvdata_to_pvoutput(self, inverter_measurement: FusionSolarInverterMeas
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}"
)
else:
self.logger.debug(f"Skipping publishing to PvOutpu, module disabled, or PVOutput disabled in fusionsolar open_api config.")
self.logger.debug(f"Skipping publishing to PvOutput, module disabled, or PVOutput disabled in fusionsolar open_api config.")

def publish_pvdata_to_mqtt(self, inverter_measurement: FusionSolarInverterMeasurement):
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):
Expand Down
2 changes: 2 additions & 0 deletions modules/write_pvoutput.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ def write_pvdata_to_pvoutput(self, measurement: FusionSolarInverterMeasurement,
if self.conf.pvoutput_module_enabled:
if pvoutput_system_id == 0:
self.logger.info(f"Skipping PVOutput API call for (kk)id: {dev_id}, output_pvoutput_system_id is not configured")
elif self.conf.pvoutput_skip_zero_power and measurement.real_time_power_w <= 0:
self.logger.info(f"Skipping PVOutput API call for (kk)id: {dev_id}, real_time_power_w is {measurement.real_time_power_w}w")
else:
pvoutput_header_obj = {
"X-Pvoutput-Apikey": self.conf.pvoutput_api_key,
Expand Down