[Custom component] Bird Buddy smart bird feeder

I am constantly getting this error when running the Bird Buddy Postcard Collection Blueprint. Any ideas as to how i can resolve getting this error? The integration seems to be working as it should.

``

Logger: homeassistant.components.automation.bird_buddy_postcard_collection
Source: components/automation/__init__.py:718
integration: Automation (documentation, issues)
First occurred: January 10, 2025 at 5:41:48 PM (6 occurrences)
Last logged: 4:54:36 PM

While executing automation automation.bird_buddy_postcard_collection
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 718, in async_trigger
    return await self.action_script.async_run(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        variables, trigger_context, started_action
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1801, in async_run
    return await asyncio.shield(create_eager_task(run.async_run()))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 464, in async_run
    await self._async_step(log_exceptions=False)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 528, in _async_step
    self._handle_exception(
    ~~~~~~~~~~~~~~~~~~~~~~^
        ex, continue_on_error, self._log_exceptions or log_exceptions
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 558, in _handle_exception
    raise exception
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 526, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 764, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<9 lines>...
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 727, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2795, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2838, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/birdbuddy/__init__.py", line 106, in handle_collect_postcard
    await coordinator.handle_collect_postcard(service.data)
  File "/config/custom_components/birdbuddy/coordinator.py", line 144, in handle_collect_postcard
    success = await self.client.finish_postcard(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<5 lines>...
    )
    ^
  File "/usr/local/lib/python3.13/site-packages/birdbuddy/client.py", line 456, in finish_postcard
    for sighting, mod in report.sighting_finishing_strategies(
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        confidence_threshold
        ^^^^^^^^^^^^^^^^^^^^
    ).values():
    ^
  File "/usr/local/lib/python3.13/site-packages/birdbuddy/sightings.py", line 207, in sighting_finishing_strategies
    matches = self.highest_confidence_matches
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/birdbuddy/sightings.py", line 251, in highest_confidence_matches
    i["matchToken"]: max(
                     ~~~^
        (ii for ii in i["items"] if ii["type"] == "BIRD"),
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        key=lambda x: x["confidence"],
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
ValueError: max() iterable argument is empty

Hmm, looks like you’re running a quite old version of the integration. That was fixed in Nov 2023 :flushed:

Please try updating to the latest version (v0.0.21)

Thank you for the help. I have installed the most current version and now I am waiting for the birds. Question: have you been able to access the live-stream with HA yet. I was just reading an AI response that says it is working in this HA integration.

No, there is no plan to access the live stream in HA - that was an AI hallucination.

The Bird Buddy is not designed for 24/7 live streaming. The ability to check the live camera from the BB app is only for troubleshooting purposes, so you can confirm connectivity and visual placement. While in this mode, the BB will not function as it usually does; and it will drain the battery if you try to leave it streaming.

Should I be getting the errors below from the Blueprint Automation collect_postcard.yaml:. Are these errors fatal?

I’ve never seen this, as I didn’t edit the blueprint in VS Code since creating it.

If you look at the blueprint selectors documentation, it appears that, e.g. sort: false, IS valid. Though it also looks like sort=false is the default, so you could also just remove that.

To resolve the first error, it looks like it wants a list:

selector:
  device:
    - integration: birdbuddy
  multiple: false

So multiple gets unindented to the same level as device; and integration line adds a - array item notation.

Thank you Joe. Appreciate you looking at it. I will make the changes. Btw, upgrading fixed the problems i was having so thank you for that as well.