same devicechanged in more LUA's

Moderator: leecollings

Post Reply
ensingg
Posts: 65
Joined: Saturday 22 April 2017 17:35
Target OS: Windows
Domoticz version:
Contact:

same devicechanged in more LUA's

Post by ensingg »

Hi,

I like to split up my main LUA script to more small functional LUA scripts. More neat programming I think.
But now I have a question.

I have an ALARM.LUA that checks some stuff related to the alarm triggers.
There is a devicechangend check for DOOR

But I like to do a devicechanged check for DOOR in other script too.
(for switched lights on - in this example)

But when I have to LUA scripts (type device) and do DEVICECHANGED for the same thing in both scripts. Will this work?
User avatar
Siewert308SW
Posts: 290
Joined: Monday 29 December 2014 15:47
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: The Netherlands
Contact:

Re: same devicechanged in more LUA's

Post by Siewert308SW »

For sure it will work.
Even if you want 30 different Lua event files/scripts to be triggered on a certain devicechange
Setup:
- RPi4 - Domo Stable / Aeotec Z-stick7 / PiHole Unbound Gemini
- RPi4 - PiHole / PiVPN Unbound Gemini
- Synology DS923+ / DS218j
- P1 Gas/Power, SmartGateway watermeter
- Fibaro switches, contacts, plugs, smoke/Co2 ect
- rootfs @ USB HDD
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: same devicechanged in more LUA's

Post by waaren »

ensingg wrote: Thursday 31 January 2019 14:29 I like to split up my main LUA script to more small functional LUA scripts. More neat programming I think.
But now I have a question.

I have an ALARM.LUA that checks some stuff related to the alarm triggers.
There is a devicechangend check for DOOR

But I like to do a devicechanged check for DOOR in other script too.
(for switched lights on - in this example)

But when I have to LUA scripts (type device) and do DEVICECHANGED for the same thing in both scripts. Will this work?
Yes. Does work in Lua and also in dzVents
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest