New Netatmo binding (starting OH 3.3 M5)

Ok, I think we just have to enhance the documentation.

How about adding a simple servlet to indicate that the token already exists.

Current servlet already indicates that the token exists with a green higlighting of the account. So it would just need to be activated whatever the configuration status is.

I updated to 3.3.M6 and get the following error on the account Thing:

Configuration incomplete, please grant the binding to Netatmo Connect.

In the documentation to 3.3 I can not see something about the new grant process. Someone can tell me what to do?

EDIT: Found itā€¦ Itā€™s like @stefan13 wrote above:

http://<OH3-IPAddress>:8192/netatmo/connect/<Client_ID>

After update to M6 I get this warn, so whats the problem?

2022-06-11 18:37:25.841 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler DeviceHandler of thing netatmo:weather-station:bd8688924a tried checking if channel temperature#heat-index is linked although the handler was already disposed.
2022-06-11 18:37:25.847 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler DeviceHandler of thing netatmo:weather-station:bd8688924a tried checking if channel temperature#dewpoint is linked although the handler was already disposed.
2022-06-11 18:37:25.860 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler DeviceHandler of thing netatmo:weather-station:bd8688924a tried checking if channel temperature#dewpoint-depression is linked although the handler was already disposed.
2022-06-11 18:37:25.870 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler DeviceHandler of thing netatmo:weather-station:bd8688924a tried checking if channel airquality#co2 is linked although the handler was already disposed.
2022-06-11 18:37:25.883 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler DeviceHandler of thing netatmo:weather-station:bd8688924a tried checking if channel location#value is linked although the handler was already disposed.
2022-06-11 18:37:25.888 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler DeviceHandler of thing netatmo:weather-station:bd8688924a tried checking if channel timestamp#measures is linked although the handler was already disposed.
2022-06-11 18:37:25.902 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler DeviceHandler of thing netatmo:weather-station:bd8688924a tried checking if channel timestamp#last-seen is linked although the handler was already disposed.
2022-06-11 18:37:25.909 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler DeviceHandler of thing netatmo:weather-station:bd8688924a tried checking if channel signal#value is linked although the handler was already disposed.
2022-06-11 18:37:25.921 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler DeviceHandler of thing netatmo:weather-station:bd8688924a tried checking if channel signal#strength is linked although the handler was already disposed.
2022-06-11 18:37:26.278 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler DeviceHandler tried updating the thing status although the handler was already disposed.

Looks like this (block with a light green background) when you are already authorized:

image

hi, just updated to 3.3M6 - having the same issues.

going ā€œbasicā€ with;

UID: netatmo:account:<UID>
label: Bridge - Netatmo
thingTypeUID: netatmo:account
configuration:
  reconnectInterval: 300
  clientSecret: <client_secret>
  clientId: <client_id>

ā€¦leads to: ā€œConfiguration incomplete, please grant the binding to Netatmo Connect.ā€

adding the refreshtoken;

UID: netatmo:account:<UID>
label: Bridge - Netatmo
thingTypeUID: netatmo:account
configuration:
  reconnectInterval: 300
  clientSecret: <client_secret>
  clientId: <client_id>
  refreshToken: <refresh_token>

ā€¦leads to: ā€œUnexpected error deserializing ā€˜{ā€œerrorā€:ā€œinvalid_grantā€}ā€™ā€

removing the refresh-token again (as mentioned above) and heading to
http://<openhab_ip>:8192/netatmo/connect/<client_id>

ā€¦leads to ā€œERR_CONNECTION_REFUSEDā€ for multiple browsers (Chrome, Firefox, Edge).

Iā€™m using Securing Communication and Access | openHAB for nginx config.

EDIT #1:
Iā€™m able now to auth via :8080 (:8192 doesnā€™t work) - http://<openhab_ip>:8080/netatmo/connect/<client_id>.

The bridge is now ā€œONLINEā€, but the funny thing is - the refresh token, that is now added to the thing-config is exactly the same I added manually and lead to ā€œUnexpected error deserializing '{ā€œerrorā€:ā€œinvalid_grantā€}ā€.

Again, the binding works for me now, but maybe you could add those additional infos to the binding-docs.

1 Like

Port was 8192 because the user defined a specific port for OH.
For most of users, the port will be 8080 and this is what is documented.

I have a doorbell and Iā€™m using the actual binding from milestone OH3.3M6.
I configured the webhook part and partially it works.
But the following channels are not updated:

sub-event#type -> only value "Motion detected by Outdoor Camera" seen
sub-event#message -> remains empty
sub-event#snapshot -> remains UNDEF
sub-event#snapshot-url -> remains NULL
sub-event#vignette -> remains UNDEF
sub-event#vignette-url -> remains NULL

