node-alarm-dot-com / homebridge-node-alarm-dot-com

Alarm.com plugin for Homebridge using Node.js
MIT License
58 stars 23 forks source link

Error: failed to change partition state #42

Closed mikeb3408 closed 4 years ago

mikeb3408 commented 4 years ago

I am getting this error every once in a while in my homebridge log. The system appears to be working normally I am just wondering what this error means and what it could cause.

One thing I have noticed is the alarm.com system arming switch in Homekit often says "no response" although it still works.

Error: Failed to change partition state: Error: POST https://www.alarm.com/web/api/devices/partitions/99174195-127/armStay failed: request to https://www.alarm.com/web/api/devices/partitions/99174195-127/armStay failed, reason: socket hang up at /usr/local/lib/node_modules/homebridge-node-alarm-dot-com/node_modules/node-alarm-dot-com/index.js:491:13 at runMicrotasks () at processTicksAndRejections (internal/process/task_queues.js:97:5)

mkormendy commented 4 years ago

Seems like their server isn't or can't handle the request at those times. Is it consistent?

mikeb3408 commented 4 years ago

Hello,

It seems to just be happening when I arm the system it did not give that error when the system was unarmed this morning, however, everything works as it should I am just noticing that in the logs.

mkormendy commented 4 years ago

I suggest turning down the logging if you're seeing that in your logs a lot.

The socket hang up is an issue of a timeout on the nodeJS side waiting for a response from the Alarm.com servers .. or nodeJS closes the connection too soon, which there's plenty of time built in the homebridge process to wait for the response which should happen in a timely fashion.