No history or logbook in HA 0.33.3

Hi,

I have HA with version 0.33.3 working in my raspberry pi.

The other day i wanted to see the history about sun horizon, because i made a automation to up and down my blind at one moment when the sun have a value in the horizon. The surprise was when i went to the option history, HA, told me

“No state history found.”

And the same on logbook option.

As you can see below, in my configuration.yaml has the option of history and logbook activated, but I dunno, why don’t save the history.

# Enables the frontend
frontend:

# Enables support for tracking state changes over time.
history:

# View all events in a logbook
logbook:

# Allows you to issue voice commands from the frontend
conversation:

# Checks for available updates
updater:

# Discover some devices automatically
discovery:

# Show links to resources in log and frontend
#introduction:

#Track the sun
sun:

#recorder:
#  purge_days: 5

Con someone help me please about this problem?

thanks

You commented out recorder, the component on which both the history and logbook depend.

In other words: the recorder component is what actually ‘records’ the data. Without the recorder, the history and logbook have no data to show.

I’ve had a similar problem but it wasn’t because recorder was commented out. It was because the sqlite DB was corrupted. This has happened to me a few times and I’ve found a way to fix it so I’ve written a really basic script to do a DB dump to get rid of the corruption.

First I stop HA so nothing is using the DB. Then I run this bash script (I’m on a Raspbian box).

#!/bin/bash

echo '.dump' |sqlite3 home-assistant_v2.db |sqlite3 repaired_home-assistant_v2.db
mv home-assistant_v2.db corrupt_home-assistant_v2.db 
mv repaired_home-assistant_v2.db home-assistant_v2.db 

Hope this helps someone else but keep in mind this does no checking to make sure the previous commands worked before running the next. You could completely kill the DB by using it.

1 Like

Hi,

After doing some changes, now i uncomment the recorder option, but I continue having the same problem. I don’t have history or logbook.

here you can see now the new configuration.yaml

# Enables the frontend
frontend:

# Enables support for tracking state changes over time.
history:

# View all events in a logbook
logbook:

# Allows you to issue voice commands from the frontend
conversation:

# Checks for available updates
updater:

# Discover some devices automatically
discovery:

# Show links to resources in log and frontend
#introduction:

#Track the sun
sun:

recorder:
  purge_days: 7

If i see in my log file of home assistant, and i search the word “history” i have these results:

 File "/srv/homeassistant/homeassistant_0_33_3/lib/python3.4/site-packages/homeassistant/components/history.py", line 245, in get
  File "/srv/homeassistant/homeassistant_0_33_3/lib/python3.4/site-packages/homeassistant/components/history.py", line 70, in get_significant_states
  File "/srv/homeassistant/homeassistant_0_33_3/lib/python3.4/site-packages/homeassistant/components/history.py", line 245, in get
  File "/srv/homeassistant/homeassistant_0_33_3/lib/python3.4/site-packages/homeassistant/components/history.py", line 70, in get_significant_states
  File "/srv/homeassistant/homeassistant_0_33_3/lib/python3.4/site-packages/homeassistant/components/history.py", line 245, in get
  File "/srv/homeassistant/homeassistant_0_33_3/lib/python3.4/site-packages/homeassistant/components/history.py", line 70, in get_significant_states
  File "/srv/homeassistant/homeassistant_0_33_3/lib/python3.4/site-packages/homeassistant/components/history.py", line 245, in get
  File "/srv/homeassistant/homeassistant_0_33_3/lib/python3.4/site-packages/homeassistant/components/history.py", line 70, in get_significant_states
  File "/srv/homeassistant/homeassistant_0_33_3/lib/python3.4/site-packages/homeassistant/components/history.py", line 245, in get
  File "/srv/homeassistant/homeassistant_0_33_3/lib/python3.4/site-packages/homeassistant/components/history.py", line 70, in get_significant_states
  File "/srv/homeassistant/homeassistant_0_33_3/lib/python3.4/site-packages/homeassistant/components/history.py", line 245, in get
  File "/srv/homeassistant/homeassistant_0_33_3/lib/python3.4/site-packages/homeassistant/components/history.py", line 70, in get_significant_states
  File "/srv/homeassistant/homeassistant_0_33_3/lib/python3.4/site-packages/homeassistant/components/history.py", line 245, in get
  File "/srv/homeassistant/homeassistant_0_33_3/lib/python3.4/site-packages/homeassistant/components/history.py", line 70, in get_significant_states
  File "/srv/homeassistant/homeassistant_0_33_3/lib/python3.4/site-packages/homeassistant/components/history.py", line 245, in get
  File "/srv/homeassistant/homeassistant_0_33_3/lib/python3.4/site-packages/homeassistant/components/history.py", line 70, in get_significant_states
  File "/srv/homeassistant/homeassistant_0_33_3/lib/python3.4/site-packages/homeassistant/components/history.py", line 245, in get
  File "/srv/homeassistant/homeassistant_0_33_3/lib/python3.4/site-packages/homeassistant/components/history.py", line 70, in get_significant_states
  File "/srv/homeassistant/homeassistant_0_33_3/lib/python3.4/site-packages/homeassistant/components/history.py", line 245, in get
  File "/srv/homeassistant/homeassistant_0_33_3/lib/python3.4/site-packages/homeassistant/components/history.py", line 70, in get_significant_states
  File "/srv/homeassistant/homeassistant_0_33_3/lib/python3.4/site-packages/homeassistant/components/history.py", line 245, in get
  File "/srv/homeassistant/homeassistant_0_33_3/lib/python3.4/site-packages/homeassistant/components/history.py", line 70, in get_significant_states
  File "/srv/homeassistant/homeassistant_0_33_3/lib/python3.4/site-packages/homeassistant/components/history.py", line 245, in get
  File "/srv/homeassistant/homeassistant_0_33_3/lib/python3.4/site-packages/homeassistant/components/history.py", line 70, in get_significant_states
  File "/srv/homeassistant/homeassistant_0_33_3/lib/python3.4/site-packages/homeassistant/components/history.py", line 245, in get
  File "/srv/homeassistant/homeassistant_0_33_3/lib/python3.4/site-packages/homeassistant/components/history.py", line 70, in get_significant_states

I understand that i have in error in this python file, but someone has or had the same error?

thanks