Skip to content
This repository was archived by the owner on Apr 21, 2026. It is now read-only.
This repository was archived by the owner on Apr 21, 2026. It is now read-only.

Error while setting up mediarr platform for sensor: cannot access local variable 'tmdb_config' #19

Description

@dertbv

Trying this for the first time and getting stuck trying to get it set u. I have installed it and made the following changes to my configuration.yaml.

sensor:

  • platform: mediarr
    seer:
    url: http://192.168.1.3:5055
    api_key: MTY4OTXXXXXXXXZTYtNDXXXXXXX
    max_items: 45 #example how many items you want in sensor, you can chosse a different amount in card
    tmdb_api_key: 0XXXXXXXXXX
    trending: true # Optional
    discover: true # Optional
    popular_movies: false # Optional, recommended to use tmdb for popular
    popular_tv: false # Optional, recommended to use tmdb for popular

    plex: # Optional
    url: http://192.168.1.3:32400
    token: XXXXXXX
    max_items: 45 #example how many items you want in sensor, you can chosse a different amount in card
    tmdb_api_key: 0XXXXXXXXXXXXXXX
    language: en #default

    sonarr: # Optional
    url: http://192.168.1.3:8989
    api_key: XXXXXXXXXX
    max_items: 45 #example how many items you want in sensor, you can chosse a different amount in card
    days_to_check: 60 #example

    radarr: # Optional
    url: http://192.168.1.3:7878
    api_key: bXXXXXXXXXXXXxxx
    max_items: 45 #example how many items you want in sensor, you can chosse a different amount in card
    days_to_check: 60 #breaking change

    Logger: homeassistant.components.sensor
    Source: helpers/entity_platform.py:382
    integration: Sensor (documentation, issues)
    First occurred: 10:10:37 PM (1 occurrences)
    Last logged: 10:10:37 PM

On restart i get the following in my logs ..

Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:382
integration: Sensor (documentation, issues)
First occurred: 10:10:37 PM (1 occurrences)
Last logged: 10:10:37 PM

  Error while setting up mediarr platform for sensor: cannot access local variable 'tmdb_config' where it is not associated with a value
  Traceback (most recent call last):
    File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in _async_setup_platform
      await asyncio.shield(awaitable)
    File "/config/custom_components/mediarr/sensor.py", line 93, in async_setup_platform
      if tmdb_config.get(endpoint, False):
         ^^^^^^^^^^^
  UnboundLocalError: cannot access local variable 'tmdb_config' where it is not associated with a value

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions