Giter Site home page Giter Site logo

miguelripoll23 / homebridge-securitysystem Goto Github PK

View Code? Open in Web Editor NEW
153.0 8.0 13.0 4.89 MB

Homebridge plugin that creates a security system accessory that can be triggered by HomeKit sensors.

Home Page: https://www.npmjs.com/package/homebridge-securitysystem

License: MIT License

JavaScript 100.00%
homebridge-plugin homekit homebridge alarm security

homebridge-securitysystem's Introduction

homebridge-securitysystem

npm version npm downloads verified-by-homebridge

Homebridge plugin that creates a security system accessory that can be triggered by HomeKit sensors.

❤️ One-time donation

Installation

If you already have Homebridge installed, execute the following command:

npm i -g --unsafe-perm homebridge-securitysystem

Demo

Want to know how it looks like? It's pretty customizable, you can configure it to show as many switches as you like.

What you are seeing at your right is the friendliest configuration that you can start with. Each Trip switch that you see can only trip the security system if the mode is currently set. This allows you to create logic-less automations from the very Home app that comes already installed on iOS.

There are also Mode switches which let you run automations that interact with your accessories when a mode is changed or set modes bypassing HomeKit confirmation dialogs.

A web server, webhooks or even shell commands are available to integrate the security system with other devices or services plus a plenty of more settings to make this plugin your own DIY security system.

Homebridge / HOOBS UI is recommended to configure the plugin, for additional help please check the Wiki page.

Automations

Using the Home app is recommended for regular users, for more advanced users the Eve or a similar app will let you make use of the custom options that the security system itself exposes.

Here are some examples of automations that can be created:

Trigger Actions
Motion is Detected Turn on Trip Night
Door is Opened Turn on Trip Away
NFC Tag is Detected (1) Set Security system to Home
Security System Triggers Play Audio (2)

(1) Shortcuts app is required to create this automation.

(2) AirPlay 2 speaker and Apple Music subscription are required.

Contributions

Pull requests are welcome.

homebridge-securitysystem's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar funkyremi avatar github-actions[bot] avatar greenkeeper[bot] avatar macjl avatar miguelripoll23 avatar reevak05 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

homebridge-securitysystem's Issues

Installation issues (Audio modules)

Hi, first of all thanks for the great plugin, good work!

Unfortunately, I encountered some problems with the installation. Maybe a few additional installation hints would be helpful. Without these steps I was not able to install the plugin successfully.

  1. audio must be installed ( sudo apt-get install libasound2-dev )
  2. speaker is required ( sudo npm install -g --unsafe-perm speaker )
  3. if you running Homebridge with a separate user like "homebridge", this user needs access to audio ( sudo usermod -aG audio homebridge )
  4. in my system case I had to install the plugin also with unsafe parameter ( sudo npm install -g --unsafe-perm homebridge-securitysystem )

No Response from Siren switch when Security System is disarmed.

When the security system is Off and you hit the Siren Switch, I keep getting a "No Response" from the switch until I Arm the system. Maybe that's because the switch is just there for the purpose of the Armed states triggering automatons, but it's really nice to have a manual toggle even when the Security System is off.

"current mode: Off" command is getting executed every time

Describe the bug
If my current mode is Off and I use Shortcuts to set mode to Off the command associated to "current mode off" gets executed regardless.

To Reproduce
It is best to set a Shortcut to control the security system to off in order to reproduce this issue

Expected behavior
The command shouldn't be executed if my current mode is already Off.

Plugin's configuration
{
"name": "Security system",
"default_mode": "Off",
"arm_seconds": 0,
"show_mode_pause_switch": false,
"pause_minutes": 0,
"siren_sensor": false,
"siren_sensor_seconds": 5,
"trigger_seconds": 0,
"reset_minutes": 1,
"siren_switch": true,
"siren_mode_switches": false,
"override_off": false,
"unsafe_mode_switches": false,
"hide_mode_off_switch": false,
"audio": true,
"audio_language": "en-US",
"audio_alert_looped": false,
"save_state": true,
"webhook_url": "http://api.callmebot.com",
"webhook_alert": "/start.php?source=web&user=",
"command_current_home": "sleep 5;pgrep -x 'ffplay'>& /dev/null; if [ $? -eq 0 ]; then pkill ffplay;fi",
"command_current_away": "sleep 5;pgrep -x 'ffplay'>& /dev/null; if [ $? -eq 0 ]; then pkill ffplay;fi",
"command_current_night": "/usr/local/Cellar/switchaudio-osx/1.0.0/SwitchAudioSource -s "Built-in Output";sleep 5;pgrep -x 'ffplay'>& /dev/null; if [ $? -eq 0 ]; then pkill ffplay;fi",
"command_off": "/usr/local/Cellar/switchaudio-osx/1.0.0/SwitchAudioSource -s "HDMI";sleep 5;pgrep -x 'ffplay'>& /dev/null; if [ $? -eq 0 ]; then pkill ffplay;fi",
"accessory": "security-system"
}

