How to use curl in bash with domoticz API to control switch Topic is solved

All kinds of 'OS' scripts
Post Reply
tonywk
Posts: 5
Joined: Tuesday 13 June 2017 10:28
Target OS: -
Domoticz version:
Contact:

How to use curl in bash with domoticz API to control switch

Post by tonywk » Thursday 13 July 2017 15:13

I have setup a switch in domoticz and want to use curl in a bash file with domoticz API to control switch. bash command is this:

curl http://192.168.1.205:8080/json.htm?type=command&param=switchlight&idx=134&switchcmd=On

the domoticz API: http://192.168.1.205:8080/json.htm?type=command&param=switchlight&idx=134&switchcmd=On
has been tested successfully in web browser, but once I try just type the curl command as above in terminal, below error appears

Can you help me with it? Thanks!
新建图片2.jpg
新建图片2.jpg (41.72 KiB) Viewed 637 times

SweetPants
Posts: 1514
Joined: Friday 12 July 2013 21:24
Target OS: Linux
Domoticz version: V3.8590
Location: The Netherlands
Contact:

Re: How to use curl in bash with domoticz API to control switch

Post by SweetPants » Thursday 13 July 2017 16:13

Have you put the command between single quotes already?

tonywk
Posts: 5
Joined: Tuesday 13 June 2017 10:28
Target OS: -
Domoticz version:
Contact:

Re: How to use curl in bash with domoticz API to control switch

Post by tonywk » Thursday 13 July 2017 17:39

No I didn't. That is it! A tiny thing took me hours yet to figure out, Thanks!

SweetPants
Posts: 1514
Joined: Friday 12 July 2013 21:24
Target OS: Linux
Domoticz version: V3.8590
Location: The Netherlands
Contact:

Re: How to use curl in bash with domoticz API to control switch

Post by SweetPants » Friday 14 July 2017 15:25

tonywk wrote:No I didn't. That is it! A tiny thing took me hours yet to figure out, Thanks!
Can you mark this solved?

tonywk
Posts: 5
Joined: Tuesday 13 June 2017 10:28
Target OS: -
Domoticz version:
Contact:

Re: How to use curl in bash with domoticz API to control switch

Post by tonywk » Monday 17 July 2017 6:59

yes, it is working now.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest