home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.14k stars 29.82k forks source link

OVO Energy Integration #38824

Closed mark-130 closed 4 years ago

mark-130 commented 4 years ago

The problem

After initial integration, OVO Energy sensor reading show as Unknown and doesn't keep last known readings or update

Environment

0.114.0

Problem-relevant configuration.yaml

Traceback/Error logs

Logger: homeassistant.components.ovo_energy Source: helpers/update_coordinator.py:147 Integration: OVO Energy (documentation, issues) First occurred: 10:13:21 AM (1 occurrences) Last logged: 10:13:21 AM

Timeout fetching sensor data

Additional information

frenck commented 4 years ago

@mark-130 Please provide as much of the requested information in the issue template as possible.

Thanks 👍

probot-home-assistant[bot] commented 4 years ago

Hey there @timmo001, mind taking a look at this issue as its been labeled with an integration (ovo_energy) you are listed as a codeowner for? Thanks! (message by CodeOwnersMention)

timmo001 commented 4 years ago

I have noticed this on my production instance. Although I have never been able to source the error logs.

In the interim, a restart seems to fix this issue. I'll do some investigation as well

Altycoder commented 4 years ago

I'm on latest 0.114 version via docker and values are showing as unknown for me as well. Values were retrieved initially (yesterday immediately after setting up integration), but today all values showing as unknown.

Home Assistant Core release with the issue: 0.114 Last working Home Assistant Core release (if known): n/a Operating environment (OS/Container/Supervised/Core): Arch LTS docker Integration causing this issue: Ovo Link to integration documentation on our website:

timmo001 commented 4 years ago

Looks like it could be the api dropping the token after 20-30 mins or so:

2020-08-13 12:57:25 WARNING (MainThread) [homeassistant.components.ovo_energy] Get usage
2020-08-13 12:57:25 WARNING (MainThread) [homeassistant.components.ovo_energy] 17.461
2020-08-13 13:02:25 WARNING (MainThread) [homeassistant.components.ovo_energy] Get usage
2020-08-13 13:02:25 WARNING (MainThread) [homeassistant.components.ovo_energy] 17.461
2020-08-13 13:07:25 WARNING (MainThread) [homeassistant.components.ovo_energy] Get usage
2020-08-13 13:07:25 WARNING (MainThread) [homeassistant.components.ovo_energy] 17.461
2020-08-13 13:12:25 WARNING (MainThread) [homeassistant.components.ovo_energy] Get usage
2020-08-13 13:12:25 WARNING (MainThread) [homeassistant.components.ovo_energy] 17.461
2020-08-13 13:17:25 WARNING (MainThread) [homeassistant.components.ovo_energy] Get usage
2020-08-13 13:17:25 WARNING (MainThread) [homeassistant.components.ovo_energy] 17.461
2020-08-13 13:22:25 WARNING (MainThread) [homeassistant.components.ovo_energy] Get usage
2020-08-13 13:22:25 ERROR (MainThread) [homeassistant.components.ovo_energy] Unexpected error fetching sensor data: 'NoneType' object is not subscriptable

I'm investigating what happens what authenticating each update does and will add the fix if it works

Altycoder commented 4 years ago

Why is it polling Ovo so much if it's only retrieving daily data? If it's only retrieving daily data then surely one poll in the small hours of the morning would be sufficient?

Half-hourly data would be much more useful via a future update :-)

RogerSelwyn commented 4 years ago

Agreed. I can see the sensors are set to scan_interval of 5 mins which is excessive. Every 2-3 hours would be fine, so that that the information can be reasonably sure of being upto date.

I'd be interested in half hourly stats to help identify anything outside the norm.

Altycoder commented 4 years ago

Half hourly data would potentially allow me to get rid of my Aeotec zwave energy meter which is giving some problems

timmo001 commented 4 years ago

The poll is every 5 minutes. This is more for futureproofing if OVO reactivates the API that allowed live data. unfortunately, they are not looking like they will and the only way to get live data is to but a 3rd party smart meter which uses MQTT.

Anyway, that test worked. Had a dev instance running all afternoon and the state is no longer unknown

Altycoder commented 4 years ago

The poll is every 5 minutes. This is more for futureproofing if OVO reactivates the API that allowed live data. unfortunately, they are not looking like they will and the only way to get live data is to but a 3rd party smart meter which uses MQTT.

Anyway, that test worked. Had a dev instance running all afternoon and the state is no longer unknown

Is half hourly data possible via their api?

timmo001 commented 4 years ago

The poll is every 5 minutes. This is more for futureproofing if OVO reactivates the API that allowed live data. unfortunately, they are not looking like they will and the only way to get live data is to but a 3rd party smart meter which uses MQTT. Anyway, that test worked. Had a dev instance running all afternoon and the state is no longer unknown

Is half hourly data possible via their api?

There is, but you can only get yesterday's (and days' before) data. Essentially everything on the portal is what is available