Aqara Hub

Sorry, this isn’t strictly an issue, but just putting it out there.

I used to use the aqara security system, but I moved my sensors from the hub to local server on which uses Homebridge via a raspbee. Regrettably I have lost the security function and the hub functions as a nightlight.

Is there a way that anyone has found to appropriate the siren on the hub for use with your security center plugin.

I will buy a HEIMAN siren in time. What other options are there for an audible / visual warning?

Plugin Configuration missing when using HOOBS Homebridge

Hi @MiguelRipoll23 I wanted to start by saying how I am so grateful of this plugin, its exactly what I need, so thank you for developing it :)

I use HOOBS 3.1.22 and 2.0.2 of your plugin and when I install plugins I am usually met with a way to config them, at the bare minimum its a box to add the traditional config.json information to mine, or if you are HOOBS certified plugin then its presented out really nicely so its simple for users to config the plugin. On your plugin, nothing is presented. It shows the plugin listed, but when I go to Configuration its nothing but a description :( (see harmony hub as an example of what it should look like as a basic minimum)

I have manually added the config to HOOBS advanced section (which effectively is my config.json) and its working so no issue there (despite the arm timer is 30sec and trigger is 20sec, however when the plugin starts both seem to be 30sec...)
In order for me to raise this with HOOBS I needed to have asked you about it, as it might be something on your end? I do not know.

But if you can shed any light on this that would be greatly appreciated.

Thanks again
Screenshot 2020-03-20 at 16 56 24
Screenshot 2020-03-20 at 16 56 38
Screenshot 2020-03-20 at 16 57 30
Screenshot 2020-03-20 at 17 12 19

Update *** HOOBS replied saying that the plugin developer needs to use the config.schema standard.
Any chance you can add the 2 files needed to have your plugin supported :)
https://github.com/hoobs-org/HOOBS/wiki/6.5-Developing-Plugins#hoobs-certification

I think its just a layout so that whenever someone using HOOBS to use your plugin it is super easy to install and configure :)

Issue with notifications

After the latest update, the security system keeps refreshing and saying it was "Home Armed". I have not been arming it myself.
IMG_B8D6C25663D3-1

Only for understanding

Hi Miguel,
so only for understanding. Can you give me a example of how maybe to use the "sensor" while trigger?
So that I can understand better for what I could use this feature.

Call cmd command or script via Webhooks

Hello @MiguelRipoll23

is it possible to call a cmd command or script via the Webhooks function?

I have tried it but nothing happens when it is triggered, I don't get anything displayed in the journalctl above the Webhooks status. I only see that the status of the alarm system has changed.

Here is my config.json:

"plugins": [
"homebridge-securitysystem"
],

"accessories": [
{
"accessory": "Security system",
"name": "Alarmanlage Zuhause",
"default_mode": "off",
"siren_switch": true,
"override_off": true,
"save_state": true,
"server_port": xxxxx,
"server_code": xxxxx,
"webhook_off": "/bin/bash /var/homebridge-securitysystem/befehle/SirenenZuhauseON.sh",
"webhook_triggered": "/bin/bash /var/homebridge-securitysystem/befehle/SirenenZuhauseOFF.sh"
}
]
}

I guess it doesn't work without going on the internet so my question, it be possible that you add a cmd function similar to the Webhooks?

Thanks for your help!

Greeting nastras

Feature idea : arm delay by web server enabled or disabled by parameter in URL

Hello,

I've switched all my security automation system to your plugin. All working nice! Thank you, it's a very cool plugin, and really appreciate how you pay attention to user's requests.

As I discovered the plug-in, I found this optional parameter :
server_arm_delay : Allows to enable or disable the arming delay.

