[RE-RELEASE] Netatmo (Connect) - Weather Station

I do still try to support the app, but I don’t have a Netatmo station anymore.

@dJOS @3rdStng After trying all the rest of the suggestions, I tried this one from above, and it worked. It is too simple. It is a browser caching issue.

Thanks all,

LJ

3 Likes

Just to add my 2 cents here: I just finished adding Netatmo to a new C-8 after having had it on a C-5. I ran into the loop problem with the app after filling in the Client-ID & secret on the Netatmo page, as well as a problem with devices not appearing immediately.

For me I had to use the back button after a successful addition and click the Next button to finish app installation. No devices appeared in the list for me to add, but I saved the settings I wanted and closed the app.

Then I opened the app again and all the devices appeared in the drop-down. I was able to select them and save.

Thanks to all on here. I had troubles getting devices to show up. I believe I solved the issues using two steps: by generating a token on the dev.netatmo website. This brought up another webscreen to authorize the use of I presume the "dev" app to read the data. When I returned to the dev.netatmo site the token was no longer visible.

I then used the client id and secret key from this new "dev" app in the connect app. Again, it showed no devices. However, when I hit refresh they both showed up!! Thanks!

I'm having problems too but I can't make changes to oauth in the appcode. How can I change the keys?

Hi all, my NetAtmo integration was working fine for months now, but stopped working 3 days ago. The logs are filled with errors like this:

Is this the result of the NetAtmo OAuth change? Anyone else having trouble? I have tried the standard stuff like rebooting HE, refreshing cache etc. When I go to the app, it says "Connected", but when I go to the details page, the device dropdown doesn't show anything anymore.

Suggestions? Thanks!

Try generating a new set of credentials.

The oauth change was months ago.

OK, did that. Wish I had taken screenshots of the rule logic before I did it. :joy:

But, got it all hooked back up, and it seems to be working again! Thanks @dJOS, for helping me out even though you are not even a user anymore. Wish someone with Dev chops would take over this app, so they can make changes. A simple disconnect/reconnect button (using the same credentials) may help?

1 Like

No dramas, I’m happy for anyone to fork my version and republish.

In theory, rebooting your hub would accomplish this.

Oh, I see. I certainly did try that. I wonder why it would connect (it said “connected” on the app), but not get data with the old credentials. Makes no sense.

1 Like

Weird, they may have decided your credentials were too old.

Maybe. But then, I would expect the app not to show “connected”.

True, definitely odd.

Once again, NetAtmo stopped working a few days ago. I went back and deleted and re-installed it, as I did on August 27th. This time, instead of creating a new App on the NetAtmo site, I simply re-used the credentials from the previous App I had (the one that stopped working in August), and lo and behold, that worked! So, clearly, the issue is not on the NetAtmo end, as we had suspected. Something is going wrong in the NetAtmo Connect App on Hubitat. @dJOS since you don't have the NetAtmo unit any longer, I guess your ability to debug this problem is non-existent?

Apologies, I’m happy for someone to fork my repo and take it over.

Understood.

I have done no development work on Hubitat before. I don't know Groovy, but have worked with Java, Python etc. before. Not a programmer anymore, but familiar with programming, let's say. Would I be able to do this? @dJOS, can you help me get started? I was looking at the Developer Overview page on Hubitat, and I think I understand most of it. But, I am not clear on how you load your development code in, and do the debugging on Hubitat. If you can give me some helpful pointers, I may be able to hack it.

Also, I think I may have a clue as to what the problem is. Looking at the code, it appears that the assumption is that the refresh_token is permanently valid. This is not a good assumption. Refresh tokens can be revoked as well, and there needs to be a re-authorization process built-in to the system. For example, I use an iPhone App called "MyAtmo", which displays the NetAtmo data in different ways, with graphs etc. and also supports the Apple Watch. This app works, but every once in a while, when I launch it, it comes up with "You need to re-authorize with NetAtmo", and takes me to the page where I have to login to NetAtmo and say "authorize app" there. There doesn't seem to be any particular periodicity to this. I suspect it happens when they do some server maintenance on the Auth servers, and dump refresh codes in the process or something. Does this make sense, @dJOS ?

2 Likes

That’s a reasonable assumption, if you have a suggestion to change this behaviour, I’m happy to implement it in my hosted version.

Eg how often should we refresh this based on your observations?

That's the rub. It is not a periodic thing, with a defined periodicity, afaik. Nothing in the NetAtmo API doc suggests any period to re-authorize and get a fresh refresh_token.

Noting that re-authorization involves the user (since it requires re-logging in to the NetAtmo server), one idea may be just to put a "Re-authorize" button on the App page. That way, when the user sees these refreshToken errors in the log (see my screenshot from a previous post), they can go into the app and click the "Re-authorize" button to get that done. Does this sound reasonable? It's certainly a lot better than uninstalling and reinstalling the app (and fixing every broken rule in the process).

Sounds reasonable, I’ll take a look and see what is possible.