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

Forum dédié aux problématiques concernant les scripts pour DomoticZ.
Entourez votre code et les logs avec les balises nommées code grâce au bouton <\>.
cyberbob
Messages : 511
Inscription : 28 nov. 2016, 19:43
Localisation : Belgique

Re: Script Lua : je deviens fou ?

Message 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 ?
Domoticz Stable V4.9700 sur Synology DSM 6.2 / 2 x RFlink V48.4 - 433.92MHz(Dio/Chacon) & 433.42MHz(RTS) / Script en LUA & Blocky
johnnybravo
Messages : 63
Inscription : 04 mai 2017, 14:15

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

Message 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.
Répondre