kk7ds / pynx584

Python library and server for talking to NX584/NX8E interfaces
GNU General Public License v3.0
29 stars 26 forks source link

Is it possible to trigger the alarm #32

Closed danps1 closed 2 years ago

danps1 commented 5 years ago

I have this component working really nicely with the Home Assistant integration - thanks very much for writing it!

I wanted to know if it is possible to extend this to be able to trigger the alarm from pynx584? (and hence from Home Assistant)

The scenario is that my alarm system is only motion sensors, however, as part of my home automation, I have door and window sensors implemented using zwave into HA.

It would be easy to write an automation that would trigger the alarm if my back door was opened while the alarm is armed - if the pynx584 allows this?

Thanks for your help.

yknot7 commented 3 years ago

After some research there is no way to blast siren from commands

Here is an inefficient workaround if your system is self monitored:

Setup fire panic button

From outside of programming type in * + 8 + Programming Code. You will then be asked for the device number. Type 0 and press #. You will then be asked for the location. Type 23 and #. This is done in segment 1 of location 23. You want to make sure that options 5, 6 and 7 are on. You will know that they are on because you will see the numbers being displayed. If they are not displayed then press the corresponding numbers on the keypad to make them show up. The numbers correspond to the explanations below:

  1. On enables audible keypad panic.

  2. On enables keypad aux 1 (fire panic).

  3. On enables keypad aux 2 (emergency panic).

Press * to move to the next segment. That will save the info you just changed. Then press # to exit

add the following code to the files api.py between line 78 and 79 elif args.get('cmd') == 'siren': CONTROLLER.siren(int(args.get('partition', 1)))

client.py on line 43 def siren(self, partition=1): r = self._session.get( self._url + '/command', params={'cmd': 'siren', 'partition': partition}) return r.status_code == 200

controller.py on line 264 For fire siren def siren(self, partition): self._queue.append([0x3E, 0x04, partition])

Or for medical keypad siren def arm_exit(self, partition): self._queue.append([0x3E, 0x05, partition])

http://yourip:5007/command?cmd=siren&partition=1 will trigger the fire alarm siren or the medical keypad siren depending on what you added to the controller.py!

kk7ds commented 2 years ago

I'm going to close this as it's not really a bug, but if you want to get those changes in, please submit a PR.