Instead of using a fixed parameter, couldn't it be a parameter passed in URL?

For example :
http://localhost:1234/away?delay=true
Will arm the system with the "arm_seconds" delay

And :
http://localhost:1234/away?delay=false
Will arm the system immediately

Moreover, as for issue #23, is that possible to add a webhook and a command that activate at the beginning of arming, before the arm_delay ends?

And a last thing : I think you should add the defaults values for each options in the README.md file. I'm going to the code to see them, but not sure everyone will do it.

Arm seconds ignored

Hi,

I only realized it today but since one of the latest updates the “arm_seconds” parameter seems to completely get ignored. I have set it to 30 seconds but whenever I change the alarm status it skips the arming phase completely and switches modes directly. I already removed the accessory and added it again but nothing changed. Any idea why this might be happening?

{ "name": "Security system", "default_mode": "Off", "arm_seconds": 30, "show_mode_pause_switch": false, "pause_minutes": 0, "siren_sensor": false, "siren_sensor_seconds": 5, "trigger_seconds": 0, "reset_minutes": 3, "siren_switch": true, "siren_mode_switches": false, "override_off": false, "unsafe_mode_switches": false, "hide_mode_off_switch": false, "audio": false, "audio_volume": "100", "audio_language": "en-US", "audio_alert_looped": false, "save_state": true, "accessory": "security-system" }

Alarm Sounds Question

Hello Miguel,

i dont understand how i can use a arming sound. In the GUI i set the path for the audio file and installed ffmpeg.
But the sound dont come up when i arming the security system :/

update:
Ah now it shows me up, but i dont hear anything:
14.8.2020, 19:30:33 [Security System] Target mode (Off)
14.8.2020, 19:30:33 [Security System] Current mode (Off)
14.8.2020, 19:30:33 [Security System] /home/hoobs/.hoobs/node_modules/homebridge-securitysystem/sounds/en-US/en-US/current-off.mp3

can you explain me, how i connect my homepods over airplay with my raspberry?

thanks for your help

Siren switch optional

Could the siren switch be made optional? I don't see the use for it since a triggered alarm can be used as a trigger to run a scene or control specific (physical) accessories.

Option to change name of "Siren" switch

First of all I'd like to thank you for this great plugin.
I was wondering if you could add the option to change the name of the "Siren" switch. I know it's a minor issue, but I really would like to give it a different name.

¡Muchas gracias!

Edit: So sorry about this. I woke up early today and forgot that I could change the name in the Home App. Please close this issue.

Feature request: Dedicated Siren switch for each mode

Hello,

I love your plug-in to make a powerfull security system.

Would it be possible to add an option to have multiples Siren Switchs, one for each state : home, away, night?

The security system would be triggered only when the switch which match the current state would be on. This would be easier to create automation. In your example, you would not need condition :

Trigger Condition Scene actions
Motion is detected None Turn on Siren Night
Door is opened None Turn on Siren Away
NFC tag is detected (1) (2) None Set security system to Home
Security system triggers None Play media (1)

saved state isn't working for Home state

Describe the bug
I have save state configured. But when I restart homebridge the state goes back to Off.

To Reproduce
Steps to reproduce the behavior:

  1. Configure save_state to yes
  2. Restart Homebridge
  3. Set system to Home
  4. Restart Homebridge
  5. System is back to Off

Expected behavior
State should be preserved across restarts.

Plugin's configuration
{
"name": "Security system",
"default_mode": "Off",
"arm_seconds": 0,
"show_mode_pause_switch": false,
"pause_minutes": 0,
"siren_sensor": false,
"siren_sensor_seconds": 5,
"trigger_seconds": 0,
"reset_minutes": 1,
"siren_switch": true,
"siren_mode_switches": false,
"override_off": false,
"unsafe_mode_switches": false,
"hide_mode_off_switch": false,
"audio": true,
"audio_language": "en-US",
"audio_alert_looped": false,
"save_state": true,
"webhook_url": "http://api.callmebot.com",
"webhook_alert": "/start.php?source=web&user=",
"command_current_home": "sleep 5;pgrep -x 'ffplay'>& /dev/null; if [ $? -eq 0 ]; then pkill ffplay;fi",
"command_current_away": "sleep 5;pgrep -x 'ffplay'>& /dev/null; if [ $? -eq 0 ]; then pkill ffplay;fi",
"command_current_night": "/usr/local/Cellar/switchaudio-osx/1.0.0/SwitchAudioSource -s "Built-in Output";sleep 5;pgrep -x 'ffplay'>& /dev/null; if [ $? -eq 0 ]; then pkill ffplay;fi",
"command_off": "/usr/local/Cellar/switchaudio-osx/1.0.0/SwitchAudioSource -s "HDMI";sleep 5;pgrep -x 'ffplay'>& /dev/null; if [ $? -eq 0 ]; then pkill ffplay;fi",
"accessory": "security-system"
}

