It is currently September 21st, 2020, 1:34 pm

Nest Thermostat Meter [Updated 12/28/17]

Post your work-in-progress and completed skins to share and discuss.
ObsidianX
Posts: 5
Joined: November 6th, 2017, 9:24 am

Nest Thermostat Meter [Updated 12/28/17]

Post by ObsidianX »

Hey folks!

I was surprised to find that this wonderful application didn't have a Nest Thermostat meter so I whipped one up! There's more that I would like to add to make this a complete Nest frontend but it's a great monitor in its current form.

Screenshot:
Image


Download:
https://github.com/ObsidianX/rainmeter-nest-thermostat/releases/download/0.5.2/Nest.Thermostat_0.5.2.rmskin


Source code:

GitHub:
https://github.com/ObsidianX/rainmeter-nest-thermostat
https://github.com/ObsidianX/csharp-web-eventsource

Usage:
After installing and loading the skin click the Lock icon to authorize the plugin with your Nest account. There will be a PIN dialog for you to enter the generated authorization PIN. If you're part of a family account the primary account holder will need to sign in.


I'm planning on adding temperature up/down buttons and a drop-down to select the HVAC mode (heat/cool/off) but haven't had time just yet. If you encounter any issues please leave a bug report on the GitHub project page, and feel free to submit patches!


Enjoy!
Last edited by ObsidianX on December 29th, 2017, 12:50 am, edited 2 times in total.
User avatar
tjhrulz
Developer
Posts: 252
Joined: October 13th, 2016, 1:28 am
Location: Earth

Re: Nest Thermostat Meter

Post by tjhrulz »

I dont own a nest but this is awesome. Looking forward to see you add control support in the future.

Also a readme on the github and some documentation for the plugin would be cool :P and once you do that be sure to post the plugin in https://forum.rainmeter.net/viewforum.php?f=18 because we dont have enough cool plugins for Rainmeter.
shoek
Posts: 19
Joined: March 10th, 2017, 1:47 am

Re: Nest Thermostat Meter

Post by shoek »

This is great!
Unfortunately, I can't get past the login with the auth key from NEST

Code: Select all

System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)
File name: 'Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' ---> System.IO.FileLoadException: A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)
   at ObsidianX.Rainmeter.Nest.NestPlugin.<FetchAuthToken>d__49.MoveNext()

Does the Newtonsoft.Json plugin have to also be in the GAC?

I'm curious if you have thought about supporting multiple NEST's? I have 2 on my account and would like to see them both :)

Cheers!
ObsidianX
Posts: 5
Joined: November 6th, 2017, 9:24 am

Re: Nest Thermostat Meter

Post by ObsidianX »

shoek wrote:

Code: Select all

System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)
File name: 'Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' ---> System.IO.FileLoadException: A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)
 at ObsidianX.Rainmeter.Nest.NestPlugin.<FetchAuthToken>d__49.MoveNext()
D'oh! I included Newtonsoft.Json in the .rmskin which should have installed it... If you open the Plugins directory at %APPDATA%\Rainmeter\Plugins does it show up there? You should see ObsidianX.Rainmeter.Nest.dll, ObsidianX.Web.EventSource.dll and Newtonsoft.Json.dll

Edit: Just to confirm, it's not in my GAC and it should be sufficient to install it to the Plugins directory.
ObsidianX
Posts: 5
Joined: November 6th, 2017, 9:24 am

Re: Nest Thermostat Meter

Post by ObsidianX »

shoek wrote: I'm curious if you have thought about supporting multiple NEST's? I have 2 on my account and would like to see them both :)
Sure! I'm just selecting the first thermostat returned by the API at the moment so it'll be relatively simple to provide an extra option so you can select one yourself.
User avatar
tjhrulz
Developer
Posts: 252
Joined: October 13th, 2016, 1:28 am
Location: Earth

Re: Nest Thermostat Meter

Post by tjhrulz »

ObsidianX wrote:D'oh! I included Newtonsoft.Json in the .rmskin which should have installed it... If you open the Plugins directory at %APPDATA%\Rainmeter\Plugins does it show up there? You should see ObsidianX.Rainmeter.Nest.dll, ObsidianX.Web.EventSource.dll and Newtonsoft.Json.dll

Edit: Just to confirm, it's not in my GAC and it should be sufficient to install it to the Plugins directory.

When I get a change I am gonna make a PR so that you can have it just be merged into one .dll file using ilmerge. Makes it much easier for users when making Rainmeter plugins, and makes it a little nicer to debug IMO.

Edit: Sent a PR your way.
Last edited by tjhrulz on November 7th, 2017, 8:09 pm, edited 1 time in total.
shoek
Posts: 19
Joined: March 10th, 2017, 1:47 am

Re: Nest Thermostat Meter

Post by shoek »

ObsidianX wrote:D'oh! I included Newtonsoft.Json in the .rmskin which should have installed it... If you open the Plugins directory at %APPDATA%\Rainmeter\Plugins does it show up there? You should see ObsidianX.Rainmeter.Nest.dll, ObsidianX.Web.EventSource.dll and Newtonsoft.Json.dll

Edit: Just to confirm, it's not in my GAC and it should be sufficient to install it to the Plugins directory.
Yes I do see Newtonsoft listed in my Plugins tab, but no version is displayed for it like the others.
bandidom9
Posts: 2
Joined: December 1st, 2017, 12:52 am

Re: Nest Thermostat Meter

Post by bandidom9 »

Im having the same issue

Code: Select all

System.IO.FileLoadException: A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)
   at ObsidianX.Rainmeter.Nest.NestPlugin.<FetchAuthToken>d__49.MoveNext()
   at System.Runtime.CompilerServices.AsyncVoidMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   at ObsidianX.Rainmeter.Nest.NestPlugin.FetchAuthToken(String pin)
   at ObsidianX.Rainmeter.Nest.NestPlugin.<>c__DisplayClass48_0.<ShowPinDialog>b__0(Object s, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
springs
Posts: 1
Joined: December 9th, 2017, 11:23 am

Re: Nest Thermostat Meter

Post by springs »

hi, is it possible to change the temp from *F to *C?
ObsidianX
Posts: 5
Joined: November 6th, 2017, 9:24 am

Re: Nest Thermostat Meter [Updated 12/28/17]

Post by ObsidianX »

Uploaded 0.5.1 which uses tjhrulz's ILMerge patch. I've also updated the csproj to automatically run DllExport after merging to produce a working DLL without needing to run clunky batch files manually ;) Thanks, tjhrulz!

Also, my apologies for the delay in updating this. I haven't had any time to work on this since I originally published it!