Handle bad behaviour by the Hoymiles API #7

Closed
opened 2023-01-15 17:10:01 +01:00 by paul · 5 comments
Owner

The following issues were found:

  • The status (error) code field is a number encoded as string
  • The data field in the API response can be an empty string (instead of null) in case of an error
  • At 0:00 (local time) the today_eq field in the API response is reset, but not at the some moment added to total_eq, leading to a decrease in the total until this is corrected
  • The last_data_time field in the API data as last updated timestamp but it has no timezone
  • The data is updated at about 15 minutes, but it seems to be slightly less, so it shifts slowly back in the poll interval of also 15 minutes
  • If the token becomes invalid, a valid API response is still returned and that might contain the error; this needs to be detected

Handle this behavior by various workarounds.

The following issues were found: * [x] The status (error) code field is a number encoded as string * [x] The `data` field in the API response can be an empty string (instead of `null`) in case of an error * [x] At 0:00 (local time) the `today_eq` field in the API response is reset, but not at the some moment added to `total_eq`, leading to a decrease in the total until this is corrected * [x] The `last_data_time` field in the API data as last updated timestamp but it has no timezone * [x] The data is updated at about 15 minutes, but it seems to be slightly less, so it shifts slowly back in the poll interval of also 15 minutes * [x] If the token becomes invalid, a valid API response is still returned and that might contain the error; this needs to be detected Handle this behavior by various workarounds.
paul added the
bug
label 2023-01-15 17:10:05 +01:00
paul self-assigned this 2023-01-15 17:10:10 +01:00
paul changed title from Handle bad behaviour of the Hoymiles API to Handle bad behaviour by the Hoymiles API 2023-01-15 17:10:31 +01:00
Author
Owner

The shifting every 15 minute update is fixed in commit 01416ee (and ef13f7e) by reducing the poll interval to 5 minutes.

The shifting every 15 minute update is fixed in commit 01416ee (and ef13f7e) by reducing the poll interval to 5 minutes.
Author
Owner

The last_data_time field parsing and inclusion is added in commit e0151c3.

The `last_data_time` field parsing and inclusion is added in commit e0151c3.
Author
Owner

The 0:00 reset breaking the non-decreasing total is fixed in commit d787c8b.

The 0:00 reset breaking the non-decreasing total is fixed in commit d787c8b.
Author
Owner

The improved parsing of a possible empty data field and the status (error) code as string is implemented in commit 5a2889a.

The improved parsing of a possible empty `data` field and the status (error) code as string is implemented in commit 5a2889a.
Author
Owner

The validation of the response (and status (error) code checking) was added in commit e1d70e8.

This was the last remaining issue.

The validation of the response (and status (error) code checking) was added in commit e1d70e8. This was the last remaining issue.
paul closed this issue 2023-01-16 20:09:23 +01:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: paul/solar-grabber#7
No description provided.