No history at all and error message 'Cannot read property 'v' of undefined'

A couple of days ago, before I upgraded to 0.50.2, I started noticing that some sensors were not showing history (mostly temperature/humidity, etc). All sensors are working/reporting properly, because I have their values being updated in prometheus, just no history appears either on the ‘History’ tab or the sensor.

Clicking over ANY value sensor (temp/humidity, for instance), shows message ‘No state history found.’ instead of the graph with the history of values.

I had done some changes in the history component, but after going back to the same configuration I had before, it still didn’t work. Here it is how it is now:

      - light
      - sensor
      - switch
      - binary_sensor.motion_sensor_158xxxxxxxxxxx
      - binary_sensor.motion_sensor_158xxxxxxxxxxx
      - sensor.illumination_158dxxxxxxxxxxx
      - sensor.wake
      - sensor.time
      - sensor.time_from
      - sensor.time_to
      - sensor.free_space_mbln
      - sensor.free_space_mbl
      - sensor.free_space_media
      - sensor.ndionisios_iphone_battery_level
      - sensor.ndionisios_iphone_battery_state
      - sensor.nmdionisios_ipad_battery_level
      - sensor.nmdionisios_ipad_battery_state
      - sensor.pecinha_iphone_battery_level
      - sensor.pecinha_iphone_battery_state
      - sensor.battery_bedroom_temp_sensor
      - sensor.battery_living_room_button
      - sensor.battery_living_room_temp_sensor
      - sensor.battery_motion_sensor_hall
      - sensor.battery_motion_sensor_dispensa
      - sensor.battery_office_temp_sensor
      - sensor.battery_bedroom_button
      - sensor.battery_fridge_door_sensor
      - sensor.battery_spare_temp_sensor
      - sensor.battery_aqara_temp_sensor
      - sensor.battery_cube
      - sensor.bedroom_sensor_battery_low
      - sensor.bedroom_button_battery_low
      - sensor.living_room_button_battery_low
      - sensor.living_room_sensor_battery_low
      - sensor.office_sensor_battery_low
      - sensor.motion_sensor_hall_battery_low
      - sensor.motion_sensor_dispensa_battery_low
      - sensor.fridge_door_sensor_battery_low
      - sensor.spare_sensor_battery_low
      - sensor.aqara_sensor_battery_low
      - sensor.cube_battery_low
      - sensor.cube_state
      - sensor.pws_weather
      - sensor.time_machine_backup
      - sensor.nas_backup
      - sensor.before_sunset
      - sensor.before_sunrise
      - sensor.brown
      - sensor.yellow
      - sensor.white
      - switch.nothome
      - sensor.kodi_temp_c
      - sensor.current_ha_version
      - sensor.installed_version

Clicking over switch sensors now shows a red message saying ‘Cannot read property ‘v’ of undefined’, with an X to close. Closing does nothing except making the message disappear.

I already tried to stop HASS, deleting file home-assistant_v2.db and then starting HASS again, to get the file recreated. Nothing seems to improve this situation.

Can anyone help understand what’s wrong with my HASS installation? Issue seems generic and not specific to any sensor, but if you think it is useful, let me know and I can share any relevant configuration.

Thanks in advance.

1 Like

No one has any tip to try to figure out what may be wrong?

I generally scan through log files. There is usually some indication. You can try a terminal session in one window with a
tail -f /path/to/logfile |grep error
and restart hass in another window. Try the home-assistant.log file first but also /var/log/syslog

I see the same error. Not sure why yet. If I find out… I’ll reply with the answer.

1 Like

It was worth the try, but nothing relevant appears…

I’m about to install HASS from scratch if this doesn’t get solved…

You might want to add your observations to the github issue.

1 Like

After installing a new separate instance of HASS, all was working properly until I copied in the config yaml files, and it all went back… This has shown me that some issue was within my configuration.

I feel a bit ashamed that I did not notice it before, but actually I misunderstood the purpose of the recorder component. I had added a single domain included in a whitelist for the recorder, which was causing the issues I reported.

Something like the following:

  db_url: !secret mysql_db
  # Delete events and states older than 1 week
  purge_days: 7
      - automation
      - light
      - sensor
      - switch

This doesn’t make sense, because if I say that I will only record domain automation on the database, I cannot expect domains light/sensor/switch to be shown in history (considering that history reads data saved by record component).

After fixing this, all went back to normal…

Thanks anyway to everyone that jumped in to try to help.

A problem which I usually classify as interface problem between keyboard and chair.

1 Like