msp1974 / visonic_proxy

1 stars 0 forks source link

Message id tracker does not always have the right message id #12

Open msp1974 opened 1 month ago

msp1974 commented 1 month ago

Sometime the message tracker sends a message form the message builder with the wrong message id, resulting in the message being ignored by the panel and an ACK timeout.

2024-08-07 09:48:16,929 INFO     REC << Visonic 3 - 9768 VIS-ACK 0d 02 43 ba 0a
2024-08-07 09:48:16,929 INFO     Received awaited ACK for Alarm 3 from Visonic 3 for msg id 9768
2024-08-07 09:48:16,929 INFO     Visonic->Alarm 3 - 9768 VIS-ACK 0d 02 43 ba 0a
2024-08-07 09:48:16,929 INFO     Alarm->HASS 1 - 9768 VIS-BBA 0d b0 03 51 08 ff 08 ff 03 18 24 4b ad 43 6f 0a
2024-08-07 09:48:16,930 INFO     HASS->Alarm 3 - 9769 VIS-BBA 0d b0 01 17 07 01 ff 08 ff 01 39 01 43 a8 0a
2024-08-07 09:48:16,930 INFO     Waiting ACK: From Alarm 3 for HASS 1 for msg id 9769
2024-08-07 09:48:16,942 INFO     ------------------------------------------------------------
2024-08-07 09:48:16,942 INFO     REC << Alarm 3 - 9769 VIS-BBA 0d a5 00 04 00 21 0f 00 00 12 01 00 43 cf 0a
2024-08-07 09:48:17,046 INFO     ------------------------------------------------------------
2024-08-07 09:48:17,047 INFO     Message Builder Received - 0d 02 fd 0a
2024-08-07 09:48:17,047 INFO     Message Builder Returned: 0d 02 fd 0a
2024-08-07 09:48:17,047 INFO     REC << HASS 1 - 0000 VIS-ACK 0d 02 fd 0a
2024-08-07 09:48:20,250 INFO     -------------------------------------------------------------------------------------------
2024-08-07 09:48:20,250 INFO     CONNECTIONS: Alarm: 1, Visonic: 1, HA: 1
2024-08-07 09:48:20,250 INFO     MODES: Disconnected Mode: False, Stealth Mode: False
2024-08-07 09:48:20,250 INFO     Queue Size: Receive: 0, Send: 2
2024-08-07 09:48:20,250 INFO     -------------------------------------------------------------------------------------------
2024-08-07 09:48:21,930 INFO     ------------------------------------------------------------
2024-08-07 09:48:21,930 INFO     REC << Visonic 3 - 9769 VIS-BBA 0d b0 01 24 01 05 43 e0 0a
2024-08-07 09:48:21,930 WARNING  ACK Timeout: Waiting for ACK from Alarm for msg id 9769
2024-08-07 09:48:21,930 INFO     Alarm->Visonic 3 - 9769 VIS-BBA 0d a5 00 04 00 21 0f 00 00 12 01 00 43 cf 0a
2024-08-07 09:48:21,930 INFO     Waiting ACK: From Visonic 3 for Alarm 3 for msg id 9769
2024-08-07 09:48:21,963 INFO     ------------------------------------------------------------
2024-08-07 09:48:21,964 INFO     REC << Visonic 3 - 9769 VIS-ACK 0d 02 43 ba 0a
2024-08-07 09:48:21,964 INFO     Received awaited ACK for Alarm 3 from Visonic 3 for msg id 9769
2024-08-07 09:48:21,965 INFO     Visonic->Alarm 3 - 9769 VIS-ACK 0d 02 43 ba 0a
2024-08-07 09:48:21,965 INFO     Alarm->HASS 1 - 9769 VIS-BBA 0d a5 00 04 00 21 0f 00 00 12 01 00 43 cf 0a
2024-08-07 09:48:21,965 INFO     Waiting ACK: From HASS 1 for Alarm 3 for msg id 9769
2024-08-07 09:48:21,966 INFO     ------------------------------------------------------------
2024-08-07 09:48:21,966 INFO     Message Builder Received - 0d 02 fd 0a
2024-08-07 09:48:21,966 INFO     Message Builder Returned: 0d 02 fd 0a
2024-08-07 09:48:21,966 INFO     REC << HASS 1 - 0000 VIS-ACK 0d 02 fd 0a
2024-08-07 09:48:21,966 INFO     Received awaited ACK for Alarm 3 from HASS 1 for msg id 0
2024-08-07 09:48:21,967 INFO     Visonic->Alarm 3 - 9769 VIS-BBA 0d b0 01 24 01 05 43 e0 0a
2024-08-07 09:48:21,967 INFO     Waiting ACK: From Alarm 3 for Visonic 3 for msg id 9769
2024-08-07 09:48:21,975 INFO     ------------------------------------------------------------
2024-08-07 09:48:21,976 INFO     REC << Alarm 3 - 9770 VIS-BBA 0d a5 00 05 00 00 00 00 01 00 12 34 43 ca 0a
2024-08-07 09:48:26,588 INFO     ------------------------------------------------------------
2024-08-07 09:48:26,588 INFO     Message Builder Received - 0d a2 00 00 3f 00 00 00 00 00 00 00 43 da 0a
2024-08-07 09:48:26,589 INFO     Message Builder Returned: 0d a2 00 00 3f 00 00 00 00 00 00 00 43 da 0a
2024-08-07 09:48:26,589 INFO     REC << HASS 1 - 0000 VIS-BBA 0d a2 00 00 3f 00 00 00 00 00 00 00 43 da 0a
2024-08-07 09:48:26,967 WARNING  ACK Timeout: Waiting for ACK from Alarm for msg id 9769
2024-08-07 09:48:26,968 INFO     Alarm->Visonic 3 - 9770 VIS-BBA 0d a5 00 05 00 00 00 00 01 00 12 34 43 ca 0a
2024-08-07 09:48:26,968 INFO     Waiting ACK: From Visonic 3 for Alarm 3 for msg id 9770
2024-08-07 09:48:26,999 INFO     ------------------------------------------------------------
msp1974 commented 1 month ago

