How do you control a Nexia thermostat with a SmartThings hub

Thank you for the Handler and App. I could not access the SmartApp from the device config - but as soon as I ran the simulator on the code the devices appeared and appear to be functioning. Did I miss something as far as accessing the SmartApp from the Android App device config?

I changed the line for authenticating token but continue to have issues logging in

def authenticityToken = loginResp.data[0].children[1].children[1].children[0].children[0].children[0].children[0].children[2].children[0].children[1].attributes()[“value”]
is the new line and editted into the smartthings script, but will not log in, i get the error

c00f8489-72fe-4789-b2b0-3b3969a3fd6c 5:58:38 PM: debug [name:debug, descriptionText:Thermostat Params: [uri:https://www.mynexia.com, path:null, headers:[Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8, Accept-Encoding:gzip, deflate, Accept-Language:en-US,en,q=0.8, Cache-Control:max-age=0, Connection:keep-alive, User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36, Cookie:locale=BAhJIgplbl9VUwY6BkVU–0edc07296637979ba240be07fd3ca03ebc5988b2; _SchlagePortal_session=dkNTRVpLOTZLcnZWSlZVMEdiRytDZzhYbzJhd2lVbWhQcVU3UjBac3pabWwvOHNySFRqMkhtL0kyMmJqWU16V2tZYlRIMUVoajI1Z1YrVkJLTFN3czNyRlk4LzBRQVdYOGZCTFAzb3NkTEhNNnBYeWZrQzhyRGJpN0hRQzkraTVVQVEvQW94U0V4YU9qdXZWZUtOM2wxbFRFRGlKTERhK2Q3UUlkRE9US0JpS2RtaFhpTCtSbnMxNjZTcW5lN2FTVytVSVVjWTgxMXhpSjNSRVd0THgrRk5Yais0TkpnTXc1eW9sWEgwSVFxamxUZDRsMHZtV1lCd3BJNVV2T3JIdjVIOWtEM3B5S0QzdGRVS1NSb0UwZE5ZUHBVNjdLSJVBQU1QZDRvMFJCemRvWDRnSE5SWXN5b0J5czYyV2kvd29vS2w5QkFCaUwzSnVPM3NDZUxNNlVqM2pTQU5XVUVFcXZpQndLL1lOOWNzWlQwdUNPa0N3S0VhMmdWbnVHRW1SeDFiOXhYeUpJaE1kM0h6TW1iNVFSTWZIMFIxaWIrRzJGcSs5T3paN3BnND0tLVRMUUlyaGlZMm00TWNEN0xnaG1VdWc9PQ%3D%3D–566dbe30e58d5422be7abacdaa7eaac17fe67673]], displayed:false]
c00f8489-72fe-4789-b2b0-303969a3fd6c 5:58:38 PM: error [name:error, descriptionText:Caught exception requesting thermostats: groovy.lang.MissingMethodException: No signature of method: script1477529665137853345437.getDeviceNetworkId() is applicable for argument types: (groovy.util.slurpersupport.NodeChildren) values: [], displayed:true]

Any ideas?

Thank you SO MUCH for this. I’ve been searching for this exact integration for ages.

To make this work, I had to do two modifications to the code:

  1. The modifications to change the authenticity token.

  2. Changing from Farenheight to Celcius. I tried changing all the references in the code for both the device and the smartapp and it works.

Everything now functions quite smoothly.

Hey just wanted to say thank you to trentfoley for writing the Nexia integration code. Just got this new thermostat today and after a couple of tries I got everything working. :slight_smile:

How do you apply this code? Where and how?

Thanks

I’m kind of new at this, but I’ve been able to get other device handlers and SmartApps added to my Smarthings.

I can’t seem to get this to work.

Added the device handler,
Added the smart App.

Made the AuthToken update.

Ran smartthings for Andriod.

I see the smartapp and can enter my nexia username and password.

But, No Things were created.

Below are the logs. What am I doing wrong.

Barry

5d433abc-a543-4076-b68a-d585404edf29 7:38:00 PM: debug [name:debug, descriptionText:Thermostat Params: [uri:https://www.mynexia.com, path:null, headers:[Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8, Accept-Encoding:gzip, deflate, Accept-Language:en-US,en,q=0.8, Cache-Control:max-age=0, Connection:keep-alive, User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36, Cookie:locale=BAhJIgplbl9VUwY6BkVU–0edc07296637979ba240be07fd3ca03ebc5988b2; _SchlagePortal_session=WW0wNys4YzdHZW5rOElhc3JwckZ6bzRzQVdxTnBSazVKRHVtR3lrdFFZRHJWcVAxNkplU2hwQjRYYVE3SVNHb3NYMnhRZEJUV2R2RlNUOUhGQXpoN3lPTFRiUkpzNjg0VW0yQTR2V2F3US9YRjJVNEtZYjhzZm1uT04rUUZkWXZPbW5XSTJWUUZaV21MSVJyS2VseVZmZEcrdXBOMm4rTTI0Uzh5MkdPTUFib2R6dWhTRXdzMUNQMUNhZ040UUZqQlpVMFV4cXNqcXRNdDlZOWUzNFhZZz09LS1lbm1DYjZreHptQW8wN3g0eHlDd013PT0%3D–a6c028800a460898774cedabcfec4ebf093499be]], displayed:false]
5d433abc-a543-4076-b68a-d585404edf29 7:38:00 PM: error [name:error, descriptionText:Caught exception requesting thermostats: groovy.lang.MissingMethodException: No signature of method: script14799478792931330073299.getDeviceNetworkId() is applicable for argument types: (groovy.util.slurpersupport.NodeChildren) values: [], displayed:true]
5d433abc-a543-4076-b68a-d585404edf29 7:38:00 PM: debug [name:debug, descriptionText:Found thermostat with ID: , displayed:false]
5d433abc-a543-4076-b68a-d585404edf29 7:37:59 PM: debug [name:debug, descriptionText:Nexia Home Request Parameters: [method:GET, uri:https://www.mynexia.com, headers:[Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8, Accept-Encoding:gzip, deflate, Accept-Language:en-US,en,q=0.8, Cache-Control:max-age=0, Connection:keep-alive, User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36, Cookie:locale=BAhJIgplbl9VUwY6BkVU–0edc07296637979ba240be07fd3ca03ebc5988b2; _SchlagePortal_session=WW0wNys4YzdHZW5rOElhc3JwckZ6bzRzQVdxTnBSazVKRHVtR3lrdFFZRHJWcVAxNkplU2hwQjRYYVE3SVNHb3NYMnhRZEJUV2R2RlNUOUhGQXpoN3lPTFRiUkpzNjg0VW0yQTR2V2F3US9YRjJVNEtZYjhzZm1uT04rUUZkWXZPbW5XSTJWUUZaV21MSVJyS2VseVZmZEcrdXBOMm4rTTI0Uzh5MkdPTUFib2R6dWhTRXdzMUNQMUNhZ040UUZqQlpVMFV4cXNqcXRNdDlZOWUzNFhZZz09LS1lbm1DYjZreHptQW8wN3g0eHlDd013PT0%3D–a6c028800a460898774cedabcfec4ebf093499be]], displayed:false]
5d433abc-a543-4076-b68a-d585404edf29 7:38:00 PM: debug [name:debug, descriptionText:requestThermostats(null), displayed:false]
5d433abc-a543-4076-b68a-d585404edf29 7:38:00 PM: error [name:error, descriptionText:Caught exception determining thermostats path: java.lang.NullPointerException: Cannot get property ‘children’ on null object, displayed:true]
5d433abc-a543-4076-b68a-d585404edf29 7:37:59 PM: debug [name:debug, descriptionText:Updating cookie: _SchlagePortal_session=WW0wNys4YzdHZW5rOElhc3JwckZ6bzRzQVdxTnBSazVKRHVtR3lrdFFZRHJWcVAxNkplU2hwQjRYYVE3SVNHb3NYMnhRZEJUV2R2RlNUOUhGQXpoN3lPTFRiUkpzNjg0VW0yQTR2V2F3US9YRjJVNEtZYjhzZm1uT04rUUZkWXZPbW5XSTJWUUZaV21MSVJyS2VseVZmZEcrdXBOMm4rTTI0Uzh5MkdPTUFib2R6dWhTRXdzMUNQMUNhZ040UUZqQlpVMFV4cXNqcXRNdDlZOWUzNFhZZz09LS1lbm1DYjZreHptQW8wN3g0eHlDd013PT0%3D–a6c028800a460898774cedabcfec4ebf093499be, displayed:false]
5d433abc-a543-4076-b68a-d585404edf29 7:37:59 PM: error [name:error, descriptionText:Caught exception refreshing auth token: java.lang.NullPointerException: Cannot get property ‘children’ on null object, displayed:true]
5d433abc-a543-4076-b68a-d585404edf29 7:37:59 PM: debug [name:debug, descriptionText:Login Params: [method:GET, uri:https://www.mynexia.com, path:/login, headers:[Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8, Accept-Encoding:gzip, deflate, Accept-Language:en-US,en,q=0.8, Cache-Control:max-age=0, Connection:keep-alive, User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36]], displayed:false]
5d433abc-a543-4076-b68a-d585404edf29 7:37:59 PM: debug [name:debug, descriptionText:Updating cookie: locale=BAhJIgplbl9VUwY6BkVU–0edc07296637979ba240be07fd3ca03ebc5988b2, displayed:false]
5d433abc-a543-4076-b68a-d585404edf29 7:37:59 PM: debug [name:debug, descriptionText:refreshAuthToken(), displayed:false]

Just wanted to give a big “Thank You” for making these and sharing with the community! :grinning:

Thanks a million !!!

Is it possible to add the “Right Now” or the Thermostats status in the main “Status” page? somewhere along with Security and Smoke?


thanks

Will this work with a comfortlink xl950? I’ve tried running this but no success. I’ve published the app but it doesn’t show up in my smartapps list. Thanks.

Thank you for the code Trentfoley. Is it possible that this app will also recognize the 2nd thermostart in the same account or 2nd zone?

All - I have a forked version of @trentfoley 's code in my repo that includes the current changes required to get the smartapp working after Nexia updated the website:

@jwiese997, YES it works with my xl950
@Barry_Basselgia, @Reddwarfusa this may fix your issue, you were both getting the same errors I was. Looks like Nexia updated the login dialog after the authtoken update.

(Note - if nexia is going to keep updating gthe page, we need a better way of scraping the webpages - anyone who’s good at parsing HTML with XMLslurper wanna help?)

-Nathan

(DISCLAIMER: I am NOT a coder, I just stayed at a Holiday Inn Express one night - read: I learned enough Groovy to edit the files I needed to make this work for me… So your mileage may vary.)

nathancu-am I missing something? How do I get the updated code? I click on the links and it takes me through a couple pages but there’s no code. I’m sorry if I’m missing something. I’m new to all of this. Thanks for all of your work

Thanks for digging in @nathancu! Like @jwiese997, I do not see your changes. Once committed, I will review and reincorporate into my branch.

Interesting the device handler/smart app is still working for me without updating. Maybe it is because I configured before Nexia updated their site.

I’m a little GIT challenged. :slight_smile: I apparently didn’t get the changes committed properly. I’m trying to fix it now. I’ll fix it when I get home from work this afternoon. (I think I have to recreate my edits - looks like I accidentally overwrote my ‘good copy’ Apologies. At least I know what I changed - It should only take a few mins to fix.

@trentfoley : The first change is in the authtoken line where you navigate the branches, they added a dialog box in a DIV (to inform users about holiday support options) and it makes the reference numbers off by one… We also need to look at a similar condition where you search for the user’s climate path.

And yes, I’m positive you’re right about the dev handler working, it appears the code issues are in the smart app during the install() procedure where it initializes a connection to Nexia and ‘finds’ the user’s climate control path. I think you keep that saved once you’re installed so that part doesn’t need to re-auth or relocate the path.

Thanks for the great work…

-nac

Here’s the copy of the updated code in my Repo:

@jwiese997: I deleted my Nexia thermos, and reinstalled the smartapp from scratch to make sure it initializes successfully, everything ran like a champ.

Hope this works for all!

-Nathan

PS: @trentfoley I sent another pull request - this time with the code attached. Sorry for the confusion.

I’ve tried the updated but I still get an error. It adds the thermostat into My Devices but if I try and open it in the app, the app crashes. I can’t even delete the smartapp or device handler because it says the device is still in use even though I’ve deleted it. Here’s a copy of my logs. Please let me know what I’m doing wrong. Thanks again for all your work.

Edit: Nevermind. I finally got it to work. I figured out what I had to do to delete everything and start over. That fixed it. Thanks again.

1 Like

That’s awesome! I’m still interested in changing the code to parse the page and search for the required bits of data, but for now this’ll have to do as my door sensors and alarm control board just arrived. I’m sure that’ll give me a project for at least 3-4 weeks. :smiley:

Thanks, I just got around to trying the new code. Seems to be working, the only odd thing I see is that it detected and created 2 thermostats, both are identical. I only have 1 thermostat.

I did have to delete and recreate the smart app to get it to install properly.

Barry

Using the Trane XL824 Thermostats. All the functions work EXCEPT changing the temperature.

They were working perfectly fine last month. Then all of a sudden, I was not able to change the temperature on BOTH thermostats, i decided to remove them and tried re-adding them more than 10 times!

Still not able to change the temp (Up?down Keys)

Any help is greatly appreciated

Edit: Both thermostats are showing as “Pending Heat”