Supergiovane / node-red-contrib-sia-ultimate

Connect your SIA-DCS compatible alarm system to node-red. It works with Ajax System too.
MIT License
18 stars 4 forks source link

Problem with message date and time #10

Closed exer2024git closed 3 months ago

exer2024git commented 3 months ago

Hello, I apologize for the wording as it was done using a language translator. I am using the sia-dcs-ultimate node in Node-RED integrated with Home Assistant. I am receiving messages from the alarm panel correctly. However, the problem lies with the date and time. When enabling the interface on the alarm panel, it takes the time from the server, which does not match the current time, causing the scheduled automatic arm events in the panel to become disorganized. As I understand it, sending a "NAK" packet is meant to update the time on the interface. However, I have noticed that the "NAK" packet is never sent, only "ACK". Currently, in my region, it is 15:13 on 08/12/2024, which does not match "_04:45:01,08-30-2014".

I tried changing the commented part in the code, but it continuously sends "NAK" packets and disconnects.

/nodes/siaendpoint-config.js

if (diff > 20 || diff < -40) {

//if (node.acktimeout > 0 && diff > node.acktimeout) {

I appreciate your time and any guidance. Thank you very much. Exequiel.

Debug fragment:

12 Aug 15:03:15 - [info] siaendpointConfig: UDP received from 192.168.0.201 following message: ��0044"ADM-CID"1447R01L01#0001[#0001|1603 01 000][S13]_04:45:01,08-30-2014 12 Aug 15:03:15 - [info] siaendpointConfig: SIA Message : <0x0A><0xF6F3>0044"ADM-CID"1447R01L01#0001[#0001|1603 01 000][S13]_04:45:01,08-30-2014<0x0D> 12 Aug 15:03:15 - [info] siaendpointConfig: Created ACK : <0x0A><0xB606>0016"ACK"1447R01L01#0001[]<0x0D> 12 Aug 15:03:15 - [info] siaendpointConfig: sending ACK via UDP to 192.168.0.201 following message: �0016"ACK"1447R01L01#0001[]

Supergiovane commented 3 months ago

Hi NAK has nothing to do with that. It means “not aconowledged” and it’s sent whenever some checks on the datagram fails. The time difference is the issue here. As far as i can tell, you better add your own datetime to the output message and adapt the timezone of such datetime to the one on the server.

exer2024git commented 3 months ago

Thanks for the prompt response. Sorry for the confusion. Except for that problem, the node works perfectly.

Supergiovane commented 3 months ago

:)- you’re wellcome!!