--Anyone tried linking Fibaro api with command fusion?
Not able to carry out the first basic get command to turn on a relay.
http://192.168.1.5/api/callAction?deviceID=168&name=turnOff
I created a command and this is my command value
GET /api/callAction?deviceID=168&name=turnOn HTTP/1.0\x0D\x0AHOST: 192.168.1.5\x0D\x0A\Authorization: Basic YWRtaW46YWRtaW4=\x0D\x0A\x0D\x0A
command: http://i.imgur.com/bofS0mP.png
system properties: http://i.imgur.com/3u5zBHO.png
button properties: http://i.imgur.com/lXWMHLg.png
Don't know what is wrong. Can someone point me in the right direction?
You received this message because you are subscribed to the Google Groups "CommandFusion Software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to commandfusio...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Thanks Jarrod, removing the slash did it.
By the way, do you happen to have the sample project for fibaro?
I see that you have the js for feedback from the system.
So..I modified some things and got working the basic toggle functionality..here is the updated js
// Map a Fibaro device ID to a join number// The join number should be prefixed by the join type (a = analog, d = digital, s = serial, etc)var joinIDMap = {"168": "d1002","1": "a1015","45": "a1043","23": "a1008"};// Eg. doCommand("callAction", 168, "turnOn");// function doCommand(method, deviceId, speed) {// CF.request("http://192.168.1.5/api/"+method+"?deviceID="+deviceId+"&name=setValue&arg1="+speed, {"Authorization": "Basic YWRtaW46YWRtaW4="}, processResponse);// CF.log("Fibaro : to here");// }
function doCommand(method, deviceId) {CF.request("http://192.168.1.5/"+method+"/devices?ID="+deviceId, {"Authorization": "Basic YWRtaW46YWRtaW4="}, processResponse);}
// function doCommand(deviceId) {// CF.request("http://192.168.1.5/api/devices?"+deviceId, {"Authorization": "Basic YWRtaW46YWRtaW4="}, processResponse);// }function processResponse (status, headers, body) {if (status == 200) {var data = JSON.parse(body);CF.log("Request succeeded (HTTP 200 OK). Body received: " + body);var switchstatus = data.properties.valueswitch (switchstatus){case "true":CF.request("http://192.168.1.5/api/callAction?deviceID=168&name=turnOff", {"Authorization": "Basic YWRtaW46YWRtaW4="}, callback);CF.log("Fibaro : Command Send OK, Devices Returned: " + switchstatus);//CF.setJoin("d123", 0);break;case "false":CF.request("http://192.168.1.5/api/callAction?deviceID=168&name=turnOn", {"Authorization": "Basic YWRtaW46YWRtaW4="}, callback);CF.log("Fibaro : Command Send OK, Devices Returned: " + switchstatus);//CF.setJoin("d123", 1);}}else {CF.log("Fibaro : Command Send ERROR");}function callback(status, headers, body) {if (status == 202) {// extract information from body hereCF.log("Request succeeded (HTTP 200 OK). Body received: " + body);}else {// an error occurred, display the returned status codeCF.log("Error: returned status code " + status);}}};
As you can see, I tried to update the digital join of the button here but then commented the lines because it caused delay in execution of code. The lights were turning on and off after a short moment's gap. Can you please recommend the best way of updating the status at all times?
Pasting here the json array of the device..the value needed for feedback is xxxx.properties.value (you can find it using "value":"true")
{"id":168,"name":"COB 1","roomID":3,"type":"com.fibaro.binarySwitch","baseType":"com.fibaro.actor","enabled":true,"visible":true,"isPlugin":false,"parentId":167,"remoteGatewayId":0,"interfaces":["light","power","zwave","zwaveAssociation","zwaveConfiguration","zwaveFirmwareUpdate"],"properties":{"parameters":[{"id":1,"lastSetValue":255,"size":1,"value":255},{"id":3,"lastSetValue":0,"size":1,"value":0},{"id":4,"lastSetValue":0,"size":2,"value":0},{"id":5,"lastSetValue":0,"size":2,"value":0},{"id":6,"lastSetValue":0,"size":1,"value":0},{"id":7,"lastSetValue":0,"size":1,"value":0},{"id":13,"lastSetValue":0,"size":1,"value":0},{"id":14,"lastSetValue":1,"size":1,"value":1},{"id":15,"lastSetValue":0,"size":1,"value":0},{"id":16,"lastSetValue":1,"size":1,"value":1},{"id":30,"lastSetValue":0,"size":1,"value":0},{"id":31,"lastSetValue":0,"size":1,"value":0},{"id":32,"lastSetValue":0,"size":1,"value":0},{"id":33,"lastSetValue":0,"size":1,"value":0},{"id":39,"lastSetValue":600,"size":2,"value":600},{"id":40,"lastSetVa lue":0,"size":1,"value":0},{"id":41,"lastSetValue":0,"size":1,"value":0},{"id":42,"lastSetValue":0,"size":1,"value":0},{"id":43,"lastSetValue":0,"size":1,"value":0}],"associationSet":[{"devices":[1],"groupID":1},{"devices":[1],"groupID":2},{"devices":[1],"groupID":3}],"associationView":[{"devices":[1],"groupID":1},{"devices":[1],"groupID":2},{"devices":[1],"groupID":3}],"zwaveCompany":"Fibargroup","zwaveInfo":"3,3,42","zwaveVersion":"2.1","pollingTimeSec":0,"configured":"true","dead":"false","deviceControlType":"2","deviceIcon":"1","emailNotificationID":"0","emailNotificationType":"0","endPointId":"0","isLight":"true","liliOffCommand":"","liliOnCommand":"","log":"","logTemp":"","manufacturer":"","markAsDead":"false","model":"","nodeId":"17","parametersTemplate":"214","power":"9.00","powerConsumption":"9","productInfo":"1,15,2,0,16,10,2,1","pushNotificationID":"0","pushNotificationType":"0","remoteGatewayId":"0","saveLogs":"true","showEnergy":"true","smsNotificationID":"0","smsNotifica tionType":"0","useTemplate":"true","userDescription":"","value":"true"},"actions":{"associationGet":1,"associationSet":2,"getParameter":1,"reconfigure":0,"setParameter":2,"turnOff":0,"turnOn":0,"updateFirmware":1},"created":1428802979,"modified":1428802979,"sortOrder":6}
To unsubscribe from this group and stop receiving emails from it, send an email to commandfusion+unsubscribe@googlegroups.com.