Closed frankie-boy-hgv closed 4 months ago
i just upgraded ha after few months and this error now prevent sql feature working...
Home Assistant must have released an update that broke the recorder (database) API. Can you wrap your query in text()
and see if that fixes it?
Hi,
After installing the new update I get errors running my sql-queries:
2023-03-02 19:05:00.310 ERROR (SyncWorker_13) [custom_components.var] Error executing query SELECT state FROM statistics WHERE metadata_id = (SELECT id FROM statistics_meta WHERE statistic_id = 'sensor.solaredge_lifetime_energy') AND DATETIME(created_ts, 'unixepoch') BETWEEN DATETIME('now', '-1 year') AND DATETIME(DATETIME('now', '4 hours'), '-1 year') ORDER BY DATETIME(created_ts, 'unixepoch') ASC LIMIT 1: Textual SQL expression 'SELECT state FROM statist...' should be explicitly declared as text('SELECT state FROM statist...')
Any idea what could be wrong?
Regards,
Frank