more G-Labs products

Author Topic: Firebase support for Nest Thermostat  (Read 4680 times)

August 18, 2015, 09:23:36 PM
Read 4680 times

saue0

  • **
  • Information
  • Jr. Member
  • Posts: 40
Hi,
Can someone with more experience with .net add the support for the Firebase component so that we can add the Nest thermostat to the system , the basic rest request is not valid , because google dos not allow pooling of the device every second, the ask to use the firebase framework with the sreaming support...

Thanks

December 02, 2015, 12:53:02 PM
Reply #1

[email protected]

  • *****
  • Information
  • Hero Member
  • Posts: 271
I'm looking at implementing something for the Nest Thermostat.

I'm knocking something up at the moment to try and deal with the OAuth reqd - prob going to be a little bit of a manual process to set this up though, but the token is valid for ten years :)

At the moment I only require setting home or away functionality but I will see if I can do it using firebasesharp  I suspect I'm going to need to extend homegenie for this, but first things first is get a working console app :)


December 08, 2015, 05:41:27 PM
Reply #2

[email protected]

  • *****
  • Information
  • Hero Member
  • Posts: 271
I've got code working that will get thermostats, structures and set the home or away status at the moment.

At the moment it doesn't use the streaming API as I haven't managed to get it to work xplatform where as this code does.. at the moment its just a console app, I will look to download the solution for homegenie and convert it to be a plugin next... if you were wanting a fancy widget then your out of luck at the moment :) - unless someone wants to create that side.

Code isn't perfect as I'm not a developer - more used to scripting, so OO programing is foreign to me ;)

Further updates when I get chance.

January 02, 2016, 07:40:06 AM
Reply #3

sd0wden

  • *
  • Information
  • Newbie
  • Posts: 5

January 11, 2016, 11:04:44 PM
Reply #4

cmptrblder

  • *
  • Information
  • Newbie
  • Posts: 12
Following thread as well, HomeGenie is an amazing home automation package but for some reason there is no NEST support.  I've noticed no NEST support in some other open source software's as well with the exception of OpenHAB.  Unfortunately, OpenHab doesn't support X10 directly thru the X10 USB or Serial interfaces, just thru the Insteon PLM.  Is there an issue with NEST that people just don't want to bother with?

Even the gentleman in this thread that's trying to get it to work says its pretty limited as far as what he's working on.  I'm just wondering as NEST is on there third generation thermostat but yet HomeGenie covers TONS of newer hardware and even the good ole X10.

As far as the gentleman in this thread, if your working on one, THANK YOU and please keep us updated.

January 12, 2016, 12:31:05 AM
Reply #5

saue0

  • **
  • Information
  • Jr. Member
  • Posts: 40
The problem is that the nest use REST streaming.
Normal rest request is possible but is limited in number of request.
Google wants us to use the firebase connection witch will allow us to get instant feedback on value change from the Nest. but Firebase is not implemented in HG, It is implemented for a web javascript. or Node server.
If sowe one is able to implement it in Node server so that  it can fire API call to HG, it might be a solution

January 12, 2016, 06:30:26 AM
Reply #6

cmptrblder

  • *
  • Information
  • Newbie
  • Posts: 12
Thanks for the input, its starting to look like nest is a pain in the arse.....:(

January 12, 2016, 03:23:49 PM
Reply #7

[email protected]

  • *****
  • Information
  • Hero Member
  • Posts: 271
I have got the rest API working and able to control my Away Status.

I also have a fire-base test application working at the moment, but i need to do a bit more work on how I deal with the events being returned.

I then need to see if these will port to linux, they should work fine on windows though..

January 13, 2016, 12:36:47 AM
Reply #8

cmptrblder

  • *
  • Information
  • Newbie
  • Posts: 12
Thanks for the work your doing, without the help of folks like yourself, I'm sure alot of opensource stuff including HomeGenie wouldn't be available so thank you.

January 23, 2016, 05:17:45 AM
Reply #9

saue0

  • **
  • Information
  • Jr. Member
  • Posts: 40
I am currently creating a node.js module using the firebase.js component.
I am able to get the Nest data.

Question: How can i send the json data to HomeGenie ? I created a c# script, but dont seam to find how to get the body of the http api call i made..

January 23, 2016, 05:45:13 AM
Reply #10

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Hi saue0,

what is the URL of the API call?
And what the response looks like?
I'll show you the code to use.

Cheers,
g.

January 23, 2016, 06:20:30 AM
Reply #11

saue0

  • **
  • Information
  • Jr. Member
  • Posts: 40
The data i need to sent to HomeGenie is a json structure of the Nest data.

This is what the api call look like

http://homegenie.ip/api/HomeAutomation.Nest/Data/

I creaated a Nest script.
I am able to call the api. but do not now how to send json

January 23, 2016, 06:24:00 AM
Reply #12

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Please give complete details with example json objects used for request and response.

g.

January 23, 2016, 06:52:55 AM
Reply #13

saue0

  • **
  • Information
  • Jr. Member
  • Posts: 40
I use a external application to communicate with the Nest thermostat ( Node.js and FireBase.js)
When the Thermostat temperature is change, the FireBase component get a json response from the Nest.
(see attachment for json structure)

I need to pass this json to Homegenie to be able to adjust the thermostat module
I do not want HomeGenie to poll my external application. (witch can be a solution)

at the same time that i am writing these line, I thing i have fond a workaround....
I will write the json to file, then call homegenie api with the file name as a parameter.


January 23, 2016, 07:06:53 AM
Reply #14

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
So what you need is registering an API call in your HG progam.
For example:

Code: [Select]
When.WebServiceCallRecevied("HomeAutomation.NestLink/Update", (jsonData) =>
{
    dynamic data = JsonConvert.DeserializeObject(jsonData);
    // use the data object....
    MigService.Log.Debug(data);
    // just an example, echoes back cameras object as response
    return data.devices.cameras;
});

so then you can call from your external app the url /api/HomeAutomation.NestLink/Update using POST method to post the json response.

g.