Feature request : new webhook and command

Hello,

Could you add a 'command' and a 'webhook' that activate just when the sensor is triggered, without waiting the 'trigger_seconds' delay ends? The actual 'command_triggered' and 'webhook_triggered' are waiting for this delay to launch.

In my home, I will use it to play a smooth sound that will inform that the alarm have been triggered, and the person who entered have some seconds to deactivate it before real big siren sound!

Default security mode

Everytime I restart the homebridge, this plugin set the security mode to "off".
However, I want change the default mode to "at home".
Any solution for this?

Add switch to temporarily set the mode to disarmed

First, I am a hoobs user and 2.7.0 it runs quite good right now.

My wish, I do not know if that is quite in the beta right now, but some kind of toggle mode.
e.g. If Night mode is enabled and my door is locked, i need a way to push/set a button to toggle the security system to e.g. "home" for some time (set seconds like the trigger does) and after that time back to Night mode. So I have time to get out and it will be secured after that again.

Change Request: Stateful Mode and Siren Name in iOS 13

Hello, I would like to use your plugin in the future. But first thank you very much for your work.
I tested it today and I noticed two things where I want to ask you if you can still adapt it?

  1. After rebooting the Homebridge the switch of the alarm system will be reset to default mode. Can you add a stateful option in config.json to save the state of the switch?

  2. The switch Siren has no name in the home app in iOS 13. I am currently using another switch that I want to replace with yours because the name of additional switches is displayed.

Your Plugin:
IMG_1600

Other Plugin:
IMG_1601

I would be very happy if you take a look at it.

Many greetings
Nastras

audio warnings via sonos

Hey Miguel, glad to see how this project moved forward since I opened the very first issues :) ...if you remember ;)

Unfortunately I don't have a HomePod or Airplay 2 device to use the new audio feature, but Sonos speakers in every room. Maybe you could also implement audio output on Sonos as an alternative. I am currently using this API (https://github.com/jishi/node-sonos-http-api) with OpenHAB for various notifications. You can trigger an audio file (or dynamic TTS) on all speakers at the same time with a simple HTTP invoke. Works great for years now.

This would be great and quite easy to implement I guess.

Security system jumps to "no response"

When "arm_seconds" is set to a longer duration e.g. 30 seconds the security system accessory shows "no response" on my devices (iOS 13.1.2 & iOS 13.2 beta) with the home app being open. Not sure, but is it maybe that the app is requesting an update but can't get it because the plug in is still in the "getting armed" loop?

Add ability to update state with webhook

Hey, Awesome plugin, thanks for your work :-)
I would like to be able to change the displayed state of the security system in homekit when it changes from another source.
Is there any solution to expose a server with some endpoints triggered by an external service to change the state?
Example: I have a hardware button to enable/disable the alarm but the state is not reported to homekit. The only action available is a webhook triggered by an online service when it detect a state change on my alarm.
It would be a nice feature!

ffplay stays running in the background after the first audio plays.

Describe the bug
After an audio plays with ffplay, the process stays running in the background. This causes the screensaver on my computer to never activate. (I am using macOS)

Expected behavior
ffplay should be run with -autoexit flag in order for the process to exit after playing the sound.

updateCurrentState - add URL request option

Hi,
it would be great if you can expand a "updateCurrentState" method with ability to call URL on state change.
I've an alarm system, which I can trigger with URL link. What I want to do is to call "alarm on" URL when alarm is triggered and "alarm off" URL when alarm is disabled.
For URL request you could use something like:

var url = require('url');
...
    this.alarmOnUrl = url.parse(config['alarmOnUrl']);
