Panic alarm system





PANIC is a set of tools (api, Tango device server, user interface) that provides:

  • Periodic evaluation of a set of conditions.
  • Notification (email, sms, pop-up, speakers)
  • Keep a log of what happened. (files, Tango Snapshots)
  • Taking automated actions (Tango commands / attributes)
  • Tools for configuration/visualization.


Launch your PANIC System in few steps


You must have PyTango + Tango + MySQL up and running and your TANGO_HOST and PYTHONPATH environment variables properly set.

PyTango is available at PyPI:

Get the code:

You can download PyAlarm and the panic api from tango-ds at sourceforge:

svn co .

Fandango library (functional tools for tango) is required to be in your PYTHONPATH:

svn co fandango

The PANIC User Interface is available in the /clients branch:

svn co panic-gui

Setup your Tango database

Create your devices from a python console (or Jive):

import PyTango

db = PyTango.Database()

def add_new_device(server,klass,device):

dev_info = PyTango.DbDevInfo() = device

dev_info.klass = klass

dev_info.server = server




#Create a PyAlarm device




#I'll add a simulator, but you can't use TangoTest or whatever device you want:



From shell, launch your PyAlarm and Simulator devices

# python PyAlarm/ 1 &

# python PySignalSimulator/ 1 &

Create a TEST_ALARM using the API:

import panic

alarms = panic.api()

alarms.add('TEST_ALARM',formula='(test/sim/1/A%15 > 5)',description='test',receivers='your@mail')

Run the panic application and configure your Alarms

python panic-gui/

See the application manual:

If you want to see faster changes in the alarm cycle try to set the following configuration values (Tools->Adv.Config):

PollingPeriod = 1
AlarmThreshold = 1
AutoReset = 5

Notification Services

The syntax for sending an email (from linux, you'll need the "mail" command available in the system, from windows you'll have to set as receiver a command from a device running in a linux machine):

    DeviceProxy("your/alarm/device").command_inout("SendMail",["Bonjour,\n\nthis is a test message\n\nau revoire","RE: testing",""])

The other command we have for notification is SendSMS; but it requires our file that is specific to our SMS provider (it uses http transactions to send the messages). If you're interested on it you'll have to write your own file to use it.

FestivalDS, Speech and pop-ups

There's another notification device you can use, the FestivalDS. It provides speech synthesizing and pop-ups in a linux environment (it requires "festival" and "libnotify-bin" linux packages):

The commands are

    Play(string): speech to speakers
    Beep(): beep!
    Play_sequence(string):  it just makes some beeps before and after the speech
    PopUp(title,text,[seconds]): shows a pop-up with title/text for the given time

And that's all regarding our current notifiers, for database we don't have anything yet, as we use the device properties to store all the data. You'll find more information in the PyAlarm user guide.

back to the list