Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Hive IFTTT

  • 18-11-2017 09:37PM
    #1
    Registered Users, Registered Users 2 Posts: 3,486 ✭✭✭


    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: 263 ✭✭SemperFidelis


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


  • Registered Users, Registered Users 2 Posts: 3,261 ✭✭✭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,486 ✭✭✭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: 263 ✭✭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,486 ✭✭✭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