NetAtmo Cameras into LM - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8) +--- Thread: NetAtmo Cameras into LM (/showthread.php?tid=2959) |
NetAtmo Cameras into LM - Hyxion14 - 05.11.2020 Hello, I want to integrate several NetAtmo security cameras in LM, to read the events of the cameras, for example if I detect movement, turn on a light. Has anyone been able to integrate NetAtmo cameras into LM? Thanks a lot. RE: NetAtmo Cameras into LM - admin - 09.11.2020 NetAtmo has webhook option that allows sending events via HTTP: https://dev.netatmo.com/apidocumentation/security#webhooks On LM side you need to create a server-side .lp script that will handle events. Script should be uploaded via FTP using apps login to the user directory. If the file name is netatmo.lp then the HTTP path will be http://user:password@LM_IP/user/netatmo.lp If username/password access does not work then you can disable password protection for user directory in User access settings. Use this as a starting point: Code: <? RE: NetAtmo Cameras into LM - Hyxion14 - 10.11.2020 Thanks a lot. I will investigate it. RE: NetAtmo Cameras into LM - pioneersteffen - 06.09.2021 Hi, Have you’ve been successful to get the Netatmo security cams running? I’ve a Netatmo doorbell to implement in LM. Many thanks in advance! Best Regards Steffen RE: NetAtmo Cameras into LM - benanderson_475 - 16.03.2022 Hi All, i have this working in part, i am getting messages if i change some settings on the netatmo app (log as below) but i am not getting messages on event from the camera, any ideas- must be a netatmo setting? * table: ["change"] * string: home_updated ["home"] * table: ["id"] * string: xxxxxxxxxxxxxxxxxxxxxx ["user_id"] * string: xxxxxxxxxxxxxxxxxxxxxxxxx ["push_type"] * string: topology_changed ["user"] * table: ["email"] * string: xxxxxxxxxxxxxxxxxxxxxxx ["id"] * string: xxxxxxxxxxxxxxxxxxxxx ["home_id"] * string: xxxxxxxxxxxxxxxxxxxxx Many Thanks RE: NetAtmo Cameras into LM - admin - 16.03.2022 Most probably something is missing in the configuration on Netatmo side. LM is simply logging all received requests. It might be also possible that the JSON string is incorrect. Try logging the body variable contents: Code: <? RE: NetAtmo Cameras into LM - pioneersteffen - 16.03.2022 (16.03.2022, 00:41)benanderson_475 Wrote: Hi All, Hi, would it be possible to share the script with us? I like to get it working as well! Many thanks for your help! Best Regards Steffen RE: NetAtmo Cameras into LM - admin - 16.03.2022 The script (.lp file) is here: https://forum.logicmachine.net/showthread.php?tid=2959&pid=19054#pid19054 RE: NetAtmo Cameras into LM - benanderson_475 - 17.03.2022 (16.03.2022, 09:24)admin Wrote: Most probably something is missing in the configuration on Netatmo side. LM is simply logging all received requests. It might be also possible that the JSON string is incorrect. Try logging the body variable contents:Thanks, I added in the log(body), returns a string - same as decoded json Looking into it, it seems this is broken on the Netatmo side, the camera I have is an outdoor camera “NOC” , it sends the smart events to the Netatmo app but not to the webhook… (but other events from the Netatmo web are sent to the webhook) just not the ones that are actually useful… looks like it is a Netatmo firmware issue. Has anyone else been successfully using this method? If so what camera/ and firmware version is being used? RE: NetAtmo Cameras into LM - benanderson_475 - 29.03.2022 Hi, I Thought i would update this post as it wasn't straight forward to get this working, After i had uploaded by ftp to the LM the file netatmo.lp to apps, I created an app on netatmo dev platform (https://dev.netatmo.com/apps/) and entered my Webhook url as http://mydomain/user/netatmo.lp (this is redirected through my modem to the lan ip of the lm) i also take parameters client ID and client secret for later on Firstly we need to pass username and password with the client id and secret with function and authorize lm use to this app we created on netatmo dev, call the function Get_Token() once, this authorizes the lm to use the netatmo app (as per netatmo doc, although this wasn't really clear that this was required in order to use webhooks etc) The script writes the token, refresh token and expiry time in seconds to 3 different virtual object data type 250byte string Then run the scheduled script to refresh the token, call function Refresh_token() once an hour. now I receive all Smart events from the netatmo camera in the log from the netatmo.lp script user library as below, change/add all credentials and virtual obj to suit Code: require 'ltn12' |