kevinvincent / ha-wyzesense

A Home Assistant Component to interface with the WYZE Sense hub and sensor system
369 stars 101 forks source link

Bridge works once #86

Closed JVKran closed 4 years ago

JVKran commented 4 years ago

EDIT: I wrote my own program that functions as a bridge between the Wyze Sense Bridge and MQTT. This way simple MQTT-Binary Sensors can be used in Home-Assistant without any problems. For anyone interested; here it is!

First of all, thanks for writing this component! It's truly amazing this is working.

The sad part is that I am only able to get the bridge to work once. After that it returns the _DoCommand error. I'm running Raspbian Buster with a Python Virtual Environment installation running as another user. I've tried this with the udev rule added and removed. Neither of them worked.

This is some dmesg output. It looks like the bridge is connected twice? I've tried using both hidraw0 and hidraw2. [ 0.788085] hidraw: raw HID events driver (C) Jiri Kosina [ 2.356248] hid-generic 0003:1A86:E024.0001: hiddev96,hidraw0: USB HID v1.00 Device [HID 1a86:e024] on usb-3f980000.usb-1.3/input0 [ 3.412560] hid-generic 0003:0951:16A4.0002: input,hiddev97,hidraw1: USB HID v1.11 Device [Kingston HyperX 7.1 Audio] on usb-3f980000.usb-1.2/input3 [ 2474.819601] hid-generic 0003:1A86:E024.0003: hiddev96,hidraw2: USB HID v1.00 Device [HID 1a86:e024] on usb-3f980000.usb-1.3/input0

This is the log file. It mentions a broken pipe error. I'd be glad if you'll be able to point me in the right direction. It clearly is a setup related problem.

