kukulich / home-assistant-jablotron100

Home Assistant custom component for JABLOTRON 100+ alarm system
MIT License
67 stars 24 forks source link

Timeout on JA-106K? #16

Closed andyboeh closed 3 years ago

andyboeh commented 3 years ago

I just installed HA for the Jablotron integration. Unfortunately, I can't get the plugin to work, this is what the log reports:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 236, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/config/custom_components/jablotron100/__init__.py", line 29, in async_setup_entry
    await jablotron.initialize()
  File "/config/custom_components/jablotron100/jablotron.py", line 294, in initialize
    self._detect_devices()
  File "/config/custom_components/jablotron100/jablotron.py", line 646, in _detect_devices
    devices_info_packets = reader.result(estimated_duration * 2)
  File "/usr/local/lib/python3.8/concurrent/futures/_base.py", line 441, in result
    raise TimeoutError()
concurrent.futures._base.TimeoutError

It's a fairly new JA-106K installation, LAN connected, no Cloud integration. I have about 20 devices on the bus, but the same timeout occurs if I enable only 3 devices. PG outputs disabled. Plugin version is 3.1.0 on a HA docker installation.

Any help is appreciated!

kukulich commented 3 years ago

@andyboeh it looks the given code does not have admin rights

andyboeh commented 3 years ago

Hm, it should have admin rights, I created the user specifically for this purpose. I'm using prefixes for the codes, could this cause a problem (7*xxxx)?

kukulich commented 3 years ago

@andyboeh Prefixes should work if you insert the code with the asterisk.

andyboeh commented 3 years ago

The hint with the code was correct and some Wireshark dumps later I found the problem: I had to prefix my prefix with a leading 0. I guess that the system expects the user codes with leading zeroes, since it supports up to 300 users. One zero is hardcoded in jablotron.py (the first '\x30'), the second is not.

kukulich commented 3 years ago

@andyboeh Can you please post the packet from wireshark? you can send me a private message on Discord.

andyboeh commented 3 years ago

Sorry, I didn't save the capture and I don't use Discord. However, the relevant data looked like this (code: 7*1234)

0x80 0x03 0x30 0x30 0x37 0x31 0x32 0x33 0x34

kukulich commented 3 years ago

Fixed in 3.1.1

andyboeh commented 3 years ago

I upgraded to 3.1.1 yesterday and can confirm that it works perfectly - thanks for the quick fix!