Device identification in script

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
oliviers
Posts: 73
Joined: Wednesday 16 September 2015 22:10
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Paris area, France
Contact:

Device identification in script

Post by oliviers »

Hello,
I have several ON/OFF switches, launching the same (bash) action script when turning on.
Question: What can I do, in the script, to identify the switch which triggered it ??
Take care,
Olivier
Paris area
Raspberry Pi 4 - RFXComm 433 - IrTrans - Zwave
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Device identification in script

Post by waaren »

oliviers wrote: Friday 13 November 2020 20:36 I have several ON/OFF switches, launching the same (bash) action script when turning on.
Question: What can I do, in the script, to identify the switch which triggered it ??
Assuming you use the On action field of the devices for this; set it to something like

script:///<full qualified scriptName> <name of your device>

and in the bash script use something like

Code: Select all

parm=${1:-empty}

echo $parm >> /usr/local/domotica/data/parmTest.log
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
oliviers
Posts: 73
Joined: Wednesday 16 September 2015 22:10
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Paris area, France
Contact:

Re: Device identification in script

Post by oliviers »

Thank you, that would do it ! I will try this first thing in the morning tomorrow !

Edit: Saturday, noon: That indeed works!
Paris area
Raspberry Pi 4 - RFXComm 433 - IrTrans - Zwave
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests