Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Netatmo] Webhook does not update all available channels - Smart Video Doorbell #12952

Closed
HaKuNaCH opened this issue Jun 17, 2022 · 5 comments · Fixed by #12972
Closed

[Netatmo] Webhook does not update all available channels - Smart Video Doorbell #12952

HaKuNaCH opened this issue Jun 17, 2022 · 5 comments · Fixed by #12972
Assignees
Labels
bug An unexpected problem or unintended behavior of an add-on

Comments

@HaKuNaCH
Copy link

HaKuNaCH commented Jun 17, 2022

Issue is mentioned in the community forum:
https://community.openhab.org/t/new-netatmo-binding-starting-oh-3-3-m5/135777/72?u=hakuna

I'm happy to test/support if required. I can also provide more logs if needed.

Expected Behavior

Webhook should update all available channels,

Current Behavior

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, never "Incoming call"
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"
}

Possible Solution

I have a direct webhook to the http binding which is working.
https://next.openhab.org/addons/bindings/http/
Here's my config:

UID: httplistener:HttpListener:xxxxxxxxxx
label: Doorbell Webhook
thingTypeUID: httplistener:HttpListener
configuration:
  jsonConfig: |-
    {
      "channels": [
        {
          "key":"user_id",
          "kind": "STATE",
          "state": "req.body.json.user_id"
        },
        {
          "key":"event_type",
          "kind": "STATE",
          "state": "req.body.json.event_type"
        },
        {
          "key":"device_id",
          "kind": "STATE",
          "state": "req.body.json.device_id"
        },
        {
          "key":"home_id",
          "kind": "STATE",
          "state": "req.body.json.home_id"
        },
        {
          "key":"home_name",
          "kind": "STATE",
          "state": "req.body.json.home_name"
        },
        {
          "key":"camera_id",
          "kind": "STATE",
          "state": "req.body.json.camera_id"
        },
        {
          "key":"event_id",
          "kind": "STATE",
          "state": "req.body.json.event_id"
        },
        {
          "key":"subevent_id",
          "kind": "STATE",
          "state": "req.body.json.subevent_id"
        },
        {
          "key":"snapshot_url",
          "kind": "STATE",
          "state": "req.body.json.snapshot_url"
        },
        {
          "key":"vignette_url",
          "kind": "STATE",
          "state": "req.body.json.vignette_url"
        },
        {
          "key":"session_id",
          "kind": "STATE",
          "state": "req.body.json.session_id"
        },
    	{
          "key":"push_type",
          "kind": "STATE",
          "state": "req.body.json.push_type"
        }
   ]
}

Steps to Reproduce (for Bugs)

  1. Install/configure netatmo binding incl. webhook
  2. add all available channels
  3. check the values after some events (motion/incoming call)
@HaKuNaCH HaKuNaCH added the bug An unexpected problem or unintended behavior of an add-on label Jun 17, 2022
@openhab-bot
Copy link
Collaborator

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/new-netatmo-binding-starting-oh-3-3-m5/135777/75

@clinique clinique self-assigned this Jun 17, 2022
@clinique
Copy link
Contributor

Thanks for this @HaKuNaCH

@lolodomo
Copy link
Contributor

@clinique : are you working to fix that?
Remains only few days before everything is frozen for 3.3.

@lolodomo
Copy link
Contributor

lolodomo commented Jun 20, 2022

@clinique : I think some annotations are missing in class WebhookEvent for example to match hone_id with honeId?

@clinique
Copy link
Contributor

clinique commented Jun 20, 2022

@clinique : I think some annotations are missing in class WebhookEvent for example to match hone_id with honeId?

Yes, the annotation is missing and it is not currently used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants