Hello,
I have a dummy switch. When I turn it ON, it executes associated bash script.
Currently, when the script finishes, the switch will stay in ON position.
I am searching the way how to turn the switch OFF, automatically when the script finishes.
Many thanx for help.
Turn the switch off when script finishes
Moderator: leecollings
Re: Turn the switch off when script finishes
hello just add curl json command at end of the script
something like this
curl 'http://YOURIP/json.htm?type=command&par ... tchcmd=Off'
something like this
curl 'http://YOURIP/json.htm?type=command&par ... tchcmd=Off'
-
- Posts: 6
- Joined: Wednesday 12 September 2018 14:15
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Turn the switch off when script finishes
brilliant devros! Many thanx for navigating me to the solution.
as I have got 'Unauthorized' response to curl, I just had to extend the url with my relevant encoded name/password, based on the response from this thread viewtopic.php?t=19949
as I have got 'Unauthorized' response to curl, I just had to extend the url with my relevant encoded name/password, based on the response from this thread viewtopic.php?t=19949
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Turn the switch off when script finishes
If you want to be sure that the switch return to the Off state even when the start- or execution of the bash-script fails before it reach the curl command, as explained by devros, you could set the Off delay to n seconds in the edit section of the switch (to be reached via the edit button on the device at the switches tab)
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
Who is online
Users browsing this forum: No registered users and 1 guest