possibility to start script when switch is pushed

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
JacquesMulders
Posts: 33
Joined: Saturday 03 January 2015 22:05
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: The Netherlands
Contact:

possibility to start script when switch is pushed

Post by JacquesMulders »

Hi,

does someone know if it is possible to start a script when a switch is pushed, with a variable in the end (just like the evohome hardware)

for example:
dimmer slider is set to 60% "script://dimmer.sh" 60 is started.

another example from the evohome hardware:

Code: Select all

script:///usr/local/bin/settemp.sh {deviceid} {mode} {setpoint} {until}
so is it possible for switch/dimmer hardware to send e.g. level, data, idx

Code: Select all

script:///home/pi/dimmer.sh {level} {data} {idx}
User avatar
jvdz
Posts: 2354
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: possibility to start script when switch is pushed

Post by jvdz »

Don't think this is possible in the On/Off action script option, but you can do this with a LUA event script which then shells the bash file.

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
JacquesMulders
Posts: 33
Joined: Saturday 03 January 2015 22:05
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: The Netherlands
Contact:

Re: possibility to start script when switch is pushed

Post by JacquesMulders »

thats not really the action that i want, i can call the api call to get al the data, but it would be much cleaner to just get the variables with the script start.

for the record, ive tryed:

Code: Select all

script:///home/pi/dimmer.sh {level} {data} {idx}

Code: Select all

script:///home/pi/dimmer.sh $Level $Data $idx

Code: Select all

script:///home/pi/dimmer.sh $level $data $idx
the last 2 where as the json output would be if you retrieve the switch status
jannl
Posts: 686
Joined: Thursday 02 October 2014 6:36
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: Geleen
Contact:

Re: possibility to start script when switch is pushed

Post by jannl »

If you do this via an eventscript in lua, you get almost what you want I think.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest