Announcement

Collapse
No announcement yet.

Hoping someone can help me

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Hoping someone can help me

    How do I setup my json to just use the cool setpoint for my three thermostats below within my json? reason for doing so is homebridge/Siri will only control one set point(my cool set point) so I figure if I link cool and heat set points to each other within homeseer than this should work however I don't know how to edit my json below to just use the cool set point. I tried posting this in the HomeKit thread but its not a very active and helpful thread as know one helps. Appreciate your help in advance.

    My Json for thermostats is the following:

    "type": "Thermostat",
    "name": "Basement Thermostat",
    "temperatureUnit": "F",
    "setPointReadOnly": false,
    "uuid_base": "Thermostat62",
    "ref": 65,
    "stateRef": 68,
    "controlRef": 68,
    "stateOffValues": [
    0
    ],
    "controlOffValue": 0,
    "stateHeatValues": [
    1
    ],
    "controlHeatValue": 1,
    "stateCoolValues": [
    2
    ],
    "controlCoolValue": 2,
    "stateAutoValues": [
    3
    ],
    "controlAutoValue": 3,
    "setPointRef": 71
    },
    {
    "type": "Thermostat",
    "name": "First Floor Thermostat",
    "temperatureUnit": "F",
    "setPointReadOnly": false,
    "uuid_base": "Thermostat36",
    "ref": 39,
    "stateRef": 42,
    "controlRef": 42,
    "stateOffValues": [
    0
    ],
    "controlOffValue": 0,
    "stateHeatValues": [
    1
    ],
    "controlHeatValue": 1,
    "stateCoolValues": [
    2
    ],
    "controlCoolValue": 2,
    "stateAutoValues": [
    3
    ],
    "controlAutoValue": 3,
    "setPointRef": 45
    },
    {
    "type": "Thermostat",
    "name": "Second Floor Thermostat",
    "temperatureUnit": "F",
    "setPointReadOnly": false,
    "uuid_base": "Thermostat11",
    "ref": 14,
    "stateRef": 17,
    "controlRef": 17,
    "stateOffValues": [
    0
    ],
    "controlOffValue": 0,
    "stateHeatValues": [
    1
    ],
    "controlHeatValue": 1,
    "stateCoolValues": [
    2
    ],
    "controlCoolValue": 2,
    "stateAutoValues": [
    3
    ],
    "controlAutoValue": 3,
    "setPointRef": 20

    #2
    I'm Not sure if this is what you want

    Hey,

    I use JSON between HS3 and web based raspberrypi's.

    The pi's display a simple web page on a 7" touch screen. When you touch the on button it sends a post command to HS3 via the JSON interface.

    This is a POST sample. I'm having issues with the GET function.

    //set map api url
    $url = "http://192.168.1.nnn/JSON";
    $data = array("user" => "username", "pass" => "password", "action" => "runevent", "group" => $arg1, "name" => $arg2);
    $data_string = json_encode($data);
    // Initiate cURL
    $ch = curl_init($url);
    // Tell cURL we want to send a POST request
    curl_setopt($ch, CURLOPT_POST, 1);
    // Atach our encoded JSON string to the POST fields
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
    // Set the content type to application/json
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
    // Transfer to a string
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    // Execute the request
    $result = curl_exec($ch);
    // Close cURL
    curl_close($ch);
    echo $result;

    If you look in the scripting of HS3 help there is some good stuff on using JSON.

    As for the GET function of JSON

    //set map api url
    $url = "http://192.168.1.nnn/json?user=user&pass=password&request=getstatus&ref=381";

    //call api
    $json = file_get_contents($url);
    // decode the json string
    $json = json_decode($json);
    echo $json;

    But I'm having issues getting the return data from HS3 to parse. If you come up with something let me know.

    Good Luck

    Comment


      #3
      yeah my json knowledge is limited. I used a windows app to create my json above

      Comment

      Working...
      X