Irrigation with multiple zones

Moderator: leecollings

woody4165
Posts: 476
Joined: Monday 14 March 2016 13:55
Target OS: Linux
Domoticz version: beta
Location: Rome, Italy
Contact:

Re: Irrigation with multiple zones

Post by woody4165 »

I thought that when launching an os.execute the execution was launched, but them the control return to the script.
It's not like this.
So since the irrigation.sh can last also for 30 mins, I modified it adding an " &" at the the end, so is going to launch and the script get back control.
In this way of course I can't get any response (if any) from the bash script.

Do you think is a good idea?
Cubietruck - Linux cubietruck 4.13.16 (Debian GNU/Linux 8 (jessie)) + Domoticz + RFLink, Xiaomi Gateway, Owl USB, Yeelight Color and B/W, ESP8266, Broadlink RM2, Netatmo Thermostat
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Irrigation with multiple zones

Post by Egregius »

Let the script write to a logfile, or back to domoticz in a text device or a user variable.
You should (almost) always use & at the end of a bash command to let it continue.
woody4165
Posts: 476
Joined: Monday 14 March 2016 13:55
Target OS: Linux
Domoticz version: beta
Location: Rome, Italy
Contact:

Re: RE: Re: Irrigation with multiple zones

Post by woody4165 »

Egregius wrote:Let the script write to a logfile, or back to domoticz in a text device or a user variable.
You should (almost) always use & at the end of a bash command to let it continue.
Thanks!
How can I write into an user variable from a bash script?
Cubietruck - Linux cubietruck 4.13.16 (Debian GNU/Linux 8 (jessie)) + Domoticz + RFLink, Xiaomi Gateway, Owl USB, Yeelight Color and B/W, ESP8266, Broadlink RM2, Netatmo Thermostat
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Irrigation with multiple zones

Post by Egregius »

Wiki json api
Just curl the url.
woody4165
Posts: 476
Joined: Monday 14 March 2016 13:55
Target OS: Linux
Domoticz version: beta
Location: Rome, Italy
Contact:

Re: Irrigation with multiple zones

Post by woody4165 »

Thanks Egregius

got the json to update uservariable.
I'm not good in bash, how can I get if a previous curl, updating a switch via json, was ok or not?
I see that it return
{
"status" : "OK",
"title" : "SwitchLight"
}
if it's ok
and
{
"status" : "ERR",
}
if not ok.

What should I check?

My actual curl command is

Code: Select all

curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=switchlight&idx=$IDX_ZONE1&switchcmd=On" > /dev/null
Thanks
Cubietruck - Linux cubietruck 4.13.16 (Debian GNU/Linux 8 (jessie)) + Domoticz + RFLink, Xiaomi Gateway, Owl USB, Yeelight Color and B/W, ESP8266, Broadlink RM2, Netatmo Thermostat
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Irrigation with multiple zones

Post by Egregius »

In http://www.domoticz.com/forum/viewtopic ... 780#p83346 I check the OK status and there's also a if statement.
woody4165
Posts: 476
Joined: Monday 14 March 2016 13:55
Target OS: Linux
Domoticz version: beta
Location: Rome, Italy
Contact:

Re: Irrigation with multiple zones

Post by woody4165 »

Nice. I will take a look in the afternoon!
Cubietruck - Linux cubietruck 4.13.16 (Debian GNU/Linux 8 (jessie)) + Domoticz + RFLink, Xiaomi Gateway, Owl USB, Yeelight Color and B/W, ESP8266, Broadlink RM2, Netatmo Thermostat
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest