History and logbook does not load

I have a problem with my home assistant installation ver 0.26.3 on QNAP TS-210 (arm based linux).

When I try to show history neither logbook, only see loading gif.

The home-assistant.db does not create. If i configure recorder with mysql (db_url), the tables are not created on my mysql server.

In the logs are not errors :frowning:
Any ideas?

Mi conf is this:

  # Name of the location where Home Assistant is running
  name: Home
  # Location required to calculate the time the sun rises and sets
  latitude: !secret home_lat
  longitude: !secret home_long
  # Impacts weather/sunrise data
  elevation: !secret home_elev
  # metric for Metric, imperial for Imperial
  unit_system: metric
  # Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  time_zone: Europe/Madrid
  # customization
  customize: !include customize.yaml

zone:
  name: school
  latitude: !secret school_lat
  longitude: !secret school_long
  icon: mdi:school
zone 2:
  name: work_d
  latitude: !secret work_d_lat
  longitude: !secret work_d_long
  icon: mdi:worker

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

# Enables the frontend
frontend:

http:
  # Uncomment this to add a password (recommended!)
  api_password: !secret front_end_pw
  ssl_certificate: ssl/SSLcertificate.crt
  ssl_key: ssl/SSLprivatekey.key

# Checks for available updates
updater:

# Discover some devices automatically
discovery:

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

recorder:
  purge_days: 14
  db_url: !secret db_url

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

# View all events in a logbook
logbook:

# Track the sun
sun:

# Weather Prediction
sensor:
  platform: yr
  monitored_conditions:
    - temperature
    - symbol
    - precipitation
    - windSpeed
    - humidity

media_player:
  platform: pioneer
  host: !secret pioneer_host
  name: A/V Pioneer

mqtt:
  broker: !secret mqtt_server
  port: !secret mqtt_port
  username: !secret mqtt_user
  password: !secret mqtt_pw

device_tracker:
  - platform: ddwrt
    host: !secret ddwrt_host
    username: !secret ddwrt_username
    password: !secret ddwrt_pw
    # If new discovered devices are tracked by default (default: yes)
    track_new_devices: yes
    # Seconds between each scan for new devices (default: 12)
    interval_seconds: 30
    # Seconds to wait till marking someone as not home after not being seen
    # (default: 180)
    consider_home: 180
  - platform: owntracks
    max_gps_accuracy: 200

switch:
  platform: transmission
  host: !secret transmission_host
  port: 9091
  name: Transmission
  username: !secret transmission_user
  password: !secret transmission_pw

group: !include group.yaml

automation: !include automation.yaml

Does HA have write permission in the directory in question?

Ye, the log home-assistant.log is created correctly.

On QNAP, all app run as admin (root)

I’m having the same problem on my QNAP TS-231. Some api calls like history or logbook do not load. Did you find a way to solve the issue?

Same experience for me on TS-231. DB file is missing in the conf dir and nothing in the home-assistant.log that references DB creation.

After no luck with Sqlite, I got history/logbook working with MariaDB included on TS-231:

  1. Enable MariaDB in NAS UI (Control Panel->Applications->SQL Server)
  2. Created a new database in MariaDB named homeassistant
  3. Created a new user and granted privileges to homeassistant
  4. Modified configuration.yaml:

recorder: db_url: mysql+pymysql://myuser:mypass@localhost/homeassistant

  1. Install pymysql: /share/CACHEDEV1_DATA/.qpkg/Python3/python3/bin/pip3 install pymysql
  2. Restart Home Assistant

:slight_smile:

1 Like

Hi there,

Are you sure it’s db_url: mysql+pymysql://myuser:mypass@localhost/homeassistant ? i did as you said, have pymysql installed, but still not working…