"No state history found." - How to configure history: and recorder: correctly?

This is the relevant part of my configuration.yaml:

history: !include items-to-record.yaml

recorder: !include items-to-record.yaml

logbook:

items-to-record.yaml’s content is:

  include:
    entities:
      - binary_sensor.downstairs_bureau_window_sensor
      - binary_sensor.downstairs_loggia_door_sensor
      - binary_sensor.living_loggia_door_sensor
      - binary_sensor.downstairs_sleeping_window_sensor
      - binary_sensor.living_entrance_door_sensor
      - sensor.pm25
      - sensor.pm10
    domains:
      - switch
      - light

If the content of “items-to-record.yaml” is included with the !include switch or not (directly integrated in the configuration.yaml) seems not to matter.

I tested if it matters if I have the “domains:” named before the “entities:”. It doesn’t.

At the moment I get this result when clicking on my pm25 sensor:

image

HASS obviously tells me that I dont have state history. Why this? Can anyone help me?

Thank you!

1 Like

try separating history and recorder items to 2 separate files

I’ll try. Whats the thought behind your input? Cheers!

Ok, just tried it. Nothing changed. From a yaml point of view this was predictable; thanks anyway! I’m still lost here…

I had the same issue. I was trying to include light and switch as domains, then also include multiple entitites. The recorder was recording all of the domains, but wasn’t recording any of the entities I had specified.

I removed the domains and instead listed each light and switch entity and it now seems to work fine, recording all of the entities I have specified without missing any.

Looking through the documentation it seems you can exclude both domains and entities, but if you include domains, you can only exclude entities; you can’t include both entities and domains.

In my case not even the domains are recorded. There is no state history for anything it seems…

Now I removed the includes to record everything and it records everything…

@thundergreen opened an issue over at github. Feel free to post there:
https://github.com/home-assistant/home-assistant/issues/8312

1 Like

I don’t use the includes: part but I use excludes: and it works just fine. Just for giggles, try renaiming your .yaml files you include for history: and recorder: to remove the hyphen. it shouldn’t matter but testing has to start somewhere.

EDIT: I see you said you removed the !include part of your configuration file and it still did not show any history. Did you restart HASS or reload the core config, wait a few minutes, then check again? Does your error log (add logger: to your configuration) show any errors? Does your yaml check as valid?

Maybe a dumb question, but has it ever worked?

If not it might be useful to try

history:

recorder: 

With no file includes, then if it works ramp into whitelist and blacklisting items.

History works out-of-the-box in Hassio so this is based on my experience with the “starter” config.

Thanks for asking! Yes it worked before. I started using hass a year ago and had

history:

recorder: 

in my config. Everything (really everything) was recorded. My 16GB SD-Card in my Raspi was filled with a database of a size of 10 GB… I then cleared the database and started to minimze the recorded states with

history:
  include:
    entities:
      - binary_sensor.downstairs_bureau_window_sensor
      - binary_sensor.downstairs_loggia_door_sensor
      - binary_sensor.living_loggia_door_sensor
      - binary_sensor.downstairs_sleeping_window_sensor
      - binary_sensor.living_entrance_door_sensor
      - sensor.pm25
      - sensor.pm10
    domains:
      - switch
      - light

recorder:
  include:
    entities:
      - binary_sensor.downstairs_bureau_window_sensor
      - binary_sensor.downstairs_loggia_door_sensor
      - binary_sensor.living_loggia_door_sensor
      - binary_sensor.downstairs_sleeping_window_sensor
      - binary_sensor.living_entrance_door_sensor
      - sensor.pm25
      - sensor.pm10
    domains:
      - switch
      - light

Then I decided to clean up my config and outsource the part that is repeated. The config was then:

history: !include items-to-record.yaml

recorder: !include items-to-record.yaml

logbook:

I noticed that this does not work. I reverted the outsourcing and noticed this does not work either.

So summarized: As soon as I include entities or domains nothing gets recorded. This seems to be a bug. history: or recorded: seems to be broken.

thundergreen opend an issue at github concerning this problem. See above.

Cheers!

Hi @squirtbrnr!

Good catch! I’ll try to only exclude the specifies domains and entities from the recorder: component asap. Perhaps this is the crucial point.

This works just fine:

history:

recorder: 

logger: component is activated; yells nothing. Files are valid yaml.

Thank you for being concerned about this!

It seems the problem occurs when I include domains or entities in the history component.

This seems to work:

history:

recorder: !include items-to-record.yaml

logbook:

I have just
history:
recorder:
I see history and logs tabs just fine but when i click on any switch/sensor/device… I get No state history found like in 9 of 10 times

1 Like

I haven’t changed anything in history, recorder or logbook as far as I can remember but suddenly experience problems. Like @t.srubar wrote, most of the times No state history found. Sometimes the history flashes just before, sometimes it shows up. Seems to be more problems with “binary” stuff, motion and other on/off things and less with lux or temperature.

Does that even make sense…?
/Johan

The 62 update seemingly broke something with the history. I also get: “No state history found” in most cases. It worked perfectly well before the update.

2 Likes

Same. Also noticed ubus/odhcpd is no longer reliable since upgrading to 0.62

Me too - history is definitely broken since updating to 0.62 on the weekend

I have the same issue since upgrading Hass.io to 0.62.0 If I repeatedly select a sensor, the history graph occasionally appears.

same, update seems to have broken the history im on Hassbain 0.62.0

Have to downgrade to 0.61.1 because none of my automations fired today as ubus didn’t detect I wasn’t home (although the BLE Tile portion did) – I sometimes get history per sensor/item (and always shows in history tab) but presence detection doesn’t work reliably (ubus+tile) so I’m going to downgrade for now.