Home Assistant historical data

Hello!

I have an issue with Home Assistant historical data.
The problem occured after upgrading from 0.92 to 0.95.4.
The History-Graph shows only 20 mins of historical values, after this time the value remains unchanged. Only restart of the Home Assistant helps, but again - after 20 mins it wont update value.
On the screen you can clearly see where restarts of the HA

obraz

i cant seem to find anything connected with this in HA logs, only
WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.XXX is taking over 10 seconds
from time to time, but it was working fine like that before update

What about database errors in your log?

Where can I check them?
are they in dev-info (about) ?

Yes. There.

019-07-02 11:40:07 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant. 2019-07-02 11:40:07 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for variable which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant. 2019-07-02 11:40:07 WARNING (MainThread) [homeassistant.components.http] Configuring api_password via the http component has been deprecated. Use the legacy api password auth provider instead. For instructions, see https://www.home-assistant.io/docs/authentication/providers/#legacy-api-password 2019-07-02 11:40:07 WARNING (MainThread) [homeassistant.components.http.auth] legacy_api_password support has been enabled. 2019-07-02 11:40:09 WARNING (Recorder) [homeassistant.components.recorder] Ended unfinished session (id=247 from 2019-07-01 18:11:55.575086) 2019-07-02 11:40:20 WARNING (SyncWorker_4) [homeassistant.components.darksky.sensor] Monitored condition temperature_max is deprecated 2019-07-02 11:40:21 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 357, in _async_add_entity raise HomeAssistantError(msg) homeassistant.exceptions.HomeAssistantError: Entity id already exists: calendar.contacts 2019-07-02 11:40:22 ERROR (SyncWorker_11) [xiaomi_gateway] Cannot connect to Gateway 2019-07-02 11:40:22 ERROR (SyncWorker_11) [xiaomi_gateway] No data in response from hub None 2019-07-02 11:40:22 WARNING (MainThread) [homeassistant.setup] Setup of xiaomi_aqara is taking over 10 seconds. 2019-07-02 11:40:23 ERROR (MainThread) [homeassistant.components.sensor] airvisual: Error on device update! Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 261, in _async_add_entity await entity.async_device_update(warning=False) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 375, in async_device_update await self.async_update() File "/usr/src/homeassistant/homeassistant/components/airvisual/sensor.py", line 244, in async_update symbol = data['main{0}'.format(self._locale)] KeyError: 'mainus' 2019-07-02 11:40:32 ERROR (SyncWorker_11) [xiaomi_gateway] Cannot connect to Gateway 2019-07-02 11:40:42 ERROR (SyncWorker_11) [xiaomi_gateway] Cannot connect to Gateway 2019-07-02 11:40:52 ERROR (SyncWorker_11) [xiaomi_gateway] Cannot connect to Gateway 2019-07-02 11:41:02 ERROR (SyncWorker_11) [xiaomi_gateway] Cannot connect to Gateway 2019-07-02 11:41:12 ERROR (SyncWorker_11) [xiaomi_gateway] Cannot connect to Gateway 2019-07-02 11:41:25 ERROR (Thread-5) [xiaomi_gateway] Unknown gateway ip 192.168.0.155 2019-07-02 11:41:35 ERROR (Thread-5) [xiaomi_gateway] Unknown gateway ip 192.168.0.155 2019-07-02 11:41:37 ERROR (MainThread) [frontend.js.latest.201906260] http://192.168.0.11:8123/local/custom_ui/calendar-card/calendar-card.js?v=1.0.1:10:7 ReferenceError: moment is not defined 2019-07-02 11:41:45 ERROR (Thread-5) [xiaomi_gateway] Unknown gateway ip 192.168.0.155 2019-07-02 11:41:55 ERROR (Thread-5) [xiaomi_gateway] Unknown gateway ip 192.168.0.155 2019-07-02 12:05:36 ERROR (MainThread) [frontend.js.latest.201906260] http://192.168.0.11:8123/local/custom_ui/calendar-card/calendar-card.js?v=1.0.1:10:7 ReferenceError: moment is not defined 2019-07-02 12:05:43 ERROR (Thread-5) [xiaomi_gateway] Unknown gateway ip 192.168.0.155 2019-07-02 12:05:53 ERROR (Thread-5) [xiaomi_gateway] Unknown gateway ip 192.168.0.155 2019-07-02 12:11:57 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.rpi1_dht_humidity is taking over 10 seconds 2019-07-02 12:12:02 ERROR (Thread-5) [xiaomi_gateway] Unknown gateway ip 192.168.0.155 2019-07-02 12:12:12 ERROR (Thread-5) [xiaomi_gateway] Unknown gateway ip 192.168.0.155 2019-07-02 12:12:22 ERROR (Thread-5) [xiaomi_gateway] Unknown gateway ip 192.168.0.155 2019-07-02 12:12:32 ERROR (Thread-5) [xiaomi_gateway] Unknown gateway ip 192.168.0.155 2019-07-02 12:19:44 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.rpi1_dht_humidity is taking over 10 seconds 2019-07-02 12:19:51 ERROR (Thread-5) [xiaomi_gateway] Unknown gateway ip 192.168.0.155