...
 request({
           url: me.alarmOnUrl,
           method: 'GET',
       }, 
       function (error, response, body) {
       if (error) {
           // me.log('STATUS: ' + response.statusCode);
           // me.log(error.message);
           return callback(error);
       }

There should be option to define(optional) URL for every state (armed, triggered, ...).

logic for elgato eve siren

I need help configuring the alarm logic in the Eve app. I have a 240V siren connected via Eve Energy plug. How do i use the security system siren switch properly? How can I logically combine these two switches?

Different commands/webhooks on alert depending on the mode

I understand "Siren Mode Switches" is a handy way to trigger an alarm only when the system is on that specific state. I actually have no need for that because I am using native Homekit support for setting a condition in which I first evaluate the current security system state before executing the action.
However, it would be really useful if the "Siren Mode Switches" also had different webhook or commands associated to them instead of always executing the same alert as the global Siren switch.

That way I could have different alert behaviors depending on the mode.

HTTP POST requests

Hello

I have a device which can start making sounds if it receives an JSON-encoded http POST request with the appropriate command.

As far as I can tell your plugin only makes GET requests, therefore I would like to suggest adding the possibility of making POST calls.

If there is anything I can do to help achieve this please do tell.

Alarm audio playback to a Bluetooth speaker from Raspberry Pi Zero W

Hi,

Firstly the plugin is awesome I have managed to integrate a number of sensors and Webhooks into the capability however I am looking to getting the alarm to play audio to a connected bluetooth speaker on the Pi.

I have managed to test and verify a bluetooth speaker with the pi and configured the connection with bluetoothctl and succeed in getting audio to playback using bluealsa. The Pi will auto reconnect to the bluetooth speaker when it boots.

I have set the location of the audio file in the config and installed but I am unsure what command is being used to initiate the playback. In order to push via bluetooth and not default to HDMI (which I think its doing) you need to insert arguments into the playback instruction:

aplay -D bluealsa /home/pi/alarm.wav

Would there be any way to have this feature added? Or if it is a function that is currently built in could you point me in the right direction to resolve?

Feedback wanted

Hello, everyone!

I'd like to hear some feedback from you about the usage of this plugin and your daily inconveniences or struggles that you may be experiencing when using it.

I'd appreciate so much if some of you did this quick survey to improve any area that hasn't been mentioned yet.

The journey

During last months and even weeks, lot of things have happened! These are some highlights of the new features that have arrived to this plugin:

Settings UI: it's easier than ever to change the plugin's settings using either Homebridge or HOOBS with the organized sections that were added.

Audio: this was implemented originally but its support was worse than expected and had to be removed but recently it has been brought back with a more supported and even better implementation.

Test mode: some users have connected this plugin to services that provide monitoring or send alerts to other devices using the webhook/command features and a way to reduce false alarms had to be added.

Not possible? No problem

The procedure for unsupported features has changed, if the feature that you have requested is limited by HomeKit a label unsupported will be added to it and it'll be put on the roadmap anyways so the moment the limitations are over the feature can be added to the plugin.

No more f#%k-ups

Every weekend I tried to improve this plugin internally as much as I can, every improvement meant higher stability and less time to add newly requested features, this is what happened:

  • Code was improved, a lot.
  • Debug messages were added to troubleshoot issues.
  • Reset mechanism was added to clear saved data (option test_mode).

Hopefully you all enjoying all the new features and are quite satisfied with the plugin, thank you for being an user and contributing to improve it during all this time and continuing to do so.

Siren Reset Question

In a typical Siren Triggered situation, a Homekit Scene is triggered to turn lights on, etc. With the reset feature, how do you suggest resetting or returning those devices (lights etc) turned on to their initial state (likely off)? Should there be a secondary scene called 'Restore' to reset the lights to their off state? How would you handle?

Add German as audio language

Hi, in 2.9.0 how can I play the audio files and whos gonna play it? The pi via audio jack or e.g. external speakers like the HomePod etc.?

BTW.
in the General options "show_pause_switch" is wrong, should be "show_mode_pause_switch".

Prevent arming if doors/windows are open

Preliminary idea.

When set status, check if devices are ready.

Example: Set Away.
Side window not closed. Prompt me that Away mode set but window not closed.

Traditional security system won’t arm if a window is open. You would need to close it and try to arm again. Or you would have to specifically bypass a device or zone, like skip the open window, to be able to arm.

Just an idea. Not sure what a feature would be. Just thinking.

automation condition issue

Hi Miguel, I tried to create a rule: door open with condition “away” and siren on (via Eve App) and also a simple automation “siren” on = “Eve Siren” on. Unfortunately without success, nothing happens. As soon as I use a condition like “away” the rule will not be executed and your siren switch will not be activated. With a simple rule like door open = siren on it works but not with the condition.

Alarm off

Hi :)
I love this alarm :)
But one little issues is when the alarm is set to off. Its still trigges the alarm when a sensor is trigged.

