Logi Circle camera with HASS

Thank you for the quick response!
I just did that and found this:

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 339, in _async_add_entity
    'Invalid entity id: {}'.format(entity.entity_id))
homeassistant.exceptions.HomeAssistantError: Invalid entity id: camera.

At first I thought this might have something to do with my naming, since I used Chinese characters during the first setup. So I changed it in the App, didnā€™t work.
Then I reset the camera using the App and gave it an ā€œEnglish-onlyā€ name, didnā€™t work.
Then I manually reset the Camera again by pressing the button for 9 seconds and even connecting it to another, new account and only use English characters to name it. Still the same message.
The Circle App and HomeKit are working fine though. Just home-assistant doesnā€™t seam to want to give it a name.

Hey, sorry about this @TTDARK. Looks like the Logi API wrapper (python-logi-circle) is returning an empty string to home assistant when querying its name. I have no idea why, though maybe the API behaves differently across different regions.

Without knowing the root cause, one change I can try is to have it use the cameraā€™s serial number or MAC address in place of its name if the name is empty. Iā€™ll post that after work today.

If that doesnā€™t work, Iā€™ll need your help to see what exactly Logiā€™s API is returning for your account (with anything sensitive scrubbed of course) to fix it properly.

This might also be fixed by switching to Logiā€™s official API, which I just got access to a few hours ago. It will however take a while to refactor the integration to use it.

OK @TTDARK , can you please go here: https://github.com/evanjd/hass-logi-circle/tree/regional_issues
Click the Clone or Download dropdown, then download ZIP. Place the contents in your custom_components folder (you will need to create it if it doesnā€™t already exist, create it inside your home assistant config directly).

Once done, restart and see if the camera works then? Theyā€™ll have an ugly UUID as their name, but you can easily rename it once the entities are functioning.

Thanks! It worked!


And I was also able to change the ā€œugly IDā€ afterwards!

Great! Iā€™ll try and make the integration more resilient to this problem in the next update.

Hi!

I ran into an issue this morning setting up the camera for some automation:

Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/logi_circle/camera.py", line 276, in get_livestream_image
image = _get_first_frame_from_video(segment_temp_file_path)
  File "/usr/local/lib/python3.6/site-packages/logi_circle/utils.py", line 92, in _get_first_frame_from_video
stderr=subprocess.DEVNULL
  File "/usr/local/lib/python3.6/subprocess.py", line 336, in check_output
**kwargs).stdout
  File "/usr/local/lib/python3.6/subprocess.py", line 418, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['ffmpeg', '-i', '/tmp/tmpve64bjsb', '-vf', 'select=eq(n\\,0)', '-q:v', '3', '-f', 'singlejpeg', '-']' died with <Signals.SIGSEGV: 11>.

This error occurs when triggering the service camera.logi_circle_livestream_snapshot from the hassio interface with the following service data:

{ "entity_id": "camera.inngang","filename":"/config/www/camera_test/test.jpg" }

The folder camera_test exists and hassio should be able to write to it since itā€™s an internal folder. Ie. whitelist_external_dirs shouldnā€™t be necessary.

Running hass.io 0.86.1 on a Rpi3. The camera works fine otherwise. I can see the picture and all sensors.
Got any ideas why this is happening? Should I enter this as an issue in the HA Github?

Kind regards, Vegard

@vegard Do you know how recently this started? That error means that ffmpeg is seg faulting when converting the 1st frame of the live stream snapshot into a jpeg, which isā€¦ strange. I wonder if hass.io has recently updated/changed ffmpeg.

For what itā€™s worth I canā€™t reproduce this issue on 0.81.6, though Iā€™m running home assistant via docker on my NAS, not hass.io on an rPi.

Running hass.io 0.86.1 on a Rpi3

I assume you mean 0.81.6?

0.81.6 :+1::grin:

I donā€™t know when this occurred. Somewhere between 0.7x and 0.81.6. My server crashed so I moved over from hassbian (in docker) to hass.ioon a pi3. Most of the automation was ditched and started over. So I am sorry I donā€™t have a better answer.

No problem. Might be worth raising an issue on github, this seems like more of a hassio problem than an issue with the logi circle integration (even with bad inputs, ffmpeg shouldnā€™t seg fault). But if you uncover anything that points to the integration being at fault please let me know.

I would like to ask if Logi Circle component supports two accounts being set up?
I have two accounts with different cameras. I can only set up one account on Home Assistant right now.

It supports only one account Iā€™m afraid. For what itā€™s worth I think the same constraint exists for most other integrations of this type, eg. nest, ring, etc.

1 Like

Firstly, thanks for getting the Logi Circleā€™s working with HA, I have two Circle 2ā€™s and the HA component is great. I just wondered (and Iā€™m only being impatient :P) if youā€™d had any luck in getting motion detection to work with the new API?

Iā€™d love to use mine in a couple of automations so would be great if you managed to get it working. If you do manage to get anywhere and want anything testing on the Circle 2ā€™s Iā€™d be more than happy to help.

I have, and it worked well in my limited testing. I also have live streams working from within the camera preview.

Unfortunately I canā€™t release anything until Logitech make their API available publicly. I asked when that might be but didnā€™t get a firm answer (ā€œhopefully soonā€). As soon as itā€™s released Iā€™ll get something out for you all to play with.

1 Like

Great news, thank you for letting me know. Looking forward to it!

@evanjd I guess you heard the news about the recent lockdown of the Logitech harmony API. Does this have any impact on the circle api?

Yeah, Iā€™m a harmony user too and was surprised to wake up a few days ago with all my integrations broken. :frowning:

No impact as far as I know. Iā€™m guessing Harmony and Circle teams operate independently and are run very differently, Circle has been nothing but supportive with me in getting the HASS integration on an officially supported API (good documentation, test hardware, responsive with e-mails, etc). Of course no formal commitment is made so they could change their minds at any time, but Iā€™m hopeful.

Logitech reached out and said Iā€™m allowed to direct you all to a form to request API access before the official OAuth2 portal is released, so thereā€™s no longer any blocker in releasing the updated version of the integration to you all.

Iā€™ll try and get something out as soon as I can. I have very little spare time right now on a count of sick kids, upcoming Christmas holiday, etc so give me approx 3-4 weeks to test and tidy up what Iā€™ve got implemented so far.

3 Likes

Hi all,

Iā€™ve raised PRs for Home Assistant that updates the integration to use the public API and all the goodness that entails.

Unfortunately the updated component does not work in the custom_components folder (conflicts occur between the old logi circle implementation and the custom component), so youā€™ll either need to build/run home assistant from my PR or wait until the update is merged + released.

It comes with a lot of breaking changes, summarised in the PR: https://github.com/home-assistant/home-assistant/pull/20179. Any existing logi_circle configuration in your config yaml will need to be removed.

You can see a preview of the updated documentation here, including the process for requesting API access (youā€™ll want to do this BEFORE upgrading as it takes a few days for Logitech to issue API access).

1 Like

Fantastic!
The url , for example, https://homeassistant.local, need to be the local url or could be the duckdns.org url?
Iā€™m running hassos, do I need to upgrade the ffmpeg?

The url , for example, https://homeassistant.local, need to be the local url or could be the duckdns.org url?

Doesnā€™t matter whether itā€™s local or remote, so long as you can access it and it listens on HTTPS.

Iā€™m running hassos, do I need to upgrade the ffmpeg?

Never used it, but I assume HassOS still runs the hass docker container. If so, yes. But you can upgrade ffmpeg without messing with the container, Iā€™ve included instructions for that here.