Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
fr:liste_script [2016/10/14 11:57]
mifrey
fr:liste_script [2016/10/14 12:32]
mifrey
Line 299: Line 299:
 //By mifrey// //By mifrey//
  
-**But :** Script permettant de simuler une présence en allumant/éteignant des lampes dans une certaine séquence et avec des durées aléatoires.+**But :** Script permettant de simuler une présence en allumant/éteignant des lampes dans une certaine séquence (par exemple on sort du salon, on va dans la salle de bain puis dans la chambre) avec des durées aléatoires.
  
 **Règle :** Le script doit être mis dans les conditions d'une règle et être déclenché par le changement des IOs "Enable", "Evening" et "Timer". Rien dans les actions. **Règle :** Le script doit être mis dans les conditions d'une règle et être déclenché par le changement des IOs "Enable", "Evening" et "Timer". Rien dans les actions.
Line 308: Line 308:
  
 Pour tester la séquence sans devoir attendre le couché du soleil, il faut mettre la variable %%"script_test_enable"%% à true puis activer le simulateur avec l'IO "Enable". La séquence se déroulera avec un changement d'état toutes les 5 secondes. Pour tester la séquence sans devoir attendre le couché du soleil, il faut mettre la variable %%"script_test_enable"%% à true puis activer le simulateur avec l'IO "Enable". La séquence se déroulera avec un changement d'état toutes les 5 secondes.
 +
 +Afin de d'analyser si le script a bien fonctionné, on peut analyser les logs de Calaos-Server :
 +<code>
 +root@raspberrypi:~# journalctl -lu calaos-server --no-pager | grep SCRIPT_CONDITIONS_PRESENCE_SIMULATOR
 +Oct 14 12:01:59 ... LuaPrint: SCRIPT_CONDITIONS_PRESENCE_SIMULATOR: Start
 +Oct 14 12:01:59 ... LuaPrint: SCRIPT_CONDITIONS_PRESENCE_SIMULATOR: State=0
 +Oct 14 12:01:59 ... LuaPrint: SCRIPT_CONDITIONS_PRESENCE_SIMULATOR: End
 +Oct 14 12:02:02 ... LuaPrint: SCRIPT_CONDITIONS_PRESENCE_SIMULATOR: Start
 +Oct 14 12:02:02 ... LuaPrint: SCRIPT_CONDITIONS_PRESENCE_SIMULATOR: State=1
 +Oct 14 12:02:02 ... LuaPrint: SCRIPT_CONDITIONS_PRESENCE_SIMULATOR: Set timer = 0:0:16:803
 +Oct 14 12:02:02 ... LuaPrint: SCRIPT_CONDITIONS_PRESENCE_SIMULATOR: End
 +Oct 14 12:02:07 ... LuaPrint: SCRIPT_CONDITIONS_PRESENCE_SIMULATOR: Start
 +Oct 14 12:02:07 ... LuaPrint: SCRIPT_CONDITIONS_PRESENCE_SIMULATOR: State=2
 +Oct 14 12:02:07 ... LuaPrint: SCRIPT_CONDITIONS_PRESENCE_SIMULATOR: Set timer = 0:12:37:894
 +Oct 14 12:02:07 ... LuaPrint: SCRIPT_CONDITIONS_PRESENCE_SIMULATOR: End
 +Oct 14 12:02:12 ... LuaPrint: SCRIPT_CONDITIONS_PRESENCE_SIMULATOR: Start
 +Oct 14 12:02:12 ... LuaPrint: SCRIPT_CONDITIONS_PRESENCE_SIMULATOR: State=3
 +Oct 14 12:02:12 ... LuaPrint: SCRIPT_CONDITIONS_PRESENCE_SIMULATOR: Set timer = 0:19:10:782
 +Oct 14 12:02:12 ... LuaPrint: SCRIPT_CONDITIONS_PRESENCE_SIMULATOR: End
 +...
 +</code>