These are all logs, i just deleted “unknown gateway ip” it is shown multiple times.
This time, after restart I dont have logs since 12:10

Wow.

Ok lets start at the beginning:

`019-07-02 11:40:07 WARNING (MainThread) [homeassistant.loader]
 You are using a custom integration for hacs which has not been tested 
by Home Assistant. `

Why are you getting this error?

If you installed HACS correctly you should not be seeing it.


Fix your authentication settings.

*`2019-07-02 11:40:07 WARNING (MainThread) 
[homeassistant.components.http] Configuring api_password via the http 
component has been deprecated. Use the legacy api password auth provider
 instead. For instructions, see 
https://www.home-assistant.io/docs/authentication/providers/#legacy-api-password`*

Do you see the error below every time you restart? This is probably related to your problem. What’s causing it? :man_shrugging: You could try deleting your database and restarting (you will lose you previously saved data). <path to config dir>/.homeassistant/home-assistant_v2.db However, fix all these other errors first and see if that helps.

2019-07-02 11:40:09 WARNING (Recorder) [homeassistant.components.recorder] Ended unfinished session (id=247 from 2019-07-01 18:11:55.575086)

Delete this sensor.

WARNING (SyncWorker_4) [homeassistant.components.darksky.sensor] Monitored condition temperature_max is deprecated

You have a duplicate entity_id (calendar.contacts). Delete it.

2019-07-02 11:40:21 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 357, in _async_add_entity raise HomeAssistantError(msg) homeassistant.exceptions.HomeAssistantError: Entity id already exists: calendar.contacts

You have an invalid key defined for one of your sensors (‘mainus’). Delete/fix it.

2019-07-02 11:40:22 WARNING (MainThread) [homeassistant.setup] Setup of xiaomi_aqara is taking over 10 seconds. 2019-07-02 11:40:23 ERROR (MainThread) [homeassistant.components.sensor] airvisual: Error on device update! Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 261, in _async_add_entity await entity.async_device_update(warning=False) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 375, in async_device_update await self.async_update() File "/usr/src/homeassistant/homeassistant/components/airvisual/sensor.py", line 244, in async_update symbol = data['main{0}'.format(self._locale)] KeyError: 'mainus' 

Actually, ALL custom components generate this error.

HACS doesn’t for me:

Hahahaha!!! it’s not in my log right now either. I wonder if the last update fixed that because it was always there before.

I am having a similar issue but I’ve realised that the data is still being recorded because the periods that show up as flat lines later show the correct data.

Exactly same problem here with multiple sensors. Backed out to 0.94 for now and all is back to normal.

Changed to postgresql and problem is gone :slight_smile:
Also fixed the problem I was having with the server taking more than 20mins to restart.