Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Hive IFTTT

  • 18-11-2017 10:37pm
    #1
    Registered Users, Registered Users 2 Posts: 3,409 ✭✭✭


    So moving to home and I'm a bit skeptical of the connection, google support guy swears they have hive support but I was going to mess with IFTTT in the mean time.

    Turns out their IFTTT isn't amazing, basically boost in two zones is all I use and you can't do that effectively.

    Looking to boost the zones separately and to different temps.

    Anyone have any experience?


Comments

  • Registered Users, Registered Users 2 Posts: 266 ✭✭SemperFidelis


    I believe the home suppport for hive is for their bulbs and plugs not the thermostat


  • Registered Users, Registered Users 2 Posts: 3,060 ✭✭✭thecivvie


    I don't know if it will do what you need but look at Stringify. I am only new to it and to all this house automation

    Join Ireland Weather Network




  • Registered Users, Registered Users 2 Posts: 3,409 ✭✭✭randombar


    Ya I said the same to google support, we'll see this evening.

    Thinking at this stage I might just write the code for the boosts and get ifttt to run the script.


  • Registered Users, Registered Users 2 Posts: 266 ✭✭SemperFidelis


    Sounds like a plan. Don't forget to share the code here if you get it working.


  • Registered Users, Registered Users 2 Posts: 3,409 ✭✭✭randombar


    Sounds like a plan. Don't forget to share the code here if you get it working.

    Sooooooo you have to get the session Id first from this one

    [PHP]

    <?php

    // Get cURL resource
    $ch = curl_init();

    // Set url
    curl_setopt($ch, CURLOPT_URL, 'https://api-prod.bgchprod.info:443/omnia/auth/sessions');

    // Set method
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');

    // Set options
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

    // Set headers
    curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Accept: application/vnd.alertme.zoo-6.1+json",
    "X-Omnia-Client: Hive Web Dashboard",
    "Content-Type: application/vnd.alertme.zoo-6.1+json",
    ]
    );
    // Create body
    $body = '{
        \"sessions\": [{
            \"username\": \"xxxxxxxxxxxxxxxxxx\",
            \"password\": \"xxxxxxxxxxxxxxxxxx\",
            \"caller\": \"WEB\"
        }]
    }
    ';

    // Set body
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $body);

    // Send the request & save response to $resp
    $resp = curl_exec($ch);

    if(!$resp) {
    die('Error: "' . curl_error($ch) . '" - Code: ' . curl_errno($ch));
    } else {
    echo "Response HTTP Status Code : " . curl_getinfo($ch, CURLINFO_HTTP_CODE);
    echo "\nResponse HTTP Body : " . $resp;
    }

    // Close request to clear up some resources
    curl_close($ch);




    [/PHP]

    And then use that Id as well as the nodeId (gotten from the hive web app url

    [PHP]

    <?php

    // Get cURL resource
    $ch = curl_init();

    // Set url
    curl_setopt($ch, CURLOPT_URL, 'https://api-prod.bgchprod.info:443/omnia/nodes/xxxxxxxxxxxxxxxxxxxxxxxx');

    // Set method
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');

    // Set options
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

    // Set headers
    curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "X-Omnia-Access-Token: xxxxxxxxxxxxxxxxxxxxxxxx",
    "X-Omnia-Client: Hive Web Dashboard",
    "Content-Type: application/vnd.alertme.zoo-6.1+json",
    "Accept: application/vnd.alertme.zoo-6.1+json",
    ]
    );
    // Create body
    $body = '{
        \"nodes\": [{
            \"attributes\": {
                \"activeHeatCoolMode\": {
                    \"targetValue\": \"BOOST\"
                },
                \"scheduleLockDuration\": {
                    \"targetValue\": 30
                },
                \"targetHeatTemperature\": {
                    \"targetValue\": 20
                }
            }
        }]
    }
    ';

    // Set body
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $body);

    // Send the request & save response to $resp
    $resp = curl_exec($ch);

    if(!$resp) {
    die('Error: "' . curl_error($ch) . '" - Code: ' . curl_errno($ch));
    } else {
    echo "Response HTTP Status Code : " . curl_getinfo($ch, CURLINFO_HTTP_CODE);
    echo "\nResponse HTTP Body : " . $resp;
    }

    // Close request to clear up some resources
    curl_close($ch);




    [/PHP]


  • Advertisement
Advertisement