Skip to content

fix(http): respond with 503 when inverter unavailable at startup#11

Merged
brandon1024 merged 1 commit intomainfrom
enhancements
Apr 5, 2026
Merged

fix(http): respond with 503 when inverter unavailable at startup#11
brandon1024 merged 1 commit intomainfrom
enhancements

Conversation

@brandon1024
Copy link
Copy Markdown
Owner

OpenEVT does not have any persistance of any kind. In some situations, whenever the application is restarted for any reason (e.g. upgrades), services that scrape the inverter status can get zero values briefly until OpenEVT has time to talk to the inverter. This can lead to some pretty nasty visualization behaviour (big spikes followed by big corrections).

This revision adjusts the web server to respond with a 503 when the status is not yet available, as opposed to returning zeroes. Services that scrape the endpoint should be able to use this to handle the error accordingly, skipping the datapoints rather than plotting zeroes.

Additionally, bump Go to latest release and upgrade dependencies.

OpenEVT does not have any persistance of any kind. In some situations,
whenever the application is restarted for any reason (e.g. upgrades),
services that scrape the inverter status can get zero values briefly
until OpenEVT has time to talk to the inverter. This can lead to some
pretty nasty visualization behaviour (big spikes followed by big
corrections).

This revision adjusts the web server to respond with a 503 when the
status is not yet available, as opposed to returning zeroes. Services
that scrape the endpoint should be able to use this to handle the error
accordingly, skipping the datapoints rather than plotting zeroes.

Improve flag usage strings.

Additionally, bump Go to latest release and upgrade dependencies.
@brandon1024
Copy link
Copy Markdown
Owner Author

Here's a quick demonstration of the problem. When we restart the container, we briefly get a zero struct:

Error: no container with name or ID "home-assistant-prod" found: no such container
ERRO[0000] User-selected graph driver "vfs" overwritten by graph driver "overlay" from database - delete libpod local files to resolve. 
 May prevent use of images created by other tools 
{
  "InverterId": "",
  "Module1": {
    "ModuleId": "",
    "FirmwareVersion": "",
    "InputVoltageDC": 0,
    "OutputPowerAC": 0,
    "TotalEnergy": 0,
    "Temperature": 0,
    "OutputVoltageAC": 0,
    "OutputFrequencyAC": 0
  },
  "Module2": {
    "ModuleId": "",
    "FirmwareVersion": "",
    "InputVoltageDC": 0,
    "OutputPowerAC": 0,
    "TotalEnergy": 0,
    "Temperature": 0,
    "OutputVoltageAC": 0,
    "OutputFrequencyAC": 0
  }
}
ERRO[0000] User-selected graph driver "vfs" overwritten by graph driver "overlay" from database - delete libpod local files to resolve. 
 May prevent use of images created by other tools 
{
  "InverterId": "30582932",
  "Module1": {
    "ModuleId": "30582932",
    "FirmwareVersion": "112/121",
    "InputVoltageDC": 34.7734375,
    "OutputPowerAC": 31.609375,
    "TotalEnergy": 194.08056640625,
    "Temperature": 22.1953125,
    "OutputVoltageAC": 235.0625,
    "OutputFrequencyAC": 50.05078125
  },
  "Module2": {
    "ModuleId": "30582933",
    "FirmwareVersion": "112/121",
    "InputVoltageDC": 34.7734375,
    "OutputPowerAC": 26.84375,
    "TotalEnergy": 165.9315185546875,
    "Temperature": 22.59375,
    "OutputVoltageAC": 235.0625,
    "OutputFrequencyAC": 50.05078125
  }
}

@brandon1024 brandon1024 merged commit e925e22 into main Apr 5, 2026
2 checks passed
@brandon1024 brandon1024 deleted the enhancements branch April 5, 2026 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant