Export History to CSV

Found a relatively simple way to do this:

  1. Install SQLite Web add-on (GitHub - hassio-addons/addon-sqlite-web: SQLite Web - Home Assistant Community Add-ons) and open Web UI
  2. Select “states” table
  3. Select “Query” tab.
  4. Enter SQL query and click execute: it will report the first 1000 rows if successful

SELECT * FROM states WHERE entity_id = "sensor.your_sensor_id"

  1. Click on “Export CSV”: it will have all rows