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

All kinds of 'OS' scripts

Moderator: leecollings

Post Reply
tonywk
Posts: 8
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 »

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 7500 times
SweetPants

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

Post by SweetPants »

Have you put the command between single quotes already?
tonywk
Posts: 8
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 »

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

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

Post by SweetPants »

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: 8
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 »

yes, it is working now.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest