Page 2 sur 2

Re: Script Lua : je deviens fou ?

Publié : 20 déc. 2018, 15:53
par cyberbob
vil1driver a écrit : 20 déc. 2018, 14:29 ...Si le nom du script correspond au nom d'un device existant (ecs en l'occurrence) seul ce dernier va pouvoir le déclancher.
Ha, mais c'est bon a savoir ça :idea:
Cela peut être bien pratique dans certain cas.
Et au fait, cette info viens de où car me souvient pas d'avoir lu ça quelques part ?

Re: [Résolu] Script Lua : je deviens fou ?

Publié : 20 déc. 2018, 16:12
par johnnybravo
C'est ici:
https://www.domoticz.com/wiki/Events
Première phrase sous la section intitulée "By adding your own scripts to the scripts/lua/ dir in your domoticz installation folder."
Note: As of version V3.8050 device scripts can be named the same as the device to only evaluate the Lua code when this device changes. Eg. if you use script_device_switch_1.lua and you have a device named 'Switch 1', this script will only trigger when this device updates. You should only use lowercase characters in the file name for this to work. Spaces are set with an underscore (_). If you name the script randomly, eg. script_device_somethingelse.lua, and there is no such device named 'somethingelse', it will evaluate the script on all device changes, the same behavior as pre V3.8050.