-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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] Support Presence Camera #3059
Comments
I am looking forward for support of the presence camera too. |
I am currently testing the Welcome camera and I am trying to fix all the little problems I can identify. @clinique: my feeling is that we have mainly to add the specific scopes for Presence camera and think about the few differences between the Welcome and the Presence camera. For example, an event for a Presence camera can include a list of sub-events. |
I've made some local tests implementing support for my Presence based on the latest Netatmo 2.x binding and as @lolodomo mentions the Swagger API needs to be updated with support for the sub-event list array that is present for each event. My local implementation uses c&p from the Welcome implementation adding a NAPresenceHomeHandler and a NAPresenceCameraHandler. A better solution might be to have a more generic CameraHome/Handler that supports both Welcome and Presence. I'm able to beta-test your Presence implementation since I have a Presence camera (and soon a Welcome camera too). Regarding the web hook support, is the only way of using the web hook to have my Openhab on a public IP or are there other ways of configuring it? The web hook is the only way as I understand to get immediate openhab events based on the Netatmo events/sub-events. |
Yes for the webhook, unfortunately. Is there any difference in your presence class compared to the welcome class ? I initially thought there would be no need of new classes. Or at least an abstract class that will contain everything in common, that is probably 95%. |
Yes, for sake of clarity, I think we should have common abstract class, and specifics held by distinct classes. Yes also regarding webhooks, it need a plublic IP and the tricky thing is that past very few unresponsive responses, you get blacklisted by Netatmo API for 24h. Currently, just to try it, I use a simple script hosted on a public cloud server that redirects to my home server. |
Regarding the need to update the Swagger API, is that done by you guys or is it done by Netatmo? It looks like the 'Try It' functions on dev.netatmo.com also uses the Swagger API. Regrading webhooks, is it possible to somehow integrate the webhook towards myopenhab.org? |
That would be a question that @marziman or @digitaldan could answer best. |
@jannegpriv : swagger api evolution can be submitted on Github to cbornet repository: cbornet/netatmo-swagger-decl Integrating webhooks to myopenhab.org could be a good approach, but it not bulletproof neither. This can also be down :( |
I've not had so much issues with it being down, isn't the new Google Home Action API also integrated towards myopenhab.org? Seems to be a natural way of integrating towards it since it is already there :-) Having the possibility to have almost immediate events in OpenHAB from Netatmo Events would be so useful and cool to have :-) |
Integrating in myopenhab is not possible as Netatmo has not imagined that an authentication could be important for webhook ! |
If my openhab can possibly help, ping me with some of the webhool details |
@digitaldan : pushing data to myopenhab without any authentication is forbidden, I imagine ? |
We can support oauth tokens or basic http auth, I don’t know the specifics of how you configure the webhook so it’s hard to know what the options are |
The documentation is not so extensive, can you make something out of this API description of adding a webhook? |
Without knowing more, if they respect embeding the http auth parameters in the URL like "https://username:[email protected]/someRestEndpoint" then that might work. I understand this is passing your credentials around, so not ideal. Also note that myopenhab does support multiple "users" per account, so you could create a user in myopenhab with a complex password and use that (maybe a little better security) |
also note that you may need to esacpe the @ symbol with %40 when encoding :-) |
This will at least provide our myopenhab credentials to netatmo !! |
nginx would probably log this, I would need to check for a way for it to not. |
Just a short hint. The netatmo webhook sends an additional http header field called I use something similar using the Facebook Webhooks and because the secret is only known by the user and Netatmo and is not transferred it should be possible to identify the sender. Only Netatmo should be in the position to know this secret and the hash ensures that the content is not modified during the transfer. So we have a authorisation and a content check at once. If the calculated check sum and the one transferred do not match drop the request. |
@jannegpriv : I would like to add support for Presence camera but I don't understand how I can distinguish Welcome camera from Presence camera in the API. @clinique : I don't understand on what library we rely on for the netatmo API ? I see a file netatmo-java-retrofit-1.1.1.jar in libs. Where does this file come from ? Where is the corresponding source code ? |
Is the source code coming from https://github.com/cbornet/netatmo-swagger-api/tree/master/samples/netatmo/client/java-retrofit ? |
Where is the source code of the class |
Or maybe https://github.com/cbornet/netatmo-swagger-api/tree/master/generated/netatmo/client/java-retrofit ? But still no class NAWelcomeCamera. |
@lolodomo I analysed this, too. And it seems @cbornet wrote a swagger json to describe the Netatmo API and uses some tools to autogenerate a java lib from that. So someone has to extend the json file for the presence camera and then a new auto generated lib can be created and afterwards it is possible to improve this openhab2 addon. It's a bit bad we rely on a seldom updated 3rd party library. @lolodomo do you like to open an issue in @cbornet repo? |
But the swagger json has maybe already all what we need (Presence support) ? |
I don't think so, please check here: https://github.com/cbornet/netatmo-swagger-decl/blob/master/spec/swagger.yaml There is no reference to presence and the "new" presence permissions are missing, too. |
@lolodomo : the spec of the Netatmo API is in netatmo-swagger-decl, netatmo-swagger-api is used to generate the according retrofit client. Generated client that is present in the swagger-api repo has not been updated since a while. |
The netatmo-swagger-decl has the definitions for the Welcome camera endpoints which are the same as for Presence. So it should just be about adding the oauth scopes in the security definitions. |
@lolodomo : don't know if I skipped it in previous reading but I discovered this in webhooks documentation today : "One valid request resets the failing counter of your application." |
@clinique I saw that you contributed to https://github.com/cbornet/netatmo-swagger-decl . How did you build the netatmo-java-retrofit-1.1.3.jar? Which arguments did you used with ´swagger-codegen`? Thanks for you help. |
I don't really update or publish artifacts for netatmo-swagger-api. I think OpenHAB usually builds its own jar from the spec. @clinique , I think you did it initially ? |
Yes, IIRW using netatmo-swagger-api, I built locally the target jar and uploaded it to the openhab lib folder. |
Ok, thank you. That sounds simple, but which lib folder do you mean? I don't see a "lib" folder within the OpenHAB GitHub projects. |
You're right, now the lib folder has been suppressed, it's a dependency in the pom.xml :
|
Yes, I saw that but it seams to be difficult to get a new version of it uploaded to that repository (and I don't know which repository it is and who could do the release, it is not maven central). Currently I try to integrate it within the maven build of the binding. So the maven build would download the swagger file (or uses a persisted copy of it) and generates the code with the swagger-codegen-maven-plugin. The advantage would be that it could get updated and built/"released" with just executing a maven phase and without involving 3 projects and various people. Is that a valid alternative solution? For the events I would realize an event channel like "welcomeHomeEvent". But additionally to it I would realize 3 channels for boolean/switch items: humanDetectedChannel, animalDetectedChannel and vehicleDetectedChannel. That makes it easy to realize simple rules which are triggered by an item state change and to display the information within HabPanel for example. Would that be useful? Thank you in advance and best regards |
Yes, I think this is a very valid alternative solution, having these three projects has always been a pain preventing me to update more frequently this binding. Happy that you jumped in ! |
I have created a new pull-request which ...
The webhook is still untested and therefore still not yet activated for the Presence camera. I will check and support that later. And it seems that I have a problem with updating my fork/branch (there are too many changes and required reviewers within the pull-request, I will try to solve it within the next days and create a new pull-request). |
The pull-request is now available for review, see #7807 |
…#7660) * Support for the Presence camera added * Files and thing types renamed because it handles now various camera types (not only the Welcome camera) * README updated to clarify the Welcome and Presence product names * Permission configurations renamed because it handles now various camera types (not only the Welcome camera) ; Reverted. Now it is separated, so the user has explicitly to decide if he wants to grant the access to outdoor cameras. * Camera channels separated to remove "welcome" from the (Presence) channel names. The channels of the Welcome camera were not renamed to be downward compatible. * welcomeHomeEvent channel removed for the Presence camera, event handling for the Presence will get realized later Signed-off-by: Sven Strohschein <[email protected]>
Hi, good news, I got the floodlight running. ;-) I have created a feature request for it, see #7912 . There is also the information where to find the current state if you would like to test it. Do you or someone other know if the start / stop video recording feature is also available for the Welcome camera? Is it available within the App for Welcome cameras? Or is it Presence exclusive? |
In the netatmo app, with the Welcome Camera, you can start and stop the live video. Is it the answer to your question ? |
I see an option called "Überwachung" (german) at the Presence outdoor camera settings, see screenshot. That should be called "Monitoring", "Observation" or "Surveillance" in english. Is that the same what you see at the Welcome camera. |
Ah ok, yes of course, there is this option called "surveillance" in French to enable or disable the surveillance. |
Ah, ok. Then it should get realized for all/both camera models. Thank you. :-) The floodlight support #7912 is a good preparation for it, I will try to realize it after that. |
I have now opened issue #7938 for that. |
…#7660) * Support for the Presence camera added * Files and thing types renamed because it handles now various camera types (not only the Welcome camera) * README updated to clarify the Welcome and Presence product names * Permission configurations renamed because it handles now various camera types (not only the Welcome camera) ; Reverted. Now it is separated, so the user has explicitly to decide if he wants to grant the access to outdoor cameras. * Camera channels separated to remove "welcome" from the (Presence) channel names. The channels of the Welcome camera were not renamed to be downward compatible. * welcomeHomeEvent channel removed for the Presence camera, event handling for the Presence will get realized later Signed-off-by: Sven Strohschein <[email protected]>
…#7660) * Support for the Presence camera added * Files and thing types renamed because it handles now various camera types (not only the Welcome camera) * README updated to clarify the Welcome and Presence product names * Permission configurations renamed because it handles now various camera types (not only the Welcome camera) ; Reverted. Now it is separated, so the user has explicitly to decide if he wants to grant the access to outdoor cameras. * Camera channels separated to remove "welcome" from the (Presence) channel names. The channels of the Welcome camera were not renamed to be downward compatible. * welcomeHomeEvent channel removed for the Presence camera, event handling for the Presence will get realized later Signed-off-by: Sven Strohschein <[email protected]> Signed-off-by: CSchlipp <[email protected]>
…#7660) * Support for the Presence camera added * Files and thing types renamed because it handles now various camera types (not only the Welcome camera) * README updated to clarify the Welcome and Presence product names * Permission configurations renamed because it handles now various camera types (not only the Welcome camera) ; Reverted. Now it is separated, so the user has explicitly to decide if he wants to grant the access to outdoor cameras. * Camera channels separated to remove "welcome" from the (Presence) channel names. The channels of the Welcome camera were not renamed to be downward compatible. * welcomeHomeEvent channel removed for the Presence camera, event handling for the Presence will get realized later Signed-off-by: Sven Strohschein <[email protected]>
…#7660) * Support for the Presence camera added * Files and thing types renamed because it handles now various camera types (not only the Welcome camera) * README updated to clarify the Welcome and Presence product names * Permission configurations renamed because it handles now various camera types (not only the Welcome camera) ; Reverted. Now it is separated, so the user has explicitly to decide if he wants to grant the access to outdoor cameras. * Camera channels separated to remove "welcome" from the (Presence) channel names. The channels of the Welcome camera were not renamed to be downward compatible. * welcomeHomeEvent channel removed for the Presence camera, event handling for the Presence will get realized later Signed-off-by: Sven Strohschein <[email protected]>
…#7660) * Support for the Presence camera added * Files and thing types renamed because it handles now various camera types (not only the Welcome camera) * README updated to clarify the Welcome and Presence product names * Permission configurations renamed because it handles now various camera types (not only the Welcome camera) ; Reverted. Now it is separated, so the user has explicitly to decide if he wants to grant the access to outdoor cameras. * Camera channels separated to remove "welcome" from the (Presence) channel names. The channels of the Welcome camera were not renamed to be downward compatible. * welcomeHomeEvent channel removed for the Presence camera, event handling for the Presence will get realized later Signed-off-by: Sven Strohschein <[email protected]>
…#7660) * Support for the Presence camera added * Files and thing types renamed because it handles now various camera types (not only the Welcome camera) * README updated to clarify the Welcome and Presence product names * Permission configurations renamed because it handles now various camera types (not only the Welcome camera) ; Reverted. Now it is separated, so the user has explicitly to decide if he wants to grant the access to outdoor cameras. * Camera channels separated to remove "welcome" from the (Presence) channel names. The channels of the Welcome camera were not renamed to be downward compatible. * welcomeHomeEvent channel removed for the Presence camera, event handling for the Presence will get realized later Signed-off-by: Sven Strohschein <[email protected]>
…#7660) * Support for the Presence camera added * Files and thing types renamed because it handles now various camera types (not only the Welcome camera) * README updated to clarify the Welcome and Presence product names * Permission configurations renamed because it handles now various camera types (not only the Welcome camera) ; Reverted. Now it is separated, so the user has explicitly to decide if he wants to grant the access to outdoor cameras. * Camera channels separated to remove "welcome" from the (Presence) channel names. The channels of the Welcome camera were not renamed to be downward compatible. * welcomeHomeEvent channel removed for the Presence camera, event handling for the Presence will get realized later Signed-off-by: Sven Strohschein <[email protected]> Signed-off-by: Daan Meijer <[email protected]>
…#7660) * Support for the Presence camera added * Files and thing types renamed because it handles now various camera types (not only the Welcome camera) * README updated to clarify the Welcome and Presence product names * Permission configurations renamed because it handles now various camera types (not only the Welcome camera) ; Reverted. Now it is separated, so the user has explicitly to decide if he wants to grant the access to outdoor cameras. * Camera channels separated to remove "welcome" from the (Presence) channel names. The channels of the Welcome camera were not renamed to be downward compatible. * welcomeHomeEvent channel removed for the Presence camera, event handling for the Presence will get realized later Signed-off-by: Sven Strohschein <[email protected]>
Expected Behavior
Being able to turn on notification about movements seen dependent on other OH2 variables.
Target is to activate/deactivate the messaging of persons from the camera dependent of another OH2 item. I have a presence variable if at least someone is at home. If this is the case I would like to turn on/off the alarming of persons in the garden via a OH2 rule.
Current Behavior
Netatmo Presence is yet not supported by the v2 of the binding.
Possible Solution
Use the provided API from netatmo to access and modify the properties
Context
Your Environment
OH2, Netatmo Presence camera
The text was updated successfully, but these errors were encountered: