Dear all:
my amcrest camera was working well under hass.io
these are my configuration:
amcrest:
host: 192.168.34.109
username: user
password: XXYYZZ
resolution: low
stream_source: mjpeg
sensors:
- motion_detector
- sdcard
camera 1:
platform: amcrest
host: 192.168.34.109
username: user
password: XXYYZZ
name: cameraLiving
Then, I switched to hassbian.
the very same configuration file no longer works. It give not-so informative error:
Invalid config
The following components and platforms could not be set up:
camera.amcrest
amcrest
Please check your config.
Upon further examination, I found something strange in homeassistant.log file:
2018-02-01 22:44:17 WARNING (Recorder) [homeassistant.components.recorder] Ended unfinished session (id=43 from 2018-02-02 06:37:29.160585)
2018-02-01 22:44:23 ERROR (MainThread) [homeassistant.setup] Error during setup of component amcrest
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/setup.py", line 199, in _async_setup_component
component.setup, hass, processed_config)
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/amcrest.py", line 99, in setup
device.get(CONF_PASSWORD)).camera
File "/srv/homeassistant/lib/python3.5/site-packages/amcrest/__init__.py", line 32, in __init__
timeout_protocol=timeout_protocol
File "/srv/homeassistant/lib/python3.5/site-packages/amcrest/http.py", line 67, in __init__
self._token = self._generate_token()
File "/srv/homeassistant/lib/python3.5/site-packages/amcrest/http.py", line 82, in _generate_token
req.raise_for_status()
File "/srv/homeassistant/lib/python3.5/site-packages/requests/models.py", line 935, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: http://192.168.34.109:80/cgi-bin/magicBox.cgi?action=getMachineName
2018-02-01 22:44:23 ERROR (MainThread) [homeassistant.setup] Unable to setup dependencies of camera.amcrest. Setup failed for dependencies: amcrest
2018-02-01 22:44:23 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform camera.amcrest: Could not setup all dependencies.
2018-02-01 22:44:23 ERROR (Recorder) [homeassistant.components.recorder.util] Error executing query: (sqlite3.DatabaseError) database disk image is malformed [SQL: 'INSERT INTO events (event_type, event_data, origin, time_fired, created) VALUES (?, ?, ?, ?, ?)'] [parameters: ('service_registered', '{"service": "purge", "domain": "recorder"}', 'LOCAL', '2018-02-02 06:44:16.159696', '2018-02-02 06:44:23.571472')] (Background on this error at: http://sqlalche.me/e/4xp6)
it looks like recorder sqlite file is corrupted?
thanks in advance