Netatmo Security - Hubitat port

Dear all,

This is a port of Netatmo Security, from smartthings, for Netatmo Welcome and Presence cameras.

I can't claim the hard work here but it did take a couple of hours to get it up and running.

The Netatmo Security app and drivers was originally adapted from the Netatmo Connect app, written for smartthings. I've ported Netatmo Security to Hubitat, using the work done for Netatmo Connect by @cybrmage

Patrick

2 Likes

Thanks to @tony.fleisher for helping me to understand why webhooks weren't working.

Webhooks are now working.

These are my last devices on ST. I will be removing them from ST today.

I'd always planned to look at the way that 'person seen' events were handled in this app but when ST dev changed I never got to it. I'm going to re-visit this soon. I'll also attempt to add app versioning as well.

1 Like

Thanks patrick! I am not sure how to use it however. I just created an app on the dev section of netatmo, but what should i enter at the redirect url and the webhook url?

Hi,

You don't need to fill in those sections.

The re-direct is sent up during the auth process and the webhook url is set during the addwebhook method.

Let me know how you get on. It was extremely fiddly when I set it up. I struggled to get past the oauth flow page. In the end I figured out that saving the app code, after seeing the 'connected' page, did the trick.

I've been running the devices for a day now and I can see there is an issue with one of the camera methods. I'll take a look over the week and see if I can work out what's wrong. So far it doesn't appear to be affecting operation.

Ok so the app installed after enabling oauth and withouth filling in the urls. It even detects my presence cameras. do i need to add the camera devices as a virtual device, or do they auto discover somehow?

Once you saw the 'connected' web page, did you then install the app again?

You should see a page like this:

Once you hit next, it should discover the camera which will then create a device automatically.

I've just added the device driver for the presence camera to github:

I get the following response after saving it:

×unable to resolve class physicalgraph.device.HubAction @ line 271, column 21.

this screen I have, after it shows me the devices:


It doesnt create a device after i click done

Ahh, I haven't ported the Presence driver. Sorry, I don't have a Presence so I realised I hadn't uploaded and put it there for you quickly.

Give me half an hour and I'll sort it.

I'm in the middle of looking at the webhook events. I've worked out why the person seen event is failing from the Welcome camera. The event_type is being sent to the wrong driver.

1 Like

Ok, that driver should save now and then it should create a device once you click done on the page you posted.

ah ok so you put in in the Person folder. Code looks ok, I added it to the drivers.. The device doesnt appear after clicking done unfortunately. I think something is wrong in the app

Can you clear the logs and then post the Netatmo Security log taken while you try to add the device?

I'm getting event status for all my cameras and people. Let's see if we can work out why the presence won't add.

app:3532021-02-01 23:49:28.178 debugapiGet response status 200
app:3532021-02-01 23:49:27.970 debugAPI Get: [uri:https://api.netatmo.com, path:/api/gethomedata, query:[access_token:xx1|xx2]]
app:3532021-02-01 23:49:27.966 debugRefreshing camera and person data
app:3532021-02-01 23:49:27.962 debugPolling
app:3532021-02-01 23:49:27.959 debugDelete: []
app:3532021-02-01 23:49:27.955 errorError creating device: com.hubitat.app.exception.UnknownDeviceTypeException: Device type 'Netatmo Presence' in namespace 'copycat73' not found
app:3532021-02-01 23:49:27.951 debugCreating child
app:3532021-02-01 23:49:27.948 debugIn createChildDevice
app:3532021-02-01 23:49:27.945 debugCreating Presence camera Frontyard (Thuis)
app:3532021-02-01 23:49:27.940 debugapiGet response status 200
app:3532021-02-01 23:49:27.737 debugAPI Get: [uri:https://api.netatmo.com, path:/api/gethomedata, query:[access_token:xx1|xx2]]
app:3532021-02-01 23:49:27.734 debugRefreshing camera and person data
app:3532021-02-01 23:49:27.731 debugInitialized with settings: [clientId:cid1, devices:[MAc address], clientSecret:cid2, installWebhook:true]
app:3532021-02-01 23:49:27.607 debugUpdated with settings: [clientId:cid1, devices:[MAC Address], clientSecret:cid2, installWebhook:true]
app:3532021-02-01 23:49:24.017 debugapiGet response status 200
app:3532021-02-01 23:49:23.774 debugAPI Get: [uri:https://api.netatmo.com, path:/api/gethomedata, query:[access_token:xx1|xx2]]
app:3532021-02-01 23:49:23.676 debugRefreshing camera and person data
app:3532021-02-01 23:49:23.673 debugListing devices
app:3532021-02-01 23:49:22.355 debugShowing the devices page
app:3532021-02-01 23:49:22.256 debugIn authPage

ok, it's having trouble finding the driver. Let me just check there's not a naming issue

yep, can you see the 'namespace copycat73?'

In the Presence device driver on line 17, change the namespace to match the case.

so, namespace: "copyCat73" --> change to: namespace: "copycat73"

Goodness knows how these worked in the past, unless ST didn't care about case.

1 Like

haha yes i found it, it shows up now

Excellent..... I'll change the github file as well.

I've also managed to fix the seen() method for the Welcome camera. I'll post the new versions shortly.

Nice work man!! Now i will see what kinds of mischief i can create for the wife, neighbours and all of their cats :smiley:

1 Like

Ok,

Fixes:

  1. The Presence camera driver is now ported and uploaded
  2. I've adjusted the webhook event, on the main app, so the person event_type is pushed to the person device rather than the camera - new app version uploaded
  3. I double checked the naming of all the files and adjusted accordingly.