2020-01-11 14:55:11 WARNING (SyncWorker_0) [homeassistant.util.yaml.loader] YAML file /home/homeassistant/.homeassistant/configuration.yaml contains duplicate key "service". Check lines 610 and 613. 2020-01-11 14:55:15 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for wyzesense which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do$2020-01-11 14:55:17 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for huesensor which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do$2020-01-11 14:55:37 WARNING (MainThread) [homeassistant.setup] Setup of person is taking over 10 seconds. 2020-01-11 14:55:37 WARNING (MainThread) [homeassistant.setup] Setup of input_select is taking over 10 seconds. 2020-01-11 14:55:37 WARNING (MainThread) [homeassistant.setup] Setup of timer is taking over 10 seconds. 2020-01-11 14:55:37 WARNING (MainThread) [homeassistant.setup] Setup of input_number is taking over 10 seconds. 2020-01-11 14:55:37 WARNING (MainThread) [homeassistant.setup] Setup of input_datetime is taking over 10 seconds. 2020-01-11 14:55:37 WARNING (MainThread) [homeassistant.components.weather] Setup of platform buienradar is taking over 10 seconds. 2020-01-11 14:55:37 WARNING (MainThread) [homeassistant.components.binary_sensor] Setup of platform template is taking over 10 seconds. 2020-01-11 14:55:37 WARNING (MainThread) [homeassistant.components.binary_sensor] Setup of platform template is taking over 10 seconds. 2020-01-11 14:55:37 WARNING (MainThread) [homeassistant.components.binary_sensor] Setup of platform wyzesense is taking over 10 seconds. 2020-01-11 14:55:37 WARNING (MainThread) [homeassistant.components.binary_sensor] Setup of platform template is taking over 10 seconds. 2020-01-11 14:55:37 WARNING (MainThread) [homeassistant.components.binary_sensor] Setup of platform template is taking over 10 seconds. 2020-01-11 14:55:39 ERROR (MainThread) [homeassistant.components.hue] Error connecting to the Hue bridge at 192.168.178.90 2020-01-11 14:55:39 WARNING (MainThread) [homeassistant.config_entries] Config entry for hue not ready yet. Retrying in 5 seconds. 2020-01-11 14:55:39 WARNING (MainThread) [homeassistant.config_entries] Config entry for adguard not ready yet. Retrying in 5 seconds. 2020-01-11 14:55:42 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up platform wyzesense Traceback (most recent call last): File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 150, in _async_setup_platform await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT) File "/usr/lib/python3.7/asyncio/tasks.py", line 416, in wait_for return fut.result() File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/home/homeassistant/.homeassistant/custom_components/wyzesense/binary_sensor.py", line 98, in setup_platform ws = beginConn() File "</srv/homeassistant/lib/python3.7/site-packages/decorator.py:decorator-gen-2>", line 2, in beginConn File "/srv/homeassistant/lib/python3.7/site-packages/retry/api.py", line 74, in retry_decorator logger) File "/srv/homeassistant/lib/python3.7/site-packages/retry/api.py", line 33, in __retry_internal return f() File "/home/homeassistant/.homeassistant/custom_components/wyzesense/binary_sensor.py", line 96, in beginConn return Open(config[CONF_DEVICE], on_event) File "/home/homeassistant/.homeassistant/custom_components/wyzesense/wyzesense_custom.py", line 561, in Open return Dongle(device, event_handler) File "/home/homeassistant/.homeassistant/custom_components/wyzesense/wyzesense_custom.py", line 297, in __init__ self._Start() File "/home/homeassistant/.homeassistant/custom_components/wyzesense/wyzesense_custom.py", line 492, in _Start self._Inquiry() File "/home/homeassistant/.homeassistant/custom_components/wyzesense/wyzesense_custom.py", line 398, in _Inquiry resp = self._DoSimpleCommand(Packet.Inquiry()) File "/home/homeassistant/.homeassistant/custom_components/wyzesense/wyzesense_custom.py", line 393, in _DoSimpleCommand self._DoCommand(pkt, cmd_handler, timeout) File "/home/homeassistant/.homeassistant/custom_components/wyzesense/wyzesense_custom.py", line 379, in _DoCommand self._SendPacket(pkt) File "/home/homeassistant/.homeassistant/custom_components/wyzesense/wyzesense_custom.py", line 331, in _SendPacket pkt.Send(self.__fd) File "/home/homeassistant/.homeassistant/custom_components/wyzesense/wyzesense_custom.py", line 106, in Send ss = os.write(fd, pkt) BrokenPipeError: [Errno 32] Broken pipe 2020-01-11 14:55:52 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for philips_android_tv which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it $2020-01-11 14:55:57 WARNING (MainThread) [homeassistant.components.alarm_control_panel] Setup of platform mqtt is taking over 10 seconds. 2020-01-11 14:56:07 WARNING (MainThread) [homeassistant.components.weather] Setup of platform met is taking over 10 seconds. 2020-01-11 14:56:07 WARNING (MainThread) [homeassistant.components.camera] Setup of platform mjpeg is taking over 10 seconds. 2020-01-11 14:56:07 WARNING (MainThread) [homeassistant.components.camera] Setup of platform generic is taking over 10 seconds. 2020-01-11 14:56:07 WARNING (MainThread) [homeassistant.components.binary_sensor] Setup of platform toon is taking over 10 seconds. 2020-01-11 14:56:14 WARNING (MainThread) [homeassistant.components.binary_sensor] Setup of platform updater is taking over 10 seconds. 2020-01-11 14:56:14 WARNING (MainThread) [homeassistant.components.media_player] Setup of platform universal is taking over 10 seconds. 2020-01-11 14:56:19 ERROR (MainThread) [metno] https://aa015h6buqvih86i1.api.met.no/weatherapi/locationforecast/1.9/ returned 2020-01-11 14:56:19 ERROR (MainThread) [homeassistant.components.met.weather] Retrying in 15 minutes 2020-01-11 14:56:23 WARNING (MainThread) [homeassistant.components.light] Setup of platform mqtt is taking over 10 seconds. 2020-01-11 14:56:37 WARNING (MainThread) [homeassistant.components.media_player] Setup of platform spotify is taking over 10 seconds. 2020-01-11 14:56:50 WARNING (MainThread) [homeassistant.components.switch] Setup of platform mqtt is taking over 10 seconds. 2020-01-11 14:56:58 ERROR (SyncWorker_1) [homeassistant.components.postnl.sensor] Can't connect to the PostNL webservice Traceback (most recent call last): File "/srv/homeassistant/lib/python3.7/site-packages/postnl_api/postnl_api.py", line 179, in _request_login data = response.json() File "/srv/homeassistant/lib/python3.7/site-packages/requests/models.py", line 897, in json return complexjson.loads(self.text, **kwargs) File "/usr/lib/python3.7/json/__init__.py", line 348, in loads return _default_decoder.decode(s) File "/usr/lib/python3.7/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.7/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/postnl/sensor.py", line 46, in setup_platform api = PostNL_API(username, password) File "/srv/homeassistant/lib/python3.7/site-packages/postnl_api/postnl_api.py", line 57, in __init__ self._request_login() File "/srv/homeassistant/lib/python3.7/site-packages/postnl_api/postnl_api.py", line 182, in _request_login raise (UnauthorizedException()) postnl_api.postnl_api.UnauthorizedException 2020-01-11 14:57:02 WARNING (SyncWorker_9) [homeassistant.components.fritzbox_callmonitor.sensor] Phonebook with ID 0 not found on Fritz!Box 2020-01-11 15:00:39 ERROR (stream_worker) [homeassistant.components.stream.worker] Error demuxing stream: No dts in packet

JVKran commented 4 years ago

I'm closing this issue since I wrote my own fully functional component. Check it out here