Hi,
I tried now the following command:
sudo curl --data ‘state=true’ --user"user:password" http://XXX.XXX.XXX.XXX:8080/api/devices/relais1/changeStateTo
I get now the message
Cannot POST /api/devices/relais1/changeStateTo
The configuration of the switch looks like that:
{“device”:
{“id”:“relais1”,
“name”:“Relais1”,
“template”:“switch”,
“attributes”:[
{“description”:“The current state of the switch”,
“type”:“boolean”,
“labels”:[“on”,“off”],
“label”:“State”,
“discrete”:true,
“name”:“state”,
“value”:false,
“history”:[
{“t”:1485723808913,
“v”:false},
{“t”:1485724026009,
“v”:false},
{“t”:1485779324396,
“v”:true},
{“t”:1485779326678,
“v”:false}],
“lastUpdate”:1485779326678}],
“actions”:[
{“description”:“Turns the switch on”,
“name”:“turnOn”},
{“description”:“Turns the switch off”,
“name”:“turnOff”},
{“description”:“Changes the switch to on or off”,
“params”:{
“state”:{“type”:“boolean”}
},
“name”:“changeStateTo”},
{“description”:“Toggle the state of the switch”,
“name”:“toggle”},
{“description”:“Returns the current state of the switch”,
“returns”:{
“state”:{“type”:“boolean”}
},
“name”:“getState”}],
“config”:{
“gpio”:19,
“id”:“relais1”,
“name”:“Relais1”,
“class”:“GpioSwitch”,
“inverted”:true},
“configDefaults”:{
“inverted”:false}},
“success”:true}
Hope somebody can help.
Thanks in advanced,
Jodi