8000 Hikvision Camera Switch does not work 0.57 · Issue #10440 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Hikvision Camera Switch does not work 0.57 #10440

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
blanard opened this issue Nov 7, 2017 · 1 comment · Fixed by #10608
Closed

Hikvision Camera Switch does not work 0.57 #10440

blanard opened this issue Nov 7, 2017 · 1 comment · Fixed by #10608

Comments

@blanard
Copy link
blanard commented Nov 7, 2017

Make sure you are running the latest version of Home Assistant before reporting an issue.

You should only file an issue if you found a bug. Feature and enhancement requests should go in the Feature Requests section of our community forum:

Home Assistant release (hass --version):
0.57.2

Python release (python3 --version):
3.5.3

Component/platform:
Hikvision Camera Switch

Description of problem:
Traceback on changing the switch state. Unable to change status from UI.
Status is read and shown correctly

Expected:
No Traceback. Change the state from the UI and set the camera.

Problem-relevant configuration.yaml entries and steps to reproduce:

switch:
  - platform: hikvisioncam
    host: 192.168.0.233
    username: HA-User
    password: <removed>

Click on switch on UI
2.
3.

Traceback (if applicable):

Nov 07 20:19:44 raspberrypi hass[12803]: 2017-11-07 20:19:44 INFO (Thread-8) [hikvision.api] Current motion detection state? enabled: false
Nov 07 20:19:44 raspberrypi hass[12803]: 2017-11-07 20:19:44 INFO (Thread-8) [homeassistant.components.switch.hikvisioncam] enabled: False
Nov 07 20:19:45 raspberrypi hass[12803]: 2017-11-07 20:19:45 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: service_call_id=1970943728-4, domain=homeassistant, service=turn_on, service_data=entity_id=switch.hikvision_camera_motion_detection>
Nov 07 20:19:45 raspberrypi hass[12803]: 2017-11-07 20:19:45 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: service_call_id=1970943728-5, domain=switch, service=turn_on, service_data=entity_id=['switch.hikvision_camera_motion_detection']>
Nov 07 20:19:45 raspberrypi hass[12803]: 2017-11-07 20:19:45 INFO (Thread-19) [homeassistant.components.switch.hikvisioncam] Turning on Motion Detection 
Nov 07 20:19:45 raspberrypi hass[12803]: 2017-11-07 20:19:45 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Nov 07 20:19:45 raspberrypi hass[12803]: Traceback (most recent call last):
Nov 07 20:19:45 raspberrypi hass[12803]:   File "/srv/homeassistant/lib/python3.5/site-packages/requests/utils.py", line 868, in check_header_validity
Nov 07 20:19:45 raspberrypi hass[12803]:     if not pat.match(value):
Nov 07 20:19:45 raspberrypi hass[12803]: TypeError: expected string or bytes-like object
Nov 07 20:19:45 raspberrypi hass[12803]: During handling of the above exception, another exception occurred:
Nov 07 20:19:45 raspberrypi hass[12803]: Traceback (most recent call last):
Nov 07 20:19:45 raspberrypi hass[12803]:   File "/usr/lib/python3.5/asyncio/tasks.py", line 241, in _step
Nov 07 20:19:45 raspberrypi hass[12803]:     result = coro.throw(exc)
Nov 07 20:19:45 raspberrypi hass[12803]:   File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/core.py", line 1038, in _event_to_service_call
Nov 07 20:19:45 raspberrypi hass[12803]:     yield from service_handler.func(service_call)
Nov 07 20:19:45 raspberrypi hass[12803]:   File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/switch/__init__.py", line 113, in async_handle_switch_service
Nov 07 20:19:45 raspberrypi hass[12803]:     yield from switch.async_turn_on()
Nov 07 20:19:45 raspberrypi hass[12803]:   File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
Nov 07 20:19:45 raspberrypi hass[12803]:     yield self  # This tells Task to wait for completion.
Nov 07 20:19:45 raspberrypi hass[12803]:   File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
Nov 07 20:19:45 raspberrypi hass[12803]:     future.result()
Nov 07 20:19:45 raspberrypi hass[12803]:   File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
Nov 07 20:19:45 raspberrypi hass[12803]:     raise self._exception
Nov 07 20:19:45 raspberrypi hass[12803]:   File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
Nov 07 20:19:45 raspberrypi hass[12803]:     result = self.fn(*self.args, **self.kwargs)
Nov 07 20:19:45 raspberrypi hass[12803]:   File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/switch/hikvisioncam.py", line 93, in turn_on
Nov 07 20:19:45 raspberrypi hass[12803]:     self._hikvision_cam.enable_motion_detection()
Nov 07 20:19:45 raspberrypi hass[12803]:   File "/srv/homeassistant/lib/python3.5/site-packages/hikvision/api.py", line 230, in enable_motion_detection
Nov 07 20:19:45 raspberrypi hass[12803]:     self.put_motion_detection_xml(self.xml_motion_detection_on)
Nov 07 20:19:45 raspberrypi hass[12803]:   File "/srv/homeassistant/lib/python3.5/site-packages/hikvision/api.py", line 247, in put_motion_detection_xml
Nov 07 20:19:45 raspberrypi hass[12803]:     self._username, self._password), data=xml, headers=headers)
Nov 07 20:19:45 raspberrypi hass[12803]:   File "/srv/homeassistant/lib/python3.5/site-packages/requests/api.py", line 126, in put
Nov 07 20:19:45 raspberrypi hass[12803]:     return request('put', url, data=data, **kwargs)
Nov 07 20:19:45 raspberrypi hass[12803]:   File "/srv/homeassistant/lib/python3.5/site-packages/requests/api.py", line 58, in request
Nov 07 20:19:45 raspberrypi hass[12803]:     return session.request(method=method, url=url, **kwargs)
Nov 07 20:19:45 raspberrypi hass[12803]:   File "/srv/homeassistant/lib/python3.5/site-packages/requests/sessions.py", line 494, in request
Nov 07 20:19:45 raspberrypi hass[12803]:     prep = self.prepare_request(req)
Nov 07 20:19:45 raspberrypi hass[12803]:   File "/srv/homeassistant/lib/python3.5/site-packages/requests/sessions.py", line 437, in prepare_request
Nov 07 20:19:45 raspberrypi hass[12803]:     hooks=merge_hooks(request.hooks, self.hooks),
Nov 07 20:19:45 raspberrypi hass[12803]:   File "/srv/homeassistant/lib/python3.5/site-packages/requests/models.py", line 306, in prepare
Nov 07 20:19:45 raspberrypi hass[12803]:     self.prepare_headers(headers)
Nov 07 20:19:45 raspberrypi hass[12803]:   File "/srv/homeassistant/lib/python3.5/site-packages/requests/models.py", line 440, in prepare_headers
Nov 07 20:19:45 raspberrypi hass[12803]:     check_header_validity(header)
Nov 07 20:19:45 raspberrypi hass[12803]:   File "/srv/homeassistant/lib/python3.5/site-packages/requests/utils.py", line 872, in check_header_validity
Nov 07 20:19:45 raspberrypi hass[12803]:     "bytes, not %s" % (name, value, type(value)))
Nov 07 20:19:45 raspberrypi hass[12803]: requests.exceptions.InvalidHeader: Value for header {Content-Length: 353} must be of type str or bytes, not <class 'int'>
Nov 07 20:19:55 raspberrypi hass[12803]: 2017-11-07 20:19:55 INFO (MainThread) Nov 07 20:20:15 raspberrypi hass[12803]: 2017-11-07 20:20:15 INFO (Thread-6) [hikvision.api] Current motion detection state? enabled: false
Nov 07 20:20:15 raspberrypi hass[12803]: 2017-11-07 20:20:15 INFO (Thread-6) [homeassistant.components.switch.hikvisioncam] enabled: False

Additional info:
worked fine before

@blanard blanard changed the title Hikvision Camera Switch Traceback since 0.57 Hikvision Camera Switch does not work 0.57 Nov 15, 2017
@blanard
Copy link
Author
blanard commented Nov 15, 2017

same problem on->off or off->on #10606

@home-assistant home-assistant locked and limited conversation to collaborators Mar 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant
0