Energy Config Error (fixed see below)

Getting an error when i try to access the Energy section in the config menu

Literally no idea what is going on as the rest of the install seems fine

Can anyone help please

Log as I see it

Logger: homeassistant.components.websocket_api.http.connection
Source: components/energy/validate.py:300
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 19:40:58 (5 occurrences)
Last logged: 19:46:52

[547356929232] Error handling message: Unknown error
[547690630112] Error handling message: Unknown error
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 26, in _handle_async_response
    await func(hass, connection, msg)
  File "/usr/src/homeassistant/homeassistant/components/energy/websocket_api.py", line 167, in ws_validate
    connection.send_result(msg["id"], (await async_validate(hass)).as_dict())
  File "/usr/src/homeassistant/homeassistant/components/energy/validate.py", line 300, in async_validate
    hass.data[DOMAIN]["cost_sensors"][flow["stat_energy_from"]],
KeyError: ''

Same ERROR here

Fixed mine. Goto config/.storage and delete the file ‘energy’

it then recreates the file without errors

I used samba to get in but you could use the terminal