eavanvalkenburg / sia

SIA alarm systems integration into Home Assistant
MIT License
48 stars 11 forks source link

Leaksprotect sensor #14

Closed Mokson closed 4 years ago

Mokson commented 4 years ago

Getting an error message for a leak sensor.

Log Details (ERROR) Logger: custom_components.sia Source: custom_components/sia/init.py:437 Integration: Sia First occurred: 2:12:11 PM (1 occurrences) Last logged: 2:12:11 PM

Hub: Process Event: CRC: 6702, Calc CRC: 6702, Full Message: "SIA-DCS"0174L0#FF8B[#FF8B|Nri1/WA1]_14:12:10,05-01-2020, Message type: SIA-DCS, Sequence: 0174, Receiver: , Prefix: L0, Account: FF8B, Encrypted Content: , Content: #FF8B|Nri1/WA1]_14:12:10,05-01-2020, Zone: 1, Code: WA, Message: 1, Timestamp: 14:12:10,05-01-2020, Code: WA, Type: Water Alarm, Description: Water detected at protected premises, Concerns: Zone or point gave error can only concatenate str (not "bool") to str

eavanvalkenburg commented 4 years ago

hi, good one, this is just a logging line, but will indeed cause an error.

Mokson commented 4 years ago

thanks @eavanvalkenburg the state of these sensors won't change in the HA. It always shows 'dry'

eavanvalkenburg commented 4 years ago

Yeah the error throws before the value is changed, what you can do is comment out/delete line 323-328 in init.py, because I don't know when I'll get around to fixing this version, since I'm creating a official component for HA for SIA, but might be a while before that is merged.

cdufour1107 commented 4 years ago

For information same problem for me.

Thx for the component !

eavanvalkenburg commented 4 years ago

For information same problem for me.

Thx for the component !

which version is that on?

cdufour1107 commented 4 years ago

v0.2.4, I install the component today with HACS interface.

My Ajax application is in french, may be the source of bug.

eavanvalkenburg commented 4 years ago

Can you try installing the preview of the new official integration, in HACS go to the integration, then re-install and then select v0.3.2b?

cdufour1107 commented 4 years ago

I installed the v0.3.2b but I cannot connect to Ajax Hub, with same config on configuration.yaml. Basic conf:

sia: port: 8000 hubs:

On Ajax Mobile App the "monitoring center" is disconnect.

Mokson commented 4 years ago

I've also installed 0.32b))

Here's log 2020-06-26 18:43:31 ERROR (MainThread) [homeassistant.setup] Setup failed for sia: unknown error Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/pkg_resources/init.py", line 3028, in _dep_map return self.dep_map File "/usr/local/lib/python3.7/site-packages/pkg_resources/init.py", line 2822, in getattr__ raise AttributeError(attr) AttributeError: _DistInfoDistribution__dep_map

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/pkg_resources/init.py", line 3019, in _parsed_pkg_info return self._pkg_info File "/usr/local/lib/python3.7/site-packages/pkg_resources/init.py", line 2822, in getattr raise AttributeError(attr) AttributeError: _pkg_info

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/setup.py", line 142, in _async_setup_component component = integration.get_component() File "/usr/src/homeassistant/homeassistant/loader.py", line 264, in get_component cache[self.domain] = importlib.import_module(self.pkg_path) File "/usr/local/lib/python3.7/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1006, in _gcd_import File "", line 983, in _find_and_load File "", line 967, in _find_and_load_unlocked File "", line 677, in _load_unlocked File "", line 728, in exec_module File "", line 219, in _call_with_frames_removed File "/config/custom_components/sia/init.py", line 6, in from pysiaalarm.aio import SIAAccount, SIAClient, SIAEvent File "/usr/local/lib/python3.7/site-packages/pysiaalarm/init.py", line 11, in version = get_distribution(dist_name).version File "/usr/local/lib/python3.7/site-packages/pkg_resources/init.py", line 482, in get_distribution dist = get_provider(dist) File "/usr/local/lib/python3.7/site-packages/pkg_resources/init.py", line 358, in get_provider return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0] File "/usr/local/lib/python3.7/site-packages/pkg_resources/init.py", line 901, in require needed = self.resolve(parse_requirements(requirements)) File "/usr/local/lib/python3.7/site-packages/pkg_resources/init.py", line 795, in resolve new_requirements = dist.requires(req.extras)[::-1] File "/usr/local/lib/python3.7/site-packages/pkg_resources/init.py", line 2743, in requires dm = self._dep_map File "/usr/local/lib/python3.7/site-packages/pkg_resources/init.py", line 3030, in _dep_map self.dep_map = self._compute_dependencies() File "/usr/local/lib/python3.7/site-packages/pkg_resources/init.py", line 3039, in _compute_dependencies for req in self._parsed_pkg_info.get_all('Requires-Dist') or []: File "/usr/local/lib/python3.7/site-packages/pkg_resources/init.py", line 3021, in _parsed_pkg_info metadata = self.get_metadata(self.PKG_INFO) File "/usr/local/lib/python3.7/site-packages/pkg_resources/init.py", line 1422, in get_metadata value = self._get(path) File "/usr/local/lib/python3.7/site-packages/pkg_resources/init__.py", line 1618, in _get with open(path, 'rb') as stream: FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.7/site-packages/pycryptodome-3.9.7.dist-info/METADATA'

cdufour1107 commented 4 years ago

OK config flow config only ... 2 min I make conf.

cdufour1107 commented 4 years ago

I config with flow and the entity was add without error. Integration is very simple, it's perfect for me.

But my problem of returning to the initial state persists, if I put a flood sensor in the water the status changes to "Wet" in the Ajax application and in Home Assistant. By cons if I take it out of the water it returns to a "Dry" status in the Ajax application but it remains in "Wet" status in Home Assistant.

eavanvalkenburg commented 4 years ago

Could you create some logs for that?

Enable this in your configuration.yaml https://www.home-assistant.io/integrations/logger/ with custom_components.sia: debug

as one of the rows, and then in your Logs (now in Configuration under Logs) you should be able to see something going on

Mokson commented 4 years ago

Hi @eavanvalkenburg ,

Do you know if this warning message is critical? 2020-07-09 14:25:27 WARNING (MainThread) [pysiaalarm.base_sia_server] CRC mismatch, ignoring message.

Mokson commented 4 years ago

Looks like I had to reconfigure using the Integrations wizard AND the encryption field should not be empty. Now I'm getting this message

2020-07-09 14:44:28 WARNING (MainThread) [pysiaalarm.base_sia_server] Event timestamp is no longer valid: 2020-07-09 11:38:59

Mokson commented 4 years ago

The issue is fixed. Thanks a lot for your work!

eavanvalkenburg commented 4 years ago

ok, great that it is fixed, thanks for checking, the CRC mismatch is def not good, but the encryption field should be allowed to stay empty, I will check that one!

Mokson commented 4 years ago

Just noticed that status of a moisture entry won't change from wet back to dry. Don't you know what might be the issue?