Integrate with Eufy indoor cam

Hello!
Awesome plug-in!
Is it possible to integrate it with the eufy indoor 2k camera? It is HomeKit compatible.
In fact, in the eufy app, it can trigger an alarm sound directly in the cam...do you think it can be possible to achieve te same with you plug-in, but integrated with HomeKit?

Thank u!

Webhook and command triggering when cancelling arming + delay parameter in url not used

Describe the bug
When Arming the security system with a delay, if you cancel the activation, the 'off' command is not called

To Reproduce
Steps to reproduce the behavior:

  1. Arm the security system with a delay
  2. Cancel by setting the security system state to off
  3. The 'off' command is not called

###################
Describe the bug
Moreover, when the Characteristic 'Security System Arm Delay' is off, calling the server URL with 'delay=true' has no effect.

To Reproduce

  1. Set 'Security System Arm Delay' Characteristic to OFF in Eve
  2. Call the URL to activate a mode with delay=true :
    curl http://localhost:1234/away?delay=true
  3. The mode is immediately set to away, without waiting the delay.

Error on Synology Docker

Hello. I got the following error.
Is there something you can do to fix this?

(node:790) UnhandledPromiseRejectionWarning: Error: EACCES: permission denied, mkdir '/run/s6/services/homebridge/.node-persist'
(node:790) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:790) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[9/27/2019, 8:30:01 PM] [Homebase NAS] current power state is: true
[9/27/2019, 8:30:42 PM] [Security system] Target state (Night)
(node:790) UnhandledPromiseRejectionWarning: TypeError: storage.setItem is not a function
    at SecuritySystem.save (/homebridge/node_modules/homebridge-securitysystem/index.js:151:17)
    at SecuritySystem.setTargetState (/homebridge/node_modules/homebridge-securitysystem/index.js:274:10)
    at Characteristic.SecuritySystemTargetState.emit (events.js:198:13)
    at Characteristic.SecuritySystemTargetState.Characteristic.setValue (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Characteristic.js:321:10)
    at Bridge.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:882:22)
    at Array.forEach (<anonymous>)
    at Bridge.Accessory._handleSetCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:822:8)
    at HAPServer.emit (events.js:198:13)
    at HAPServer._handleCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:974:10)
    at HAPServer.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:209:39)
    at IncomingMessage.emit (events.js:198:13)
    at endReadableNT (_stream_readable.js:1145:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
(node:790) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
[9/27/2019, 8:30:45 PM] [Security system] Current state (Night)
(node:790) UnhandledPromiseRejectionWarning: TypeError: storage.setItem is not a function
    at SecuritySystem.save (/homebridge/node_modules/homebridge-securitysystem/index.js:151:17)
    at SecuritySystem.updateCurrentState (/homebridge/node_modules/homebridge-securitysystem/index.js:181:10)
    at SecuritySystem.<anonymous> (/homebridge/node_modules/homebridge-securitysystem/index.js:305:10)
    at ontimeout (timers.js:436:11)
    at tryOnTimeout (timers.js:300:5)
    at listOnTimeout (timers.js:263:5)
    at Timer.processTimers (timers.js:223:10)
(node:790) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
[9/27/2019, 8:31:06 PM] [Security system] Trigger timeout (Started)
(node:790) UnhandledPromiseRejectionWarning: TypeError: storage.setItem is not a function
    at SecuritySystem.save (/homebridge/node_modules/homebridge-securitysystem/index.js:151:17)
    at SecuritySystem.setSwitchState (/homebridge/node_modules/homebridge-securitysystem/index.js:318:10)
    at Characteristic.On.emit (events.js:198:13)
    at Characteristic.On.Characteristic.setValue (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Characteristic.js:321:10)
    at Bridge.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:882:22)
    at Array.forEach (<anonymous>)
    at Bridge.Accessory._handleSetCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:822:8)
    at HAPServer.emit (events.js:198:13)
    at HAPServer._handleCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:974:10)
    at HAPServer.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:209:39)
    at IncomingMessage.emit (events.js:198:13)
    at endReadableNT (_stream_readable.js:1145:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
(node:790) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4)
[9/27/2019, 8:31:11 PM] [Security system] Current state (Alarm triggered)
(node:790) UnhandledPromiseRejectionWarning: TypeError: storage.setItem is not a function
    at SecuritySystem.save (/homebridge/node_modules/homebridge-securitysystem/index.js:151:17)
    at SecuritySystem.updateCurrentState (/homebridge/node_modules/homebridge-securitysystem/index.js:181:10)
    at SecuritySystem.<anonymous> (/homebridge/node_modules/homebridge-securitysystem/index.js:338:14)
    at ontimeout (timers.js:436:11)
    at tryOnTimeout (timers.js:300:5)
    at listOnTimeout (timers.js:263:5)
    at Timer.processTimers (timers.js:223:10)
