Here is the most important part in home automation : scenarios. True brain of the domotics, it is what makes it possible to interact with the real world in an “intelligent way”.

The Scenarios management page


To access it, nothing simpler, just go to Tools -> Scenarios. You will find there the list of scenarios for your Jeedom as well only functions to manage them better :

My scenarios

In this section you will find the list of scenarios that you have created. They are classified according to groups that you have defined for each of them. Each scenario is displayed with its last name and his parent object. The grayed out scenarios are those who are disabled.

As in many Jeedom pages, put the mouse to the left of the screen displays a quick access menu (from your profile, you can always leave it visible). You will be able so search your scenario, but also in Add one by this menu.

Editing a scenario

After clicking on Add, you must choose the name of your scenario and you are redirected to its general settings page. At the top, there are some useful functions to manage our scenario :

General tab

In the tab General, we find the main parameters of our scenario :


Warning : you can have a maximum of 28 triggers / programming for a scenario.

Scenario tab

This is where you will build your scenario. We must start through add a block, with the button on the right. Once a block created, you can add another block or a Action.


In conditions and actions, it is better to favor single quotes (‘) instead of double (“)


Here are the different types of blocks available :

Each of these blocks has its options for better handling them :

If / Then / Otherwise blocks, Loop, In and A


On Si / Then / Otherwise blocks, circular arrows located to the left of the condition field allow to activate or not the repetition of actions if the evaluation of the condition gives the same result that the previous assessment.

For the conditions, Jeedom tries to make sure that we can write as much as possible in natural language while remaining flexible. Three buttons are available on the right of this type of block for select an item to test :


There is a list of tags allowing access to variables from the script or another, or by time, date, a random number,…. See further the chapters on commands and tags.

Once the condition is completed, you must use the button “add “, left, to add a new block or a Action in the current block.


You MUST NOT use [] in condition tests, only parentheses () are possible

Block Code


Please note, tags are not available in a code block.

Controls (sensors and actuators):

Log :

Scenario :

The actions

Actions added to blocks have several options. In order :


Depending on the selected command, we can see different additional fields displayed.

Possible substitutions


There are specific triggers (other than those provided by commandes) :

You can also trigger a scenario when a variable is set to day putting : #variable(nom_variable)# or using the HTTP API described here.

You can use any of the following symbols for comparisons in conditions :

You can combine any comparison with operators following :


A tag is replaced during the execution of the scenario by its value. You can use the following tags :


To have the leading zeros on display, use the Date () function. See here.

You also have the following additional tags if your script has been triggered by an interaction :


When a scenario is triggered by an interaction, it is necessarily run in fast mode.

Calculation functions

Several functions are available for the equipment :

The periods and intervals of these functions can also use with expressions PHP comme par example :

Here are practical examples to understand the values returned by these different functions :

Socket with values : 000 (for 10 minutes) 11 (for 1 hour) 000 (for 10 minutes)
average (catch, period) Returns the average of 0 and 1 (can
  be influenced by polling)
