I have just checked and spotted that my code is no longer working when retrieving energy usage information from the invertor. After a bit of digging this seems to be because the API is returning the same end date and time as the first data point returned. For example, using the code below:

$from = '2024-05-25';
$to = '2024-05-26';
// Get energy usage from Givenergy
$client = new \GuzzleHttp\Client();
$response = $client->post(
$this->config->item('GIVENERGY_ENDPOINT').'inverter/'.$this->config->item('GIVENERGY_INVERTER').'/energy-flows',
[
'headers' => [
'Authorization' => 'Bearer '.$this->config->item('GIVENERGY_KEY'),
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'start_time' => $from,
'end_time' => $to,
'grouping' => 0,
'types' => [
0,
1,
2,
3,
4,
5,
6,
],
],
]
);
$body = $response->getBody();
$obj = json_decode($body);
array_to_html($obj);

This returns:

You can see that the end_time is always "2024-05-25 00:30".

Has this change as I know that it used to work and is there a way of getting the correct data?

Thanks