docs / providers / home assistant
Providers · chapters · 23 of 25
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
- In Home Assistant, open your profile, then Security → Long-lived access tokens, and create a token.
- In Yafmp, open Preferences → Plugins → Home Assistant and switch on Enabled.
- Enter the server’s address in Address, for example
https://homeassistant.local:8123. - Paste the token into Access Token and choose Connect. Status shows Connected.
- To react to an entity, choose Add Binding, then set Entity, When and Do.
- 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
| Setting | Default | What 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. |
| Entity | first entity | The entity a binding follows. Offered: buttons, input buttons, events, sensors, binary sensors, switches, input booleans, selects, input selects, scenes and scripts. |
| When | empty | Empty means any change. Otherwise the new state, or the event type of an event entity (for a remote: single, double…). |
| Do | Play / Pause | The 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. |
| Runs | first entity | The 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
unavailableorunknown. - 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
| Problem | Why | What to do |
|---|---|---|
| “Home Assistant refused the token” | The token is wrong or was deleted | Choose 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 seconds | Check the address, including http:// or https:// and the port. |
| “That address isn’t valid” | The address is not a URL | Choose Sign Out and enter the address again. |
| “Lost the connection to Home Assistant” when choosing a button | The connection dropped | Wait for Status to show Connected and try again. |
| No house button in the toolbar | Yafmp is not connected, or no button is set | Check Status, then choose Add Button. |
| A binding does not fire | The When text does not match the new state or event type | Clear When to fire on any change, and compare with the Now: line. |