thrash.dev

docs / providers / home assistant

Providers · chapters · 23 of 25

← Yafmp manual

  1. Local Files
  2. Plex
  3. Navidrome
  4. Jellyfin
  5. Bandcamp
  6. Lidarr
  7. Apple Music
  8. Spotify
  9. SoundCloud
  10. YouTube Music
  11. SiriusXM
  12. Radio
  13. Podcasts
  14. AirPlay
  15. Chromecast
  16. MusicBrainz
  17. Discogs
  18. Labels
  19. Releases
  20. Last.fm
  21. ListenBrainz
  22. Connect
  23. Home Assistant
  24. MCP server
  25. DJ

Home Assistant

Home Assistant buttons and sensors drive Yafmp: EQ presets, compressor, play/pause, next.

facts

status
beta
kind
control
on by default
no
needs
Home Assistant server, Long-lived access token
platforms
iPhone, iPad, Mac, Vision Pro

Description

Home Assistant connects Yafmp to your Home Assistant server. It exists in the Apple edition only, and not on Apple TV.

It works in two directions:

  • Bindings. Yafmp follows entities you pick, such as buttons, remotes, sensors and switches. When one changes, Yafmp runs an action: play or pause, next, previous, the equalizer or compressor on or off, or a preset of either.
  • Buttons. Scripts, scenes, switches, lights and other entities you pick appear in a menu in Yafmp’s toolbar. Choosing one runs or toggles it in Home Assistant.

Yafmp creates nothing in Home Assistant. It does not appear there as a device or an entity.

Requirements

  • A Home Assistant server that the device can reach.
  • A long-lived access token from that server.

Setup

  1. In Home Assistant, open your profile, then Security → Long-lived access tokens, and create a token.
  2. In Yafmp, open Preferences → Plugins → Home Assistant and switch on Enabled.
  3. Enter the server’s address in Address, for example https://homeassistant.local:8123.
  4. Paste the token into Access Token and choose Connect. Status shows Connected.
  5. To react to an entity, choose Add Binding, then set Entity, When and Do.
  6. To run something from Yafmp, choose Add Button and pick the entity under Runs.

The house button appears in the toolbar once Yafmp is connected and at least one button is set.

Settings

SettingDefaultWhat it does
Address—The server’s address, with http:// or https://.
Access Token—The long-lived access token.
Connect—Saves the address and token and connects.
Server—The saved address. Read-only.
Status—Connected or Connecting…. Read-only.
Entityfirst entityThe entity a binding follows. Offered: buttons, input buttons, events, sensors, binary sensors, switches, input booleans, selects, input selects, scenes and scripts.
WhenemptyEmpty means any change. Otherwise the new state, or the event type of an event entity (for a remote: single, double…).
DoPlay / PauseThe action to run: Play / Pause, Next Track, Previous Track, Equalizer On/Off, Equalizer On, Equalizer Off, EQ Preset: …, Compressor On/Off, Compressor On, Compressor Off, Compressor Preset: ….
Add Binding—Adds a binding. The minus button beside a binding removes it.
Runsfirst entityThe entity a toolbar button runs. Offered: scripts, scenes, switches, lights, fans, input booleans, buttons, input buttons and automations.
Add Button—Adds an entry to the toolbar menu.
Sign Out—Forgets the address and token and disconnects.

Under each binding, Now: shows the entity’s current state. Choosing an EQ or compressor preset as the action also switches that effect on.

A toolbar button runs a script or scene, presses a button, triggers an automation, and toggles anything else. Switches and lights show a checkmark in the menu while they are on.

The token is kept in the system keychain. With iCloud Keychain on, the token and the address reach your other Apple devices. Bindings and buttons are set per device.

Limits

  • Apple edition only. Not on Apple TV, Android or the desktop.
  • Bindings only run while Yafmp is running and connected.
  • A binding fires on a change from a known state. It does not fire on the first report after connecting, or when an entity becomes unavailable or unknown.
  • Yafmp cannot be controlled from Home Assistant directly, because it adds no entity there. Use a binding on an entity that Home Assistant already has, such as a helper button.

Troubleshooting

ProblemWhyWhat to do
“Home Assistant refused the token”The token is wrong or was deletedChoose Sign Out, create a new long-lived access token and connect again.
Status stays on Connecting…The server is not reachable at that address; Yafmp retries every 10 secondsCheck the address, including http:// or https:// and the port.
“That address isn’t valid”The address is not a URLChoose Sign Out and enter the address again.
“Lost the connection to Home Assistant” when choosing a buttonThe connection droppedWait for Status to show Connected and try again.
No house button in the toolbarYafmp is not connected, or no button is setCheck Status, then choose Add Button.
A binding does not fireThe When text does not match the new state or event typeClear When to fire on any change, and compare with the Now: line.