CyrilP / hass-deltadore-tydom-component

Delta Dore Tydom Home Assistant custom component
MIT License
12 stars 3 forks source link

Tyxal alarm CSX40 #58

Closed Misxs closed 7 months ago

Misxs commented 8 months ago

System Health details

CSX alarm is not working and not show in the log. Log report feature not availalbe

Checklist

Describe the issue

I have a CSX40 alarm system and it is not report by this addon. I get an error message : Logger: custom_components.deltadore_tydom Source: custom_components/deltadore_tydom/hub.py:237 Integration: Delta Dore TYDOM (documentation, issues) First occurred: 1 mars 2024 à 14:33:39 (2 occurrences) Last logged: 12:21:40

Alarm Not implemented yet.

Reproduction steps

1. 2. 3. ...

Debug logs

Logger: custom_components.deltadore_tydom
Source: custom_components/deltadore_tydom/hub.py:237
Integration: Delta Dore TYDOM (documentation, issues)
First occurred: 1 mars 2024 à 14:33:39 (2 occurrences)
Last logged: 12:21:40

Alarm Not implemented yet.

Diagnostics dump

No response

CyrilP commented 8 months ago

Can you please provide integration logs in debug :

I'll try my best to implement something from that logs with your help as I don't have an alarm.

Misxs commented 8 months ago

thanks a lot for your help. here is the log file.

home-assistant_deltadore_tydom_2024-03-05T23-56-19.833Z.log hope it will help.

CyrilP commented 8 months ago

Thanks, I'll have a look.

CyrilP commented 8 months ago

I've just created a pre-release called v0.6-dev If you use HACS, you can install it if you activate beta releases. I added new configuration parameters to configure active zones for "away" and "home" modes. There is now a "configuration" button on the integration to update them. you just have to separate them with ",", for example : 1,3,4 I'll probably add a check : if all zones are unused, I'll only enable "away" and "disabled" modes - if at least 1 zone is enabled, i'll also add "home" mode.

Can you test this version and tell me if there are problems please ? Do you also have cameras in your system ?

CyrilP commented 8 months ago

@Misxs new pre-release called v0.6-dev4 because there was an error while sending commands for alarms

Misxs commented 8 months ago

I will try this today and let you know the result. Thanks

CyrilP commented 8 months ago

Thanks. There is probably an issue with the state on the alarme panel which stays at "disarmed". Someone has this issue with a tixal+ alarm

Misxs commented 8 months ago

I try your new beta version. But as you say, I cannot change the alarm from disarmed to armed. this is the extract of the log 2024-03-15 14:23:28.832 INFO (MainThread) [custom_components.deltadore_tydom] Incomming message - type : 2 - message : b'HTTP/1.1 200 OK\r\nServer: Tydom-001A2504DFED\r\nUri-Origin: /devices/1612289388/endpoints/1612289388/cdata\r\nContent-Type: application/json\r\nContent-Length: 0\r\nTransac-Id: 0\r\n\r\n'

CyrilP commented 8 months ago

I'll have a look next week

CyrilP commented 8 months ago

Can I have the full log with alarm state change please ?

CyrilP commented 8 months ago

I fixed an issue with a tyxal+ alarm log. can you check the new release v0.6-dev5 ?

Misxs commented 8 months ago

Hey I try and now I have the following error Cette erreur provient d'une intégration personnalisée

Enregistreur: custom_components.deltadore_tydom Source: custom_components/deltadore_tydom/config_flow.py:160 intégration: Delta Dore TYDOM (documentation, problèmes) S'est produit pour la première fois: 19:00:06 (1 occurrences) Dernier enregistrement: 19:00:06

Communication error Traceback (most recent call last): File "/config/custom_components/deltadore_tydom/tydom/tydom_client.py", line 253, in async_connect connection = await session.ws_connect( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 832, in _ws_connect resp = await self.request( ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 578, in _request conn = await self._connector.connect( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 544, in connect proto = await self._create_connection(req, traces, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 911, in _createconnection , proto = await self._create_direct_connection(req, traces, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 1204, in _create_direct_connection transp, proto = await self._wrap_create_connection( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 992, in _wrap_create_connection return await self._loop.create_connection(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1147, in create_connection transport, protocol = await self._create_connection_transport( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1180, in _create_connection_transport await waiter asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/config/custom_components/deltadore_tydom/tydom/tydom_client.py", line 221, in async_connect async with async_timeout.timeout(10): File "/usr/local/lib/python3.12/site-packages/async_timeout/init.py", line 141, in aexit self._do_exit(exc_type) File "/usr/local/lib/python3.12/site-packages/async_timeout/init.py", line 228, in _do_exit raise asyncio.TimeoutError TimeoutError

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/config/custom_components/deltadore_tydom/config_flow.py", line 160, in async_step_user await tydom_hub.test_credentials() File "/config/custom_components/deltadore_tydom/hub.py", line 122, in test_credentials connection = await self._tydom_client.async_connect() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/deltadore_tydom/tydom/tydom_client.py", line 266, in async_connect raise TydomClientApiClientCommunicationError( custom_components.deltadore_tydom.tydom.tydom_client.TydomClientApiClientCommunicationError: Timeout error fetching information

Misxs commented 8 months ago

Hey Cyril

I am moving. Now the alarm is working find exept the fact that I cannot disarmed the alarm. Could you tell me the part of the log that you need to check the issue ? Armed is working find Disarmed is not doing any think Thanks Xavier

CyrilP commented 8 months ago

Enable debug logs on the tydom extension before arming/disarming. Arm then disarm the alarm Disable debug on the extension. it shoud download the needed log file

Misxs commented 8 months ago

please find the log file I only armed and disarmed the [alarm] home-assistant_deltadore_tydom_trace_log.log

CyrilP commented 8 months ago

strange, I don't see the outgoing messages to the tydom gateway in the logs... is it complete ?

Misxs commented 8 months ago

i think so . I will retry and send you a new log file

Misxs commented 8 months ago

Here is the log file.

Misxs commented 8 months ago

I am doing some test. Armed the alarm whith zone is forcing the alarm to "away" whatever i choice . "HOME" or "AWAY" after changing the message in tydom_devices

await self._tydom_client.put_alarm_cdata(self._id, self._endpoint, code, "OFF", None, self.is_legacy_alarm())

    await self._tydom_client.put_alarm_cdata(self._id, self._endpoint, code, "OFF", self._tydom_client._zone_home, self.is_legacy_alarm())

the disarmed is working.

CyrilP commented 8 months ago

The mode is deduced from the alarmMode and alarmState parameters (see def state(self) in ha_entities). I expect the alarmMode to be "PART" when in HOME mode. Can you check theses parameters values ?

Misxs commented 7 months ago

I check the parameter. In fact for my CSX40 alarm the code for the zone must be "part":"1" instead of "part":"[1]". if you put in your code "part":"[1]" it will be considere has "Alway" mode. if you put "part":"1" it will considere that your arm the zone 1. with this change, it is working. I change the code to

Also in my case the pin_id of the alarm is not check by Tydom, whatever i enter it force the alarm. Strange no ? So I would be interrested to know if it is a api to check the alarm code. Many thanks

CyrilP commented 7 months ago

you're right for the part command, it was a bad copy/paste, sorry. If you entered an alarm pin in the config, it is used to change the alarm mode. otherwise, you must enter it to change the mode and a wrong pin doesn't change the mode but an error is retured by the tydom gateway byt not handled yet. I don't know if it's possible to make it reach the HA GUI.

CyrilP commented 7 months ago

I've just created a new beta v0.6-dev8 with the fix