[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.

Can someone tell me what this error means when adding the same URL?

I got it working with double quotes. i restarted my HA, it stopped working. I went to set up camera agian it keeps telling me

Relative URLs are not allowed

Please helpppp

Generic Camera (especially with the UI config flow) does not work nicely with template URLs. And especially if the template does not currently resolve to a usable URL. Test your template in the developer tools screen, and check if it evaluates to a real URL and that you can view the image using that URL. If it’s reporting None or some other non-URL, then the generic camera config flow will NOT accept it. That’s because the config flow will show the image from that URL and requires that you confirm the image before you can finish setup.

Alternatively you could try to add it directly to configuration.yaml, which used to work, but not sure if it still does.

Finally, the image entity is still sitting in an open PR, because I’m not entirely happy with it yet. When the recent visitor entity_picture is working, the image entity also appears to be working. It’s just a little unpredictable, particularly when there hasn’t been a visitor in several days. If you’re interesting in testing out the PR, you can run the action yaml mentioned here. That will install the PR version, and when you restart HA you should have a new image entity, and you won’t need the Generic Camera workaround anymore.

@madcoder

Generic Camera (especially with the UI config flow) does not work nicely with template URLs.

Do you have an example of a template URL that is not working correctly with generic camera? It is intended to handle these.

When you enter URLs during the config flow, the following checks happen:

  1. Templates are rendered, and a check is done to make sure that there is a valid image or stream at the other end of the resulting URL.
  2. The config flow attempts to load a preview of the image and/or stream. You can ignore these if you like by clicking ‘everything looks good’, even if it doesn’t. This will finish the config flow.

But you are correct that 1. will not succeed if the URLs are not valid. This logic is to catch problems caused by people entering the URL of an HTML page which embedded an image/stream rather than the actual raw image/stream URL. In a lot of cases users did not understand the difference.

configuration.yaml setup of cameras is not supported any more. I don’t know what happens if you try it.

If you have a specific use-case that isn’t working, please describe it or raise as a bug ticket and I will help where I can.

Nope, that’s exactly what I was referring to. Since the template won’t evaluate to a valid URL unless there is an image to show, so if you try to enter the template while the attribute is not set or after the signed URL has expired, then it prevents you from setting it up. Once there’s a valid image URL in the attribute then it will work and will remain valid from then on. That’s what I meant by that.

Would be nice if there were a “yes I know this isn’t a valid URL, but save it anyway” override.

Anyway, the right solution here is the image entity, which is what’s in progress now and will be released eventually

Hey guys I just got a bird buddy soley because my knock off wouldn’t let guests and or HA get the pictures so this is VERY exciting. I am connected to the birdbuddy and it seems good however I don’t get media. I have a section in the media browser for birdybuddy but nothing is in there. Can someone point me in the right direction what I might have missed in the process of installing this and setting it up? Thanks!

Do you see your bird buddy account listed when you open bird buddy in the media browser? If there are no images there after selecting your BB account, that usually means you have no saved media in your BB collections.

Did you create and invite a separate account to join your feeder? If so, note that media collections are per-account, not per-feeder. So to save media to those collections you need to save the “postcards” as they arrive at the feeder.

The image entity only presents the most recent visitor, it doesn’t automatically save to the media browser. If you look in the GitHub repo, there is a blueprint you can use in an automation to save postcards when they arrive.

When I go in to media and bird buddy I see my camera name and that is it. Once I drill down to that there is nothing - it says no items. I did send an invite to my wife. Is there a way to avoid the need to save the postcards and have them auto populated?

Only with the blueprint like I mentioned. It requires action in order to save media – either in the BB app, or with the blueprint.

Ok I have a question is there a way in the bird buddy app that I can save a picture and it would show up in Home Assistant then just to test - in other words without implementing the blueprint?

Thanks!

Ok I got that working with the saving in the app and it appears in Home Assistant - this is great. Sorry I am very new to this device and its App. Now I need to figure out where that blueprint is to make that works. Thanks again!

1 Like

The blueprint can be found here: GitHub - jhansche/ha-birdbuddy: Home Assistant integration for Bird Buddy smart bird feeders

im getting this error in my logs now:

Error fetching birdbuddy data: 502, message=‘Attempt to decode JSON with unexpected mimetype: text/html’, url=‘https://graphql.app-api.prod.aws.mybirdbuddy.com/graphql’

Ok I am getting some of the postcards but not all and I still get the error:

Logger: custom_components.birdbuddy
Source: helpers/update_coordinator.py:414
integration: Bird Buddy (documentation, issues)
First occurred: July 17, 2025 at 12:52:16 PM (12 occurrences)
Last logged: 8:52:47 AM

  • Error fetching birdbuddy data: 502, message=‘Attempt to decode JSON with unexpected mimetype: text/html’, url=‘https://graphql.app-api.prod.aws.mybirdbuddy.com/graphql’
  • Error fetching birdbuddy data: INTERNAL_SERVER_ERROR: {‘message’: ‘Internal server error.’, ‘locations’: [{‘line’: 2, ‘column’: 3}], ‘path’: [‘sightingCreateFromPostcard’], ‘extensions’: {‘code’: ‘INTERNAL_SERVER_ERROR’, ‘errorId’: ‘b5bcfcdb-bd59-47e8-91c6-f74b474d5426’}}
  • Error fetching birdbuddy data: INTERNAL_SERVER_ERROR: {‘message’: ‘Internal server error.’, ‘locations’: [{‘line’: 2, ‘column’: 3}], ‘path’: [‘sightingCreateFromPostcard’], ‘extensions’: {‘code’: ‘INTERNAL_SERVER_ERROR’, ‘errorId’: ‘534bbe24-2fd5-4d55-bc76-f2bd2ff1749f’}}
  • Error fetching birdbuddy data: INTERNAL_SERVER_ERROR: {‘message’: ‘Internal server error.’, ‘locations’: [{‘line’: 2, ‘column’: 3}], ‘path’: [‘sightingCreateFromPostcard’], ‘extensions’: {‘code’: ‘INTERNAL_SERVER_ERROR’, ‘errorId’: ‘91a9bfe0-ac8d-4c93-a167-93ad6737eeb9’}}
  • Error fetching birdbuddy data: INTERNAL_SERVER_ERROR: {‘message’: ‘Internal server error.’, ‘locations’: [{‘line’: 2, ‘column’: 3}], ‘path’: [‘sightingCreateFromPostcard’], ‘extensions’: {‘code’: ‘INTERNAL_SERVER_ERROR’, ‘errorId’: ‘2b880acb-2f31-4e7e-84c4-0bc1f83594dd’}}

Any today im getting this error:

Logger: homeassistant.components.automation.bird_buddy_collect_postcard
Source: components/automation/__init__.py:717
integration: Automation (documentation, issues)
First occurred: July 21, 2025 at 5:17:17 PM (10 occurrences)
Last logged: 3:00:02 PM

While executing automation automation.bird_buddy_collect_postcard
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 717, in async_trigger
    return await self.action_script.async_run(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        variables, trigger_context, started_action
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1836, in async_run
    return await asyncio.shield(create_eager_task(run.async_run()))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 460, in async_run
    await self._async_step(log_exceptions=False)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 526, 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 556, in _handle_exception
    raise exception
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 524, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1012, in _async_step_call_service
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<9 lines>...
    )
    ^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 624, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2799, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2842, 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 126, in handle_collect_postcard
    strategy = SightingFinishStrategy(data.get("strategy", "recognized"))
  File "/usr/local/lib/python3.13/enum.py", line 726, in __call__
    return cls.__new__(cls, value)
           ~~~~~~~~~~~^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/enum.py", line 1201, in __new__
    raise ve_exc
ValueError: 'all' is not a valid SightingFinishStrategy```