Last.fm

The Last.fm integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] lets you monitor the listening activity of Last.fm users. It creates a sensor for each user you add, showing whether they are currently scrobbling and what they are listening to.

Prerequisites

  • A Last.fm account.
  • A Last.fm API key. You can create one by registering an API account on the Last.fm website.

Configuration

To add the Last.fm service to your Home Assistant instance, use this My button:

Manual configuration steps

If the above My button doesn’t work, you can also perform the following steps manually:

API key

The API key from your Last.fm API account.

Last.fm username

Your Last.fm username. This is the main user for the integration and is used to look up your friends list in the next step.

After entering your API key and Last.fm username, you are asked to select additional Last.fm users to track. Your friends list is shown for convenience, but you can also enter any Last.fm username manually.

Configuration options

To add or remove tracked users after setup, go to Settings > Devices & services, select the Last.fm integration, and select Configure.

Last.fm usernames

The Last.fm users to track. You can select from your friends list or enter usernames manually.

Supported functionality

Sensors

The integration creates one sensor per tracked Last.fm user.

  • State: The currently playing track, formatted as “Artist - Title”. When the user is not listening, the state is “Not Scrobbling”.
  • Entity picture: The user’s Last.fm avatar.

Each sensor also provides the following attributes:

  • last_played: The last track the user scrobbled, formatted as “Artist - Title”.
  • play_count: The total number of tracks the user has scrobbled on Last.fm.
  • top_played: The user’s most played track, formatted as “Artist - Title”.

Data updates

The integration pollsData polling is the process of querying a device or service at regular intervals to check for updates or retrieve data. By defining a custom polling interval, you can control how frequently your system checks for new data, which can help optimize performance and reduce unnecessary network traffic. [Learn more] Last.fm every 30 seconds for updated listening data.

Removing the integration

This integration follows standard integration removal. No extra steps are required.

To remove an integration instance from Home Assistant

  1. Go to Settings > Devices & services and select the integration card.
  2. From the list of devices, select the integration instance you want to remove.
  3. Next to the entry, select the three dots menu. Then, select Delete.