Skip to content

Commit

Permalink
Merge branch 'release/0.5.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
ledermann committed Nov 7, 2024
2 parents e07f7ef + 89adbce commit 2d0749a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ The following environment variables can be used to configure the importer:
| `INFLUX_SENSOR_BATTERY_CHARGE_POWER` | Measurement/field for battery charge power | `SENEC:bat_power_plus` |
| `INFLUX_SENSOR_BATTERY_DISCHARGE_POWER` | Measurement/field for battery discharge power | `SENEC:bat_power_minus` |
| `INFLUX_SENSOR_WALLBOX_POWER` | Measurement/field for wallbox power | `SENEC:wallbox_charge_power` |
| `SENEC_IGNORE` | Optionally ignore some fields (comma-separated) | |
| `IMPORT_FOLDER` | Folder where CSV files are located | `/data` |
| `IMPORT_PAUSE` | Pause after each imported file (in seconds) | `0` |
| `TZ` | Time zone to use when parsing times | `Europe/Berlin` |
Expand Down
5 changes: 4 additions & 1 deletion app/adapters/senec_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ def data
grid_import_power
grid_export_power
wallbox_power
].map do |sensor_name|
].filter_map do |sensor_name|
next if config.senec_ignore.include?(config.field(sensor_name))

{
measurement: config.measurement(sensor_name),
field: config.field(sensor_name),
Expand Down Expand Up @@ -74,6 +76,7 @@ def grid_export_power
parse_kw(row, 'Netzeinspeisung [kW]', 'Netzeinspeisung [kWh]')
end

# Estimate wallbox power based on the other values
def wallbox_power
incoming = inverter_power + grid_import_power + battery_discharging_power
outgoing = grid_export_power + house_power + battery_charging_power
Expand Down
3 changes: 3 additions & 0 deletions app/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
:influx_sensor_battery_charging_power,
:influx_sensor_battery_discharging_power,
:influx_sensor_wallbox_power,
### SENEC only: Optionally ignore some fields
:senec_ignore,
###
keyword_init: true,
) do
Expand Down Expand Up @@ -94,6 +96,7 @@ def self.sensors_from_env
'INFLUX_SENSOR_BATTERY_DISCHARGING_POWER', 'SENEC:bat_power_minus',
),
influx_sensor_wallbox_power: ENV.fetch('INFLUX_SENSOR_WALLBOX_POWER', 'SENEC:wallbox_charge_power'),
senec_ignore: ENV.fetch('SENEC_IGNORE', '').split(',').map(&:to_sym),
}
end

Expand Down

0 comments on commit 2d0749a

Please sign in to comment.