Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,


as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.


As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!



Smart Home Forum by FIBARO Team

Universal Alarm Scene 1.0.0

   (2 reviews)

1 Screenshot

About This File

Universal alarm v1.0


Universal alarm gui.jpg


Hello everyone!


Here is one simple scene that can be used for FIRE, FLOOD or OTHER ALARM purpose. When triggered by sensor it will send you popup, push and e-mail notification. It can also activate additional alarm sounders. You can also add additional actions to turn On lights, lower blinds or whatever action you like to happen when alarm is breached and also when sensor get back to safe state.


There is no global variables needed! If you use HomeTable then you can just uncomment line where this table is read to the scene.



First you need to decide for what you will use this scene. You can use it for FIRE ALARM or for FLOOD ALARM or for any other purpose that you can think off. Just for setup example I will show here how to set it up for FIRE alarm. Same setup can be done for FLOOD alarm.


First you need to add all your smoke detectors to scene header so that it is triggered when any of this sensors detects fire and get breached:

%% properties
96 value
128 value
605 value
%% globals

Then you can setup devices to which you want this scene to send push notifications. As already mentioned in my other threads, to find ID of your mobile devices you can enter this link in your browser:




and then press on button TRY IT! You will get ID numbers of all mobile devices that you can enter here:

-- PUSH MESSAGES AND MOBILE DEVICE SETUP ---------------------------------
-- define mobile devices to send push messages. Enter devices inside
-- braces separated by comma
local iosDeviceID   = {206, 321};


Then you can setup messages text, translate it to your language:

-- PUSH MESSAGES SETUP ------------------------------------------------------
-- enter push message text for breached alarm notification

-- POPUP MESSAGES SETUP -----------------------------------------------------
-- enter popup message text and button caption for breached alarm
local popupMainTitle     = "FIRE/FLOOD/OTHER ALARM";
local popupTimeFormat    = "%H:%M:%S | %d.%m.%Y.";
local popupContentTitle  = "ALARM breached!";
local popupImgUrl        = "";
local popupButtonCaption = "OK";

Here you can setup users that will receive e-mail message. Same as for mobile devices, you can find users ID by entering following link in your browser:




and then press button TRY IT!. You will get ID numbers of all users that you can enter here:

-- E-MAIL MESSAGE SETUP -----------------------------------------------------
-- define users for which you want to receive e-mail warning. Enter users
-- inside braces separated by comma

local userID       = {};

-- Translate this e-mail message text that will be sent to you. On this
-- part scene will add which sensor was breached.

local emailMessage = "Breached FIRE/FLLOD/OTHER sensor:"

In above settings you can also setup first part of the e-mail message. Scene will on that part add room and name of the sensor that is breached!


If you want to activate additional sounders because fire and flood sensor sounder is not enough then you can setup here additional sounders to be activated when alarm is activated:

-- EXTRA SOUNDER SETUP ------------------------------------------------------
-- define alarm sounder ID inside braces. You can define more than one just
-- separate them with comma.
local sounderID    = {128, 210};

And for the end, if this is not enough for you and you want more action to be executed when alarm is breached, like close water valves, close blinds or turn on some lighting then you can add that code yourself. There are three functions where you can add code:

-- EXTRA FUNCTIONS WHERE YOU CAN ADD YOUR CODE ----------------------------
-- use this function to add code that will be executed before all other
-- code when sensor is breached

function extraUserCodeBreachFirst()
  -- your code goes here

-- use this function to add code that will be executed after all other
-- code when sensor is breached

function extraUserCodeBreachLast()
  -- your code goes here


-- use this function to add code that will be executed when sensor is
-- back to safe state

function extraUserCodeSafe()
  -- your code goes here


If you want some action before notifications are send and sounders activated then you add code to function extraUserCodeBreachFirst(). If you want some action to be executed after notifications are sent and sounders activated then you add code to function extraUserCodeBreachLast(). When sensor goes back to safe state scene is activated again. It will not send any messages but will stop sounders and if you want some more action then you can add code to function extraUserCodeSafe().


So, one copy of this scene you can setup for FIRE ALARM. Another copy you can setup for FLOOD ALARM, and if you have something else then you can setup third copy for that OTHER ALARM.


Also please check this video by Mr Apple @MarcoTorino71:




This scene is tested on my HC2 with software 4.110 up to 4.510 by breaching FIRE & FLOOD sensors and found to work flawlessly. If you encounter any problems then please first check your settings and look for typos. If you are still unable to make it work then please send me copy of complete scene code and screenshot of debugging window to my private message and I will help you to make it work!

  • Like 3
  • Thanks 1

User Feedback

You may only provide a review once you have downloaded the file.



Thanks to Sankotronic, clever and easy to understand. Covers all the needs of a good alarm program, and works flawlessly. Recommended

Link to review


Great scene. Easy and very professional tutorial. The author is an outstanding programmer! 

Link to review
  • Create New...