Add daily production values.

This commit is contained in:
2024-05-17 12:10:25 +02:00
parent 1db38c3915
commit e85080078e
5 changed files with 194 additions and 97 deletions

View File

@@ -58,7 +58,7 @@ for ($date_diff = $interval->days; $date_diff > 0; $date_diff--) {
$grid_feed = 0;
}
$aggregation_query = 'INSERT INTO ' . $local_table . ' (`date`, `meter_consumption`, `power_sensor`, `grid_feed`, `last_value`) VALUES ("' . $date->format('Y-m-d') . '", ' . $meter_consumption . ', ' . $power_sensor . ', ' . $grid_feed . ', ' . $consumption_end . ');';
$aggregation_query = 'INSERT INTO ' . $local_table . ' (`date`, `meter_consumption`, `power_sensor`, `grid_feed`, `last_value`, `production_eg`, `production_og`) VALUES ("' . $date->format('Y-m-d') . '", ' . $meter_consumption . ', ' . $power_sensor . ', ' . $grid_feed . ', ' . $consumption_end . ', 0, 0);';
$local_db->query($aggregation_query);
}