ad-media-lights-sync icon indicating copy to clipboard operation
ad-media-lights-sync copied to clipboard

ValueError("A relative URL was received on '{entity}.{attribute}'.

Open Dean98T opened this issue 1 year ago • 1 comments

In the logs for the AppDaemon app whenever I run this, as soon as the Spotify entity picture changes, with it being a relative URL, I get the following error message:

  File `/config/apps/media_lights_sync.py`, line 174, in format_url
    raise ValueError("A relative URL was received on '{entity}.{attribute}'.\nha_url must be specified in the configuration for relative URLs.".format(
ValueError: A relative URL was received on 'media_player.spotify_dean_taylor.entity_picture'.
ha_url must be specified in the configuration for relative URLs.

CONFIG:

APP

media_lights_sync:
  module: media_lights_sync
  class: MediaLightsSync
  media_player: media_player.spotify_dean_taylor
  lights:
    - light.left_lamp
    - light.right_lamp
    - light.office_light
  ha_url: http://homeassistant.local:8123/
  reset_lights_after: true
  use_saturated_colors: false
  use_current_brightness: false

APPDAEMON

appdaemon:
  latitude: *
  longitude: *
  elevation: 30
  time_zone: Europe/London
  plugins:
    HASS:
      type: hass
      ha_url: http://homeassistant.local:8123/
      token: *

Dean98T avatar Sep 25 '24 22:09 Dean98T

You are receiving this error because your ha_url does not seems to be recognized by the script. This error will only be thrown if if not is_absolute and self.ha_url is None (ref)

Could you try restarting your AppDaemon?

Or maybe try switching it up for your server IP address: ha_url: http://192.168.0.199:8123/

ericmatte avatar Oct 30 '24 17:10 ericmatte