PDA

View Full Version : Can Girder control a Nest thermostat?



jndreu
January 3rd, 2015, 02:04 PM
I want to put in a Nest thermostat but I need to be able to control it from Girder to meet my home automation needs. Controlling the Nest through the Nest iPhone app is not good enough.

Does anyone know if/how I can do this? I'm using G5.

Thanks!

jon1977
January 4th, 2015, 09:18 AM
id say according to this:
https://developer.nest.com/documentation/api-reference
and similar pages
it almost certainly could with a bit of lua
jon.

jon1977
January 4th, 2015, 09:19 AM
and this as some reading
https://developer.nest.com/documentation
jon

jndreu
January 4th, 2015, 02:05 PM
Thanks for the info... I figured it could with some custom lua coding however I am definitely not a developer and was hoping there would be some sort of "plugin" that exists already... I guess there is no such thing? This would be a really cool integration but unfortunately I don't have the programming skills to do this :-(

jon1977
January 5th, 2015, 01:07 AM
I use the heatmiser 12v prtn thermostats which I've written custom code to integrate into my home automation system.
Would they suit?
They do need to be wired via rs485 to the pc rather than via wifi though, so are more difficult to retro fit.
I added one to each room during my house renovation, with fully zoned ufch.
Jon.

jndreu
January 5th, 2015, 11:15 AM
I currently use an Insteon thermostat and control it via Mike's Insteon PLM component. It works very well and I really don't have any complaints, however with the Nest, assuming I could have the same level of control from girder, I see the following benefits:

1) It looks so much nicer

2) My utility provider supports the Nest "seasonal savings" and "rush hour rewards" programs:
https://nest.com/ca/support/article/What-is-Seasonal-Savings
https://nest.com/ca/support/article/What-is-Rush-Hour-Rewards

3) Although I have a good schedule already programmed and have the ability to remotely control the Insteon thermostat, Nest adds additional automatic intelligence. I've already programmed some additional intelligence into my Insteon thermostat via girder (like to shut off my A/C for 10min every hour on very hot days to prevent the coils from freezing due to the possibility of continuous operation) but it will never be at the level of what Nest can offer. And if I had both options, I'd have even more flexibility and control.

4) Nest has greatly expanded their ecosystem of "works with Nest" partners - for example a Kevo smart lock can now tell the Nest to turn down the temperature when you leave your house

5) It looks so much nicer (wait I said that already lol)

The reason I really want remote control from Girder so much is that I have a couple of instances of NetRemote running on touchscreens in my house that allow me to adjust the thermostat - think watching a movie in your home theater and want to change the room temperature without having to go upstairs. Nest does have an iPhone app, however you don't always have that in your pocket when you are in your house so the Girder/NetRemote control is ideal in this specific use case.

Insteon currently supports control of the Nest through their Hub product and in a separate post I've asked Mike to look into the possibility of adding support for the hub into his PLM... but I was just wondering if there was any other "direct" way of controlling a Nest through Girder...

jndreu
January 8th, 2015, 07:42 AM
...So I take it there is no easy way to do this then, without signing up for the Nest developer program and writing my own lua code in Girder?

Ron
January 8th, 2015, 09:44 AM
Girder 6 has Nest control built in...

jndreu
January 8th, 2015, 12:31 PM
Girder 6 has Nest control built in...