averageBetween(#[Salle de bain][Hydrometrie][Humidité]#,2015-01-01 00:00:00,2015-01-15 00:00:00) Returns the average order between January 1, 2015 and January 15, 2015
min (catch, period) Returns 0 : the plug was extinguished during the period
minBetween(#[Salle de bain][Hydrometrie][Humidité]#,2015-01-01 00:00:00,2015-01-15 00:00:00) Returns the minimum order between January 1, 2015 and January 15, 2015
max (catch, period) Returns 1 : the plug was well lit in the period
maxBetween(#[Salle de bain][Hydrometrie][Humidité]#,2015-01-01 00:00:00,2015-01-15 00:00:00) Returns the maximum of the order between January 1, 2015 and January 15, 2015
duration (taken, 1, period) Returns 60 : the plug was on (at 1) for 60 minutes in the period
durationBetween(#[Salon][Prise][Etat]#,0, Last Monday, Now) Returns the duration in minutes during which the socket was off since last Monday.
statistics (catch, count, period) Returns 8 : there were 8 escalations in the period
trend (plug, period 0.1) Returns -1 : downward trend
stateDuration (taken) Returns 600 : the plug has been in its current state for 600 seconds (10 minutes)
lastChangeStateDuration (taken, 0) Returns 600 : the socket went out (change to 0) for the last time 600 seconds ago (10 minutes)
lastChangeStateDuration (take, 1) Returns 4200 : the socket turned on (switch to 1) for the last time 4200 seconds ago (1h10)
lastStateDuration (taken, 0) Returns 600 : the socket has been off for 600 seconds (10 minutes)
lastStateDuration (taken, 1) Returns 3600 : the socket was last switched on for 3600 seconds (1h)
stateChanges (taken, period) Returns 3 : the plug changed state 3 times during the period
stateChanges (take, 0, period) Returns 2 : the socket has extinguished (going to 0) twice during the period
stateChanges (take, 1, period) Returns 1 : the plug is lit (change to 1) once during the period
lastBetween(#[Salle de bain][Hydrometrie][Humidité]#,Yesterday, Today) Returns the last temperature recorded yesterday.
variable (plop, 10) Returns the value of the variable plop or 10 if it is empty or does not exist
scenario(#[Salle de bain][Lumière][Auto]#) Returns 1 in progress, 0 if stopped and -1 if deactivated, -2 if the scenario does not exist and -3 if the state is not consistent
lastScenarioExecution(#[Salle de bain][Lumière][Auto]#) Returns 300 if the scenario was started for the last time 5 min ago
collectDate(#[Salle de bain][Hydrometrie][Humidité]#) Returns 2015-01-01 17:45:12
valueDate(#[Salle de bain][Hydrometrie][Humidité]#) Returns 2015-01-01 17:50:12
eqEnable(#[Aucun][Basilique]#) Returns -2 if the equipment is not found, 1 if the equipment is active and 0 if it is inactive
tag (montag, toto) Returns the value of “montag” if it exists otherwise returns the value “toto”
name (eqLogic, #[Salle de bain][Hydrometrie][Humidité]#) Returns Hydrometry

Mathematical functions

A generic function toolbox can also be used to perform conversions or calculations :

And practical examples :

Example of function Returned result
randText (it does #[salon][oeil][température]#; The temperature is #[salon][oeil][température]#; Currently we have #[salon][oeil][température]#) the function will return one of these texts randomly at each execution.
randomColor(40,60) Returns a random color close to green.
trigger(#[Salle de bain][Hydrometrie][Humidité]#) 1 if that’s good #[Salle de bain][Hydrometrie][Humidité]# who started the scenario otherwise 0
triggerValue(#[Salle de bain][Hydrometrie][Humidité]#) 80 if the hydrometry of #[Salle de bain][Hydrometrie][Humidité]# is 80%.
round(#[Salle de bain][Hydrometrie][Humidité]# / 10) Returns 9 if the humidity percentage and 85
odd(3) Returns 1
median(15,25,20) Returns 20
time_op(#time#, -90) if it is 4:50 p.m., return : 1 650 - 1 130 = 1520
formatTime(1650) Returns 4:50 p.m
floor(130/60) Returns 2 (minutes if 130s, or hours if 130m)

Specific orders

In addition to home automation commands, you have access to the following actions :

Scenario template

This functionality allows you to transform a scenario into a template for for example apply it on another Jeedom or share it on the Market. It is also from there that you can recover a scenario from the Market.


You will then see this window :


From there, you have the possibility :

By clicking on a template, you get :


At the top you can :

Below, you have the part to apply your template to current scenario.

Since from one Jeedom to another or from one installation to another, the orders may be different, Jeedom ask you the correspondence of orders between those present during creation of the template and those present at home. You just need to fill in the match orders then apply.

Addition of php function


Adding PHP function is reserved for advanced users. The slightest error can crash your Jeedom

Set up

Go to the Jeedom configuration, then OS / DB and launch the file editor.

Go to the data folder then php and click on the user.function.class.php file.

It is in this class that you must add your functions, you will find there an example of basic function.


If you have a problem you can always go back to the original file and copy the contents of user.function.class.sample.php in user.function.class.php

Nous utilisons des cookies pour vous garantir la meilleure expérience sur notre site web. Si vous continuez à utiliser ce site, nous supposerons que vous en êtes satisfait.