parent
80c6887193
commit
c5e8501051
@ -0,0 +1,73 @@
|
||||
+++
|
||||
# vim: ft=markdown
|
||||
title = 'Update weewx-netatmo extension'
|
||||
summary = 'Upgrade the authentication method from _password_ to _preauthenticated refresh_token_'
|
||||
date = '2023-07-15T17:02:10+02:00'
|
||||
# lastmod = ''
|
||||
categories = [ 'amateur-radio' ]
|
||||
tags = [ 'wx', 'weewx', 'netatmo', 'server', 'selfhost' ]
|
||||
|
||||
+++
|
||||
|
||||
I got an email from another weewx-netatmo user Patrick yesterday, in which he asked if
|
||||
my WeeWX installation was still running, because we use the same extension to fetch the
|
||||
weather data from the netatmo servers (this method `cloud` is already rediculous, but it
|
||||
works with that hardware, so yes...).
|
||||
|
||||
After looking on my servers logfiles I could confirm the extension wasn't working as
|
||||
expected any more.
|
||||
|
||||
Today [I found an actual fork of the fork of the original extension][forked]:
|
||||
|
||||
<https://github.com/Buco7854/weewx-netatmo>
|
||||
|
||||
[forked]: https://github.com/matthewwall/weewx-netatmo/issues/21#issuecomment-1636757236
|
||||
|
||||
## And this is how I upgraded the netatmo weewx extension
|
||||
|
||||
Uninstall the old extension:
|
||||
|
||||
```console
|
||||
$ doas -u weewx /home/weewx/bin/wee_extension --uninstall netatmo
|
||||
```
|
||||
|
||||
Download and install the new extension:
|
||||
|
||||
```console
|
||||
$ doas -u weewx wget -O weewx-netatmo.zip https://github.com/Buco7854/weewx-netatmo/archive/master.zip
|
||||
$ doas -u weewx /home/weewx/bin/wee_extension --install weewx-netatmo.zip
|
||||
```
|
||||
|
||||
Go to <https://dev.netatmo.com/apps/> and update your app to include a `refresh_token`.
|
||||
|
||||
Update the configuration with
|
||||
|
||||
```console
|
||||
$ doas -u weewx /home/weewx/bin/wee_config --reconfigure
|
||||
```
|
||||
|
||||
That should already ask for your refresh_token. Double check this in your `weewx.conf`
|
||||
configuration file, as it might not get written properly (like in my case).
|
||||
|
||||
The configuration should look like this now:
|
||||
|
||||
```toml
|
||||
[netatmo]
|
||||
username = email@address.com
|
||||
password = ****
|
||||
client_id = ************************
|
||||
client_secret = ***************************
|
||||
refresh_token = ************************|********************************
|
||||
driver = user.netatmo
|
||||
mode = cloud
|
||||
```
|
||||
|
||||
I basically left it the same as before, but I had to manually add the `refresh_token`
|
||||
line to the configuration.
|
||||
|
||||
A restart of WeeWX should fetch the data again.
|
||||
|
||||
```console
|
||||
$ doas rcctl restart weewx
|
||||
```
|
||||
|
Loading…
Reference in new issue