Hello,
I've one question i have multiple RPI's with domoticz which all use the same scripts but in Bash I know how to select on which host the scripts runs and than executes the script on the other hosts the script won't be executed.
HOST=$(hostname)
if [ "$HOST" = "domoticz" ];
then
<EXECUTE>
else
exit
fi
Is the above also possible with LUA? And how could this be configured?
How to check on which device lua scripts runs
Moderator: leecollings
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: How to check on which device lua scripts runs
with dzVents (= Lua) and if you use a recent beta, you can identify the name of your system by the atrribute domoticz.settings.location.name which shows the Name you set in Location
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
- jvdz
- Posts: 2332
- Joined: Tuesday 30 December 2014 19:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.107
- Location: Netherlands
- Contact:
Re: How to check on which device lua scripts runs
... or simply create a similar uservariable on each system and set that to the systemname. Then you can test the content of that user variable in the script.
Jos
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
-
- Posts: 2
- Joined: Monday 22 December 2014 7:53
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: How to check on which device lua scripts runs
Who is online
Users browsing this forum: No registered users and 1 guest