Repository navigation
Reference Websocket Api
The integration registers these Home Assistant websocket commands. They are what the card and the editor use, and you can use them from scripts or from the developer tools of your browser. Commands marked admin are refused for non-admin users.
Every command follows the usual websocket convention: send {"id": <n>, "type": "...", ...}, receive {"id": <n>, "type": "result", "success": true, "result": ...} or "success": false with an error object.
Returns the stored plan; {} before the first save. Not restricted to admins.
{"id": 1, "type": "fns_floorplan/plan/get"}{"id": 1, "type": "result", "success": true, "result": {"rev": 7, "rooms": [], "levels": []}}Sends the plan immediately and again after every save. This is how open cards redraw by themselves.
{"id": 2, "type": "fns_floorplan/plan/subscribe"}{"id": 2, "type": "result", "success": true, "result": null}
{"id": 2, "type": "event", "event": {"rev": 7, "rooms": []}}Admin. Replaces the whole plan. Always read the current plan first and send it back with your changes.
{"id": 3, "type": "fns_floorplan/plan/save", "plan": {"rooms": [], "levels": []}, "rev": 7}{"id": 3, "type": "result", "success": true, "result": {"ok": true, "rev": 8}}Every save stores the plan with rev increased by one. When the request contains rev, the save only succeeds if it equals the stored revision. Otherwise you get an error and nothing is written:
{"id": 3, "type": "result", "success": false,
"error": {"code": "conflict", "message": "The plan changed meanwhile (revision 8)"}}Without rev the save always overwrites (useful for imports). The previous plan is pushed to the history first, when it contained rooms. If the integration is not set up, the error code is not_loaded.
Admin. Lists the last 20 saved revisions, newest first.
{"id": 4, "type": "fns_floorplan/history/list"}{"id": 4, "type": "result", "success": true, "result": [
{"rev": 7, "saved_at": "2026-10-04T12:00:00+00:00", "rooms": 3, "items": 12}
]}items counts furniture, devices, sensors and texts.
Admin. Returns one stored plan by its revision, or the error not_found.
{"id": 5, "type": "fns_floorplan/history/get", "rev": 7}Admin. Parses YAML text with Home Assistant's own loader. An error has the code invalid_yaml.
{"id": 6, "type": "fns_floorplan/yaml/parse", "text": "- if:\n - entity: light.x\n state: 'on'\n color: red"}{"id": 6, "type": "result", "success": true, "result": {"data": [{"if": [{"entity": "light.x", "state": "on"}], "color": "red"}]}}Admin. The opposite: data (a list or an object) to YAML text.
{"id": 7, "type": "fns_floorplan/yaml/dump", "data": [{"color": "red"}]}{"id": 7, "type": "result", "success": true, "result": {"text": "- color: red\n"}}Floor tracing images are not uploaded over the websocket but through an HTTP endpoint of the integration. It needs an admin user's access token.
| Method | URL | Body | Result |
|---|---|---|---|
POST |
/api/fns_floorplan/background |
multipart form: level (floor id), file (png, jpg, jpeg, webp or svg, at most 15 MB) |
{"url": "/local/fns_floorplan/bg_<level>.<ext>?v=<timestamp>"} |
DELETE |
/api/fns_floorplan/background?level=<id> |
none | {"ok": true} |
The file is stored in www/fns_floorplan/bg_<level>.<ext> (a new upload replaces the old one of that floor). Errors: 403 for non-admins, 400 for an unsupported type, 413 for a file that is too large. The returned url goes into backgrounds[level].url of the plan, which is then saved with plan/save.
curl -X POST -H "Authorization: Bearer $TOKEN" \
-F level=0 -F file=@floor.png \
http://homeassistant.local:8123/api/fns_floorplan/backgroundSee also the Plan format.
Documentation site | Repository | Issues | Support: Ko-fi · PayPal · Bitcoin
English
- FNS Floorplan – help
- Installation
- Quick start
- Editor overview
- Rooms
- Doors and windows
- Items
- Rules
- Look
- Card
- Room panel
- Robot vacuum
- History and check
- Plan format
- Websocket API
- FAQ and troubleshooting
- Changelog
- The card is not found after the installation
- "Custom element doesn't exist" or a configuration error appears
- Icons are missing
- Some texts are not translated
- A light does not glow in the colour I expect
- The card shows the old version after an update
- The card is slow or choppy
- Saving says the plan changed meanwhile (conflict)
- The plan is empty
- A rule does not apply
- The sidebar entry is missing
- Something else does not work
- The card says it is waiting for the integration
- Support
Česky
- FNS Floorplan – nápověda
- Instalace
- Rychlý start
- Přehled editoru
- Místnosti
- Dveře a okna
- Položky
- Pravidla
- Vzhled
- Karta
- Panel místnosti
- Robotický vysavač
- Historie a kontrola
- Formát plánu
- Websocket API
- Časté otázky a řešení potíží
- Změny
- Po instalaci se karta nenajde
- Občas se objeví „Custom element doesn't exist“ nebo chyba konfigurace
- Chybí ikony
- Některé texty se nepřekládají
- Světlo nesvítí v barvě, kterou čekám
- Po aktualizaci karta zobrazuje starou verzi
- Karta se seká nebo je pomalá
- Při ukládání se hlásí, že se půdorys mezitím změnil (konflikt)
- Půdorys je prázdný
- Pravidlo se neuplatní
- V postranním menu chybí položka
- Něco jiného nefunguje
- Karta hlásí, že čeká na integraci
- Podpora
Deutsch
- FNS Floorplan – Hilfe
- Installation
- Schnellstart
- Editor-Übersicht
- Räume
- Türen und Fenster
- Elemente
- Regeln
- Aussehen
- Karte
- Raum-Panel
- Saugroboter
- Verlauf und Prüfung
- Planformat
- Websocket-API
- Häufige Fragen und Fehlerbehebung
- Änderungen
- Die Karte wird nach der Installation nicht gefunden
- „Custom element doesn't exist“ oder ein Konfigurationsfehler erscheint
- Symbole fehlen
- Einige Texte werden nicht übersetzt
- Ein Licht leuchtet nicht in der erwarteten Farbe
- Die Karte zeigt nach einem Update die alte Version
- Die Karte ruckelt oder ist langsam
- Beim Speichern heißt es, der Plan habe sich inzwischen geändert (Konflikt)
- Der Plan ist leer
- Eine Regel greift nicht
- Der Seitenleisten-Eintrag fehlt
- Etwas anderes funktioniert nicht
- Die Karte meldet, dass sie auf die Integration wartet
- Unterstützung
Polski
- FNS Floorplan – pomoc
- Instalacja
- Szybki start
- Przegląd edytora
- Pomieszczenia
- Drzwi i okna
- Elementy
- Reguły
- Wygląd
- Karta
- Panel pomieszczenia
- Odkurzacz
- Historia i kontrola
- Format planu
- Websocket API
- FAQ i rozwiązywanie problemów
- Lista zmian
- Karta nie jest znaleziona po instalacji
- Pojawia się „Custom element doesn't exist” lub błąd konfiguracji
- Brakuje ikon
- Niektóre teksty nie są przetłumaczone
- Światło nie świeci w kolorze, jakiego oczekuję
- Karta pokazuje starą wersję po aktualizacji
- Karta działa wolno lub się zacina
- Zapis zgłasza, że plan w międzyczasie się zmienił (konflikt)
- Plan jest pusty
- Reguła nie działa
- Brakuje pozycji w pasku bocznym
- Coś innego nie działa
- Karta pisze, że czeka na integrację
- Wsparcie