home-assistant/core · error · AlexaVideoActionNotPermittedForContentError

ACTION_NOT_PERMITTED_FOR_CONTENT

ACTION_NOT_PERMITTED_FOR_CONTENT

Error message

{entity} did not return the current media position.

What it means

Raised by the Alexa.SeekController handler: a relative seek needs the media player's current media position (media_position attribute) to compute the target, and it is missing or 0/None. Returned to Alexa as ACTION_NOT_PERMITTED_FOR_CONTENT.

Source

Thrown at homeassistant/components/alexa/handlers.py:1804

    return response


@HANDLERS.register(("Alexa.SeekController", "AdjustSeekPosition"))
async def async_api_seek(
    hass: ha.HomeAssistant,
    config: AbstractConfig,
    directive: AlexaDirective,
    context: ha.Context,
) -> AlexaResponse:
    """Process a seek request."""
    entity = directive.entity
    position_delta = int(directive.payload["deltaPositionMilliseconds"])

    current_position = entity.attributes.get(media_player.ATTR_MEDIA_POSITION)
    if not current_position:
        msg = f"{entity} did not return the current media position."
        raise AlexaVideoActionNotPermittedForContentError(msg)

    seek_position = max(int(current_position) + int(position_delta / 1000), 0)

    media_duration = entity.attributes.get(media_player.ATTR_MEDIA_DURATION)
    if media_duration and 0 < int(media_duration) < seek_position:
        seek_position = media_duration

    data: dict[str, Any] = {
        ATTR_ENTITY_ID: entity.entity_id,
        media_player.ATTR_MEDIA_SEEK_POSITION: seek_position,
    }

    await hass.services.async_call(
        MEDIA_PLAYER_DOMAIN,
        media_player.SERVICE_MEDIA_SEEK,
        data,
        blocking=False,
        context=context,

View on GitHub (pinned to 58a3fdb3ea)

Solutions

  1. Start playback so the player reports media_position, then seek
  2. Fix the integration/device to expose media_position (and update media_position_updated_at)
  3. Use absolute seek via the media_player.seek service instead of a delta
Defensive patterns

Strategy: validation

Validate before calling

state = hass.states.get(entity_id)
if not (state and state.attributes.get('media_position')):
    _LOGGER.warning('%s has no media_position; cannot seek', entity_id)
    return

Type guard

def player_reports_position(state) -> bool:
    return bool(state and state.attributes.get('media_position'))

Try / catch

Catch AlexaVideoActionNotPermittedForContentError and inform the user seeking is unavailable for this content.

Prevention

When it happens

Trigger: 'Alexa, skip forward 30 seconds' style AdjustPlaybackPosition directives when the media player state has no media_position attribute.

Common situations: Media is not actively playing (no position tracked); integration does not report media_position; stream/live content where position is undefined.

Related errors


AI-assisted analysis of home-assistant/core@58a3fdb3ea (2026-08-14). Data as JSON: /api/errors/d297c4745aeaf69b. Report an issue: GitHub.