MiguelRipoll23 / homebridge-securitysystem

Homebridge plugin that creates a security system accessory that can be triggered by HomeKit sensors.
https://www.npmjs.com/package/homebridge-securitysystem
MIT License
151 stars 13 forks source link

Difference CMD Alarm and Triggert? #70

Closed Nastras closed 4 years ago

Nastras commented 4 years ago

Hello @MiguelRipoll23,

I need your help. I want to set my alarm system so that when the alarm is triggered a CMD command (command_triggered) is sent to me via a script.

After 60 seconds the CMD command (command_alert) should be executed and the sirens should start.

But I can't get it set up like this. In my case both scripts for both commands are executed immediately after the sirens are triggered.

Would be cool if you can give me a hint? Thank you!

C4691346-CE6A-4210-8B12-F5471644E7B1

MiguelRipoll23 commented 4 years ago

Hello!

Looks like command_alert and command_triggered are executing at the same time, is that right?

I'm testing with a similar configuration but I can't reproduce this issue, can you run Homebridge in debug mode and show me the log? Execute homebridge -D.

It should like this once it's enabled: image

Sorry for the delay.

Nastras commented 4 years ago

Hello @MiguelRipoll23 , sorry also for my late reply. Unfortunately I did not get the chance to test it again earlier.

So I have found the error now. I'm not sure if it is my fault that I have misunderstood something or that it is mixed up in the plugin.

I changed the paths to the scripts between "command_alert": and "command_triggered".

If I now trigger the alarm system I first get a push then it waits 60 seconds and then the alarm is triggered.

I understood it as follows: "command_alert" is the command that triggers the real alarm and "command_triggered" is the pre-alarm. But it seems to be exactly twisted. Here again an excerpt from my current config to better understand it.

57DD8400-52F1-49BC-B2B9-A20AA6FF888F

Thank you!

MiguelRipoll23 commented 4 years ago

Actually command_alert is the warning and command_triggered is the event that should make the sirens sound ;)

Nastras commented 4 years ago

Ok so I got it wrong and the mistake was mine 😅 I couldn't read it directly from the plugin description so maybe you can make a more concrete hint.

Thanks and have a nice sunday!

MiguelRipoll23 commented 4 years ago

I'll do my best to improve the documentation and name the options better, I think server_warning and webhook_warning would have been a better name for the option maybe (as life gets busier I try keep the plugin maintained but my time to do things right reduces so the options' names can be confusing).