Update temp set value on android app using domoticz's API

Moderator: leecollings

Post Reply
saroten
Posts: 1
Joined: Thursday 14 January 2016 9:17
Target OS: Linux
Domoticz version:
Contact:

Update temp set value on android app using domoticz's API

Post by saroten »

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&param=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&param=udevice&idx=4&nvalue=0&svalue=" + newTemp;
    $.getJSON(jurl,
    {
        format: "json"
    },
    function (data) {
        alert("test");
        if (data.status = "OK") {
            showData();
        }
    });
When i click on the button to change the temperature, the alert doesn't show up.
SweetPants

Re: Update temp set value on android app using domoticz's AP

Post by SweetPants »

shouldn't svalue be a string?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest