ha-wyzesense
ha-wyzesense copied to clipboard
hidev/Synology DSM Support
Currently many users run home assistant with docker on Synology hardware. The problem this presents is Synology mounts usb with hiddev, not hidraw. I don’t know if it’s possible, but it would be great to support hiddev.
https://www.kernel.org/doc/Documentation/hid/hiddev.txt
https://www.kernel.org/doc/Documentation/hid/hidraw.txt
Throwing my vote in for this support as well. I'm using the MQTT/Docker version of this on a Raspberry Pi, but I'd love a native HASS integration with my Synology machine.
To give more context here, this is the error I get when trying to use /dev/usb/hiddev8
2019-11-09 21:24:00 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.wyzesense
2019-11-09 21:24:00 DEBUG (SyncWorker_4) [custom_components.wyzesense.binary_sensor] WYZESENSE v0.0.4
2019-11-09 21:24:00 DEBUG (SyncWorker_4) [custom_components.wyzesense.binary_sensor] Attempting to open connection to hub at /dev/usb/hiddev8
2019-11-09 21:24:00 DEBUG (SyncWorker_4) [custom_components.wyzesense.wyzesense_custom] Start Inquiry...
2019-11-09 21:24:00 DEBUG (SyncWorker_4) [custom_components.wyzesense.wyzesense_custom] ===> Sending: Packet: Cmd=4327, Payload=<None>
2019-11-09 21:24:00 DEBUG (SyncWorker_4) [custom_components.wyzesense.wyzesense_custom] Sending: b'aa55430327016c'
2019-11-09 21:24:26 WARNING (MainThread) [homeassistant.components.binary_sensor] Setup of platform wyzesense is taking over 10 seconds.
2019-11-09 21:24:28 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up platform wyzesense
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 150, in _async_setup_platform
await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
return fut.result()
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/wyzesense/binary_sensor.py", line 82, in setup_platform
ws = beginConn()
File "</usr/local/lib/python3.7/site-packages/decorator.py:decorator-gen-2>", line 2, in beginConn
File "/usr/local/lib/python3.7/site-packages/retry/api.py", line 74, in retry_decorator
logger)
File "/usr/local/lib/python3.7/site-packages/retry/api.py", line 33, in __retry_internal
return f()
File "/config/custom_components/wyzesense/binary_sensor.py", line 80, in beginConn
return Open(config[CONF_DEVICE], on_event)
File "/config/custom_components/wyzesense/wyzesense_custom.py", line 561, in Open
return Dongle(device, event_handler)
File "/config/custom_components/wyzesense/wyzesense_custom.py", line 297, in __init__
self._Start()
File "/config/custom_components/wyzesense/wyzesense_custom.py", line 492, in _Start
self._Inquiry()
File "/config/custom_components/wyzesense/wyzesense_custom.py", line 398, in _Inquiry
resp = self._DoSimpleCommand(Packet.Inquiry())
File "/config/custom_components/wyzesense/wyzesense_custom.py", line 393, in _DoSimpleCommand
self._DoCommand(pkt, cmd_handler, timeout)
File "/config/custom_components/wyzesense/wyzesense_custom.py", line 379, in _DoCommand
self._SendPacket(pkt)
File "/config/custom_components/wyzesense/wyzesense_custom.py", line 331, in _SendPacket
pkt.Send(self.__fd)
File "/config/custom_components/wyzesense/wyzesense_custom.py", line 106, in Send
ss = os.write(fd, pkt)
OSError: [Errno 22] Invalid argument
@gitaroomaan Can you give some more details on which Docker version you're running. Until the native Synology version is working, I think I'll need to use the rPi/MQTT configuration.
@mgriffin13 I'm running this: https://github.com/dariopb/ha-gosenseapp. It's been largely stable over the past couple of months running on a Raspberry Pi 3.
Same - anyone find an answer for synology?
Unfortunately without hidraw support by Synology DSM I don't think this will work. kernel.org seems to indicate that "[hidraw] differs from hiddev in that reports sent and received are not parsed by the HID parser, but are sent to and received from the device unmodified." It seems as if sending and receiving reports unmodified would not be possible if synology mounts it as hiddev.
The one possible alternative is to use https://github.com/dariopb/ha-gosenseapp as @gitaroomaan mentions above with a separate raspberry pi.
I have updated the README to indicate that it does not work with synology dsm.
A big motivating factor to moving to Synology was so that I didn't have to run a separate rPi. The other alternative would be to somehow update the library to also support hiddev connections, but I understand that's a ton of work.
would really like to see this happen too!
I gave up and bought another mini pc and moved my HA installation to the mini-pc. everything working great there. You can continue to use the Synology for your database and influxdb server, though.
I went with vm and all is working now
I'm holding out hope for a version with broader support! I'm running on synology over here.
i have this install running on a QNAP server and thought the component wasn't seeing my USB connection. would love for this to be supported.
Did anyone get this solved? Have just spent the last few hours trying to get this working. Synology NAS -> Docker -> Home Assistant. Wyse is mounted as hiddev0 not hidraw0 - Causes errors in the log when home assistant boots.