(node:790) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 5)
[9/27/2019, 8:31:24 PM] [Security system] Target state (Night)
(node:790) UnhandledPromiseRejectionWarning: TypeError: storage.setItem is not a function
    at SecuritySystem.save (/homebridge/node_modules/homebridge-securitysystem/index.js:151:17)
    at SecuritySystem.setSwitchState (/homebridge/node_modules/homebridge-securitysystem/index.js:318:10)
    at Characteristic.On.emit (events.js:198:13)
    at Characteristic.On.Characteristic.setValue (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Characteristic.js:321:10)
    at Bridge.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:882:22)
    at Array.forEach (<anonymous>)
    at Bridge.Accessory._handleSetCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:822:8)
    at HAPServer.emit (events.js:198:13)
    at HAPServer._handleCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:974:10)
    at HAPServer.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:209:39)
    at IncomingMessage.emit (events.js:198:13)
    at endReadableNT (_stream_readable.js:1145:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
(node:790) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 6)
(node:790) UnhandledPromiseRejectionWarning: TypeError: storage.setItem is not a function
    at SecuritySystem.save (/homebridge/node_modules/homebridge-securitysystem/index.js:151:17)
    at SecuritySystem.setTargetState (/homebridge/node_modules/homebridge-securitysystem/index.js:274:10)
    at Characteristic.SecuritySystemTargetState.emit (events.js:198:13)
    at Characteristic.SecuritySystemTargetState.Characteristic.setValue (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Characteristic.js:321:10)
    at Service.SecuritySystem.Service.setCharacteristic (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Service.js:183:32)
    at SecuritySystem.setSwitchState (/homebridge/node_modules/homebridge-securitysystem/index.js:348:22)
    at Characteristic.On.emit (events.js:198:13)
    at Characteristic.On.Characteristic.setValue (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Characteristic.js:321:10)
    at Bridge.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:882:22)
    at Array.forEach (<anonymous>)
    at Bridge.Accessory._handleSetCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:822:8)
    at HAPServer.emit (events.js:198:13)
    at HAPServer._handleCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:974:10)
    at HAPServer.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:209:39)
    at IncomingMessage.emit (events.js:198:13)
    at endReadableNT (_stream_readable.js:1145:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
(node:790) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 7)
[9/27/2019, 8:31:24 PM] [Security system] Current state (Night)
(node:790) UnhandledPromiseRejectionWarning: TypeError: storage.setItem is not a function
    at SecuritySystem.save (/homebridge/node_modules/homebridge-securitysystem/index.js:151:17)
    at SecuritySystem.updateCurrentState (/homebridge/node_modules/homebridge-securitysystem/index.js:181:10)
    at SecuritySystem.<anonymous> (/homebridge/node_modules/homebridge-securitysystem/index.js:305:10)
    at ontimeout (timers.js:436:11)
    at tryOnTimeout (timers.js:300:5)
    at listOnTimeout (timers.js:263:5)
    at Timer.processTimers (timers.js:223:10)