Ron, for many reasons (but mainly due to my huge dependence upon Mike's Insteon PLM component) I need to stick with Girder 5 for the foreseeable future. Is there a way to do this in G5?

Ron
January 8th, 2015, 12:55 PM
short of integrating the nest api yourself I'm afraid for Girder 5 there is no way.

jndreu
January 8th, 2015, 01:13 PM
short of integrating the nest api yourself I'm afraid for Girder 5 there is no way.

Ok thanks... That's too bad though... I completely understand why development is now focused on G6 but it's unfortunate because I think there are still many users like myself who are still using G5 for various reasons.

Ron
January 8th, 2015, 01:19 PM
Yes sorry, at least Girder 5 takes plugins and lua scripted extensions at least things can still be added!

jndreu
January 8th, 2015, 05:20 PM
short of integrating the nest api yourself I'm afraid for Girder 5 there is no way.

Ron, just a thought but would there be a way of firing up an instance of G6 to speak to a Nest and have it communicate in some way with my existing G5 WHP setup? Maybe by passing events or something? Just trying to think a bit outside of the box a bit... The other reason why I cannot move to G6 is because I also use NetRemote extensively...

jndreu
January 9th, 2015, 05:57 PM
Ron can G5 send events or any sort of communication to G6? What I'm thinking I could do as a sort of messy workaround is to have G5 fire off various events to G6... for which G6 would then have associated actions to change temperature, mode, etc. on the Nest thermostat... would this be possible?

Ron
January 9th, 2015, 07:39 PM
You can send events to Girder via the G6 webserver.... <girderip>/triggerEvent.lhtml

jndreu
January 9th, 2015, 08:35 PM
You can send events to Girder via the G6 webserver.... <girderip>/triggerEvent.lhtml

Thanks Ron! I'll give that a try. One last question - can I have instances of both G5 and G6 running on the same box or would that create some conflicts and I should separate them onto two different PCs?

Ron
January 10th, 2015, 07:53 AM
Should be OK. Just make sure if you run the webserver in both G5 and G6 that you use different port numbers.

jndreu
January 11th, 2015, 09:56 AM
You can send events to Girder via the G6 webserver.... <girderip>/triggerEvent.lhtml

Hi Ron,

This is probably a really dumb question but my lack of programming skills are to blame :-).....

I was able to create a script action in G6 as a test with the following lines using code examples from the manual:

src="<G6 ip>/triggerEvent.lhtml"
gir.triggerEvent('test', 18);

..and when I run that action, in the G6 logger I see that the action was triggered and the message "test" is printed. So that is working.

So I assumed I could do the same in G5 using the G6 ip address and it would work but it does not. Could you kindly dumb this down for me a bit? What do I need to do on the G5 server to trigger an event on the G6 server? What specific code do I need to put in a scripting action in G5?

Also if I want to trigger an event from G6 back to G5 so I can have bi-directional "event" communication, what specific script action code do I need to use on the G6 side?

Thank you in advance for your help!

jndreu
January 14th, 2015, 05:08 PM
Ron or anyone... can you help with the above code to get events going back and forth via the G5 and G6 webservers?

Ron
January 15th, 2015, 07:15 AM
in Girder 5 try this code:



win.URLDownloadToMemory("http://<GIRDER6IP>/gir/triggerEvent.lhtml?es=TEST&ed=18")

jndreu
January 19th, 2015, 01:20 PM
in Girder 5 try this code:



win.URLDownloadToMemory("http://<GIRDER6IP>/gir/triggerEvent.lhtml?es=TEST&ed=18")


Ron that code works great for sending events from G5 to G6.. thanks for that. Now my question is, how do I send events in the other direction from G6 to G5?

jndreu
January 19th, 2015, 07:18 PM
I'm not sure if this is the correct way to go about doing this but I found the "HTTP Request" action under the Network folder in G6... I've filled out the fields in that action as follows:

URL: <G5 webserver IP:port>
POST radio button is selected
Body: ajax_sendevent.lhtml?event=myG6event&device=18


Nothing is showing up in the G5 webserver.... am I missing something or is there a better way to do this? I would also like to send a payload with the event...

jndreu
January 21st, 2015, 12:53 PM
Hi Ron or anyone else... could you please help me to figure out how to send a message from G6 to trigger an event in G5 via the G5 webserver?

Ron
January 21st, 2015, 01:47 PM
HTTP Request action:

URL: http://GIRDER5_IP:GIRDER5_PORT/ajax_sendevent.lhtml?event=hello&device=18
Username:
Password:
GET CHECKED
No body text
No Mime type.

jndreu
January 21st, 2015, 03:18 PM
Thank you again!