When, from a external script (php/bash/etc) doing a:
curl ... 'http://sg53:8080/json.htm?type=command& ... tchcmd=Off'
allow idx to be replaced with name or hw or id.unit.
Would allow for the command to read param=switchlight&Name=Porch&....
tks
cURL inputs
Moderators: leecollings, remb0
-
- Posts: 659
- Joined: Thursday 10 November 2016 9:30
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: cURL inputs
Usually, only IDX are allowed...liderbug wrote: allow idx to be replaced with name
http://www.domoticz.com/forum/viewtopic ... 93#p117793
-
- Posts: 20
- Joined: Monday 02 January 2017 17:30
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: cURL inputs
OK, thanks for the response. From your responses I've worked out a soultion:
/domoticz $ MyOnOff Patio On
Code: Select all
[MyOnOff]
#!/bin/bash
id=`echo "select id from DeviceStatus where name = '$1';" | sqlite3 domoticz.db `
/usr/bin/curl "http://sg53:8080/json.htm?type=command¶m=switchlight&idx=$id&switchcmd=$2"
-
- Posts: 204
- Joined: Thursday 05 September 2013 15:39
- Target OS: Linux
- Domoticz version: LastBeta
- Contact:
Re: cURL inputs
Nice! I like this 
Thanks for sharing!

Thanks for sharing!
homebridge, rfxcom, zwave, nest, applamp, hue, debian, apple, mysensors, netatmo, fibaro, synology, foscam, otherz
Who is online
Users browsing this forum: No registered users and 1 guest