Update temp set value on android app using domoticz's API
Posted: Thursday 14 January 2016 9:41
Hi, I'm making an application for android from where i'll be able to check my sensors and i would like to add something to regulate the temp set value.
In order to create this app i'm using html, javascript/jQuery-mobile,css. The issue is that it works in the navigator on the computer but not in the application. I'm using this url to update the value : /json.htm?type=command¶m=udevice&idx=IDX&nvalue=0&svalue=TEMP. Here is the javascript :
When i click on the button to change the temperature, the alert doesn't show up.
In order to create this app i'm using html, javascript/jQuery-mobile,css. The issue is that it works in the navigator on the computer but not in the application. I'm using this url to update the value : /json.htm?type=command¶m=udevice&idx=IDX&nvalue=0&svalue=TEMP. Here is the javascript :
Code: Select all
var newTemp = eval(Number($('#1 p').text()) + operator + 0.5);
var jurl = $.domoticzurl + "/json.htm?type=command¶m=udevice&idx=4&nvalue=0&svalue=" + newTemp;
$.getJSON(jurl,
{
format: "json"
},
function (data) {
alert("test");
if (data.status = "OK") {
showData();
}
});