(node:790) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 8)
[9/27/2019, 8:32:41 PM] [Security system] Target state (Home)
(node:790) UnhandledPromiseRejectionWarning: TypeError: storage.setItem is not a function
    at SecuritySystem.save (/homebridge/node_modules/homebridge-securitysystem/index.js:151:17)
    at SecuritySystem.setTargetState (/homebridge/node_modules/homebridge-securitysystem/index.js:274:10)
    at Characteristic.SecuritySystemTargetState.emit (events.js:198:13)
    at Characteristic.SecuritySystemTargetState.Characteristic.setValue (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Characteristic.js:321:10)
    at Bridge.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:882:22)
    at Array.forEach (<anonymous>)
    at Bridge.Accessory._handleSetCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:822:8)
    at HAPServer.emit (events.js:198:13)
    at HAPServer._handleCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:974:10)
    at HAPServer.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:209:39)
    at IncomingMessage.emit (events.js:198:13)
    at endReadableNT (_stream_readable.js:1145:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
(node:790) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 9)
[9/27/2019, 8:32:44 PM] [Security system] Current state (Home)
(node:790) UnhandledPromiseRejectionWarning: TypeError: storage.setItem is not a function
    at SecuritySystem.save (/homebridge/node_modules/homebridge-securitysystem/index.js:151:17)
    at SecuritySystem.updateCurrentState (/homebridge/node_modules/homebridge-securitysystem/index.js:181:10)
    at SecuritySystem.<anonymous> (/homebridge/node_modules/homebridge-securitysystem/index.js:305:10)
    at ontimeout (timers.js:436:11)
    at tryOnTimeout (timers.js:300:5)
    at listOnTimeout (timers.js:263:5)
    at Timer.processTimers (timers.js:223:10)
(node:790) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 10)

Create an automation using the arming event as trigger

Hi Miguel
Is there any way you could add the alarm status "conectando" i guess in English it will be an "arming" option in Homekit?

I have a 10 second arm delay and would like to be able to trigger a buzzer the moment the alarm is arming ( I do this with a calling a small script via Cmdtriggerswitch pluggin , the scrip generates 4 long beeps 4 short beeps and 1 long beeb )
At the moment I can only make the beeps start working once the alarm is "conectado" "armed" wich is not correct

This idea is to try and copy the way a "normal" alarm works beeping during the arming period for you to know you must get out of your house quick or you will trigger the alarm

As my phone will not work with NFC tags I have created some smart buttons thanks to rpi pluggin that are connected to wall switches near my front door ( to be able to activate / deactivate ) the alarm.

I have a script that makes a short double beep that activates when the alarm is disconnected to copy what a "normal" alarm would do

Does anyone know how to make the notifications received on your iphone when the alarm is triggered sound with a personalized continuous sound? ( this should only happen with notifications from the alarm , other notifications should remain the same )

image
image

Get system status in Shortcuts

I can't make a script in Shortcuts app to get automations with conditions.

As an exemple, I would like to check every morning if the night mode is set and if I'm detected, disable it. To do so, I have to get the status of the system and make a test (If/then/Else) on its value.

When writing the script, I can only define status as integer value, so I tried to test values like "1" or "0". Unfortunately, when running the script, I am told that string result can't be converted to integer. I seems that the returned value for the system status is a string ("home", "away", "nigth" ...).

Can you fix this by allowing defining string values in the script or by returning integer values while it is executed ?

To test, just make an automation and ask to convert it to a shortcut, then try to make a rule that tests the system status.

Thanks in advanced for your help.

Regard,

Jerome

[FEATURE REQUEST]: Virtual Switches for Modes

(not an original idea) Create virtual switches for the modes (that are not disabled) so that the security system modes can be changed automatically based on user location.

Example use cases:
-First Person Arrives Home -> Away Mode Switch turned Off -> Security System mode set to Off
-Last Person Leaves Home -> Away Mode Switch turned On -> Security System mode set to Away

Obviously this is a workaround for Apple's automation rules but it would open up some more use cases. I'd recommend that this feature a) is optional and b) aligns with Disabled Modes

Beeping alert sound during countdown

I'm playing a beeping sound when the alarm goes off until the siren kicks in.
It would be awesome if you can handle this as well directly in the plugin.
Beeping sound in loop as long as the ""trigger_seconds": xx" is set to.

Originally posted by @Christian-CFP in #37 (comment)

ffmpeg / Alarm Sound problem

Hi there.
If I want to use the audio options for the Alarm, I get this error message:

Error: spawn ffplay ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21)

I tried to install ffmpeg. It seemed that it is installed, but the error persists.
Maybe someone could help me getting this working. Thanks in advance!

(I use docker with a Homebridge image on a Synology NAS)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.