I noticed that Logi have just announced their new Logi Circle 2 camera
Has anyone achieved success in getting the original Logi Circle camera to work within Home Assistant?
thanks
I noticed that Logi have just announced their new Logi Circle 2 camera
Has anyone achieved success in getting the original Logi Circle camera to work within Home Assistant?
thanks
Would love to see this too. Still deciding whether or not to get one when it comes out. HA support would be awesome!
Also interested in buying a wired circle 2. Arlo and nest cams are supported in HASS. Circle should have a web interface. Could be possible?
I know this thread is probably dead however I did some research. What you can do is find the node your camera is on. (Your cameras can all be on different nodes)
Then you need to have a valid prod_session cookie. You get this by logging in and Logi will set this cookie.
Use this cookie in the header and call the API
https:// NODE ID .video.logi.com/api/accessories/CAMERA ID/image
This returns a still image that you can use for your automation. Hopefully this helps someone in the future.
Here is the reverse engineering of their auth flow
POST https://video.logi.com/api/accounts/authorization HTTP/1.1
{âemailâ:âEMAIL ADDRESSâ,âpasswordâ:âPASSWORDâ}
This will return the set cookie of prod session.
Set-Cookie: prod_session=SESSION COOKIE; Path=/; Domain=video.logi.com; Expires=DATE;
From there you have all the data you need to call the above mentioned API.
https://video.logi.com/api/accessories
returns a JSON struct of your cameras and names of your cameras as well as the Node IDs.
This is fantastic, Iâll have to try this as soon as I get Homebridge working properly again! Thanks for the info!!
Following on from Josephâs research⌠find below some PHP code that can be used to retrieve a still image from the first camera on an account.
Hopefully it may help someone write a plugin.
At the moment, Iâm using the âgeneric IP cameraâ plugin that points to this php page so that I can simply see a snapshot in homeassistant.
To use, set a path to store the cookies, email address and password and it should just work. Tested on Mac OS. Not the best code in the world but does only try and authenticate if the stored cookie has expired. Lots of improvements can be made.
Good luck.
<?php $cookie_path = '/tmp/cookies.tmp'; $email = '[email protected]'; $password = 'password'; if (!is_cookie_valid()){ web_request('https://video.logi.com/api/accounts/authorization',json_encode(array("email"=>$email,"password"=>$password))); } $res = web_request('https://video.logi.com/api/accessories'); if ($res){ $accs = json_decode($res,true); $nodeid = $accs[0]['nodeId']; $accid = $accs[0]['accessoryId']; $imgurl = 'https://'.$nodeid.'/api/accessories/'.$accid.'/image'; $res = web_request($imgurl); if ($res){ header('Content-Type:image/jpeg'); print $res; } }else{ die('Error retrieving accessories data'); } function web_request($url,$post_data=""){ global $cookie_path; $ch = curl_init($url); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0'); if (!$post_data==""){ curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'Content-Length: '.strlen($post_data))); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); } curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_path); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_path); return curl_exec($ch); } function is_cookie_valid(){ global $cookie_path; if (file_exists($cookie_path)){ $lines = file($cookie_path); foreach($lines as $line) { if (substr_count($line,"\t")==6){ $tokens = explode("\t", $line); $tokens = array_map('trim', $tokens); if ($tokens[4]>time()){ return true; } } } } return false; } ?>@RISO how does it work with generic ip?
does not work
can someone help?
Sorry Fux, never got it working myself (hassio).
Still hoping for a custom component. Fingers crossed.
Sorry to bother you, but how did you get it to work? When I test with the camera.snapshot
, I get an older picture, not what is happening in front of the camera as I trigger the snapshot.
my observations shown that snapshort is updated once in a minute or so ( so dont expect muchâŚ
ohhh wow⌠Thank you
@sergeymaysak This looks promising:
Todo
private mode switch
WebRTC streaming for live view
services to download activities and day brief
I wonât I was under the impression that the camera.snapshot
triggered an actual snapshot from the camera, not grabbing the last one saved. This seems to be the same for my Canary Flex camera as well.
Sidenote: anyone knows of a camera (for outside usage) that takes a snapshot when triggered?
Oh man, the timing. Just a few days ago I started working on the same thing as @sergeymaysak. Iâm attacking it from the other end, working on getting a clean Python API built for Logi Circle, and then plan to integrate to HASS to keep the HASS code as simple as possible (as in, a PR to Home Assistant to add official Logi Circle support).
My projectâs here: https://github.com/evanjd/python-logi-circle
@sergeymaysak What are your ambitions? Maybe we should collaborate? I donât want to step on your toes if you had similar plans.