Hey, just upgraded to 0.65.2 and the SQL Sensor creates the following error, any ideas?
2018-03-11 11:40:42 ERROR (MainThread) [homeassistant.components.sensor] sql: Error on device update!
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 188, in _async_add_entity
await entity.async_device_update(warning=False)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 327, in async_device_update
yield from self.hass.async_add_job(self.update)
File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
raise self._exception
File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/sensor/sql.py", line 147, in update
value = float(decimal)
TypeError: float() argument must be a string or a number, not 'module'
I know this is a bit late, but here’s the SQL to get the top 20 entities contributing to the state table without having to do piping and string processing:
SELECT
entity_id,
COUNT(entity_id)
FROM
states
GROUP BY
entity_id
ORDER BY COUNT(entity_id) DESC
LIMIT 20;
I did a similar thing, however I am using a remote PostgreSQL instance. I wrote a script that connects to the PostgreSQL instance and polls the home assistant database size and prints it in bytes.
Not sure what happened after an update to Qnap 4.3.4.0516, no changes have been made to my HA config, but HA can’t seem to connect to sql database, connection is refused.
192.168.200.210 is my Pi3 IP Address.
2018-04-16 21:19:49 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (_mysql_exceptions.OperationalError) (1129, "Host '192.168.200.210' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'") (Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)
Different purposes… can’t use grafana for the history component due to the relational structure used by this component (I actually looked into developing that feature)