Here are the JSONā€™s from the events which are written to openhab.log when loglevel is set to DEBUG.

incoming call:

{
	"user_id": "xxxxxxxxxxxxxxxxxxxxxxxx",
	"event_type": "incoming_call",
	"device_id": "xx:xx:xx:xx:xx:xx",
	"home_id": "xxxxxxxxxxxxxxxxxxxxxxxx",
	"home_name": "Mein Haus",
	"camera_id": "xx:xx:xx:xx:xx:xx",
	"event_id": "xxxxxxxxxxxxxxxxxxxxxxxx",
	"subevent_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
	"snapshot_url": "https://netatmocameraimage.blob.core.windows.net/production/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
	"vignette_url": "https://netatmocameraimage.blob.core.windows.net/production/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
	"session_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
	"push_type": "NDB-incoming_call"
}

motion detected:

{
	"user_id": "xxxxxxxxxxxxxxxxxxxxxxxx",
	"snapshot_id": "xxxxxxxxxxxxxxxxxxxxxxxx",
	"snapshot_key": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
	"snapshot_url": "https://netatmocameraimage.blob.core.windows.net/production/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
	"vignette_id": "xxxxxxxxxxxxxxxxxxxxxxxx",
	"vignette_key": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
	"vignette_url": "https://netatmocameraimage.blob.core.windows.net/production/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
	"event_type": "human",
	"camera_id": "xx:xx:xx:xx:xx:xx",
	"device_id": "xx:xx:xx:xx:xx:xx",
	"home_id": "xxxxxxxxxxxxxxxxxxxxxxxx",
	"home_name": "Mein Haus",
	"event_id": "xxxxxxxxxxxxxxxxxxxxxxxx",
	"subevent_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
	"message": "Person erfasst",
	"push_type": "NDB-human"
}

I have also a direct webhook via the http binding installed, and there I get all the values from the webhook push notification.

Anyone else having this issue with the netatmo binding ?

This is probably an issue with webhook in the binding. As i understood, this part was not really tested by anyone.
Ideally an issue should be opened in GitHun.

YOuā€™re correct @Lolodomo

Thanks, I opened a bugreport

Iā€™m happy to help here with testing if needed.

I need to go through the grant process every time I reboot openhab (the token exists, but it needs to be reactivated every time)

@glhopital is this expected?

Andrea

For sure not. Are you file or UI based configured?

file based.

let me share my things

Bridge netatmo:account:home                       "Netatmo Account"        [clientId="xxxxxxxxxxxxx", clientSecret="xxxxxxxxxxxxxxxx", username = "xxxxx@xxxxxxxxx", password = "xxxxxxxxxx"] {
  Bridge  weather-station    station              "Netatmo Weather Station" @ "Living Room"  [id="70:ee:50:01:c2:66"] {
    Thing outdoor            outside              "Netatmo Outdoor" @ "Outdoor"              [id="02:00:00:01:f2:5c"]
    Thing wind		           wind 	              "Netatmo Wind Gauge" @ "Outdoor"           [id="06:00:00:00:86:1e"]
    Thing rain               rain                 "Netatmo Rain Gauge" @ "Outdoor"           [id="05:00:00:04:55:90"] {
//      Channels:
//        Type sum_rain-measurement: rainThisWeek  "Rain This Week"         [period="1week"]
//        Type sum_rain-measurement: rainThisMonth "Rain This Month"        [period="1month"]
    }
    Thing indoor             kitchen              "Netatmo Kitchen" @ "Kitchen"              [id="03:00:00:01:1e:c8"]
    Thing indoor             library              "Netatmo Library" @ "Library"              [id="03:00:00:01:24:2e"]
    Thing indoor             hobbyroom            "Netatmo Caty's Room" @ "Caty's Room"      [id="03:00:00:03:4b:ea"]
  }
  Thing home-coach         bedroom              "Netatmo Bedroom" @ "Bedroom"              [id="70:ee:50:26:51:36"]
}

Ok, this is clear, you are providing username and password settings and not the token as now expected.
Please check the documentation and the example

1 Like

@glhopital : can you explain where in MainUI you can add new channels to the weather station thing, like for example a channel for the max temperature during the last month. I do not find that in UI. Is it available in MainUI even if my thing is defined in a config file ?
I am waiting for your answer, maybe it is obvious and I donā€™t see it. Maybe it should be documented in README.

Open the weather thing.
Go in the Channels tab :

The ā€œAdd Channelā€ button is there.

I donā€™t have the ā€œAdd Channelā€.

Maybe is it because your thing is file based ?