2017-10-08 18:47:55 ERROR (MainThread) [homeassistant.components.camera] Error while setting up platform synology
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 164, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=self.hass.loop)
File "/usr/lib/python3.4/asyncio/tasks.py", line 372, in wait_for
return fut.result()
File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
raise self._exception
File "/usr/lib/python3.4/asyncio/tasks.py", line 237, in _step
result = next(coro)
File "/usr/lib/python3.4/asyncio/coroutines.py", line 141, in coro
res = func(*args, **kw)
File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/camera/synology.py", line 54, in async_setup_platform
timeout=timeout
File "/srv/homeassistant/lib/python3.4/site-packages/synology/surveillance_station.py", line 9, in __init__
self._api = Api(url, username, password, timeout, verify_ssl)
File "/srv/homeassistant/lib/python3.4/site-packages/synology/api.py", line 56, in __init__
self._initialize_api_info()
File "/srv/homeassistant/lib/python3.4/site-packages/synology/api.py", line 66, in _initialize_api_info
response = self._get_json(self._base_url + 'query.cgi', payload)
File "/srv/homeassistant/lib/python3.4/site-packages/synology/api.py", line 189, in _get_json
content = json.loads(response.content)
File "/usr/lib/python3.4/json/__init__.py", line 312, in loads
s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes'
Hi @snjoetw, can you please include in the “/usr/local/lib/python3.6/site-packages/synology/surveillance_station.py” the settings for motion detection by camera as well, at the moment is disabled or by surveillance station. Thanks a lot
Hi, thanks for getting back to me.
In the surveillance_station.pyfile you can import from api.py the “MOTION_DETECTION_SOURCE_BY_CAMERA” at line 1
and at the end of the file add
" def motion_detection_camera(self, camera_id):
“”“Disable motion detection for camera matching camera_id.”""
self._api.camera_event_md_param_save(
camera_id,
source=MOTION_DETECTION_SOURCE_BY_CAMERA)"
To avoid confusion, at line 44 change “enable_motion_detection” to “motion_detection_surveilance”.
the result will have 3 services:
“motion_detection_surveilance”
“disable_motion_detection”
“motion_detection_camera”