Think this is caused by an invalid message from the integration but how do we handle this better? How do we better deal with a message that gets no ACK from the alarm?

Also, maybe invalid ACKs from integration. It sends 0d 02 fd 0a which most of the time should be 0d 02 43 ba 0a.

Invalid message - this gets no ACK. Also not sure 39 is valid command as get no response when sending valid message with a 39.

2024-08-07 09:48:16,930 INFO     HASS->Alarm 3 - 9769 VIS-BBA 0d b0 01 17 07 01 ff 08 ff 01 39 01 43 a8 0a

Valid message

2024-08-07 10:04:59,798 INFO     Message Builder Received - b0 17 39
2024-08-07 10:04:59,798 INFO     Message Builder Returned: 0d b0 01 17 07 01 ff 08 ff 01 39 00 43 a9 0a
2024-08-07 10:04:59,799 INFO     REC << HASS 4 - 0000 VIS-BBA 0d b0 01 17 07 01 ff 08 ff 01 39 00 43 a9 0a
2024-08-07 10:04:59,799 INFO     HASS->Alarm 3 - 0614 VIS-BBA 0d b0 01 17 07 01 ff 08 ff 01 39 00 43 a9 0a
2024-08-07 10:04:59,799 INFO     Waiting ACK: From Alarm 3 for HASS 4 for msg id 614
2024-08-07 10:04:59,838 INFO     ------------------------------------------------------------
2024-08-07 10:04:59,838 INFO     REC << Alarm 3 - 0614 VIS-ACK 0d 02 43 ba 0a
2024-08-07 10:04:59,838 INFO     Received awaited ACK for HASS 4 from Alarm 3 for msg id 614
2024-08-07 10:04:59,839 INFO     Alarm->HASS 4 - 0614 VIS-ACK 0d 02 43 ba 0a
2024-08-07 10:05:00,355 INFO     ------------------------------------------------------------