core icon indicating copy to clipboard operation
core copied to clipboard

Pairing drops the zones set up before it without a word, and saving such a zone brings it back

Open sebastienfouss opened this issue 5 days ago • 1 comments

The problem

A zone set up in the admin UI before pairing with a Miniserver (its output chosen, its settings) is dropped at the Miniserver's first config push when the Loxone player has another id, and the player's zone starts with no output. Nothing says so: no line in the logs, nothing in the admin UI. Met on a first install (an earlier dev): the zone made before pairing (id 1) gave way to Loxone's player 5 with no output, so nothing played through it from then on.

Then, from an admin UI page open since before pairing and still listing zone 1, saving the output on that zone brought zone 1 back, with no name and no Loxone identity, beside Loxone's zones. POST /config/zones appends a zone id it does not know, while POST /config/zones/create and DELETE /config/zones/<id> refuse with 409 loxone-managed when Loxone manages the zones.

Reproduced

On dev at 344ff787, calling the code directly:

buildZoneConfigs([{ id: 5, name: 'Living room' }], [{ id: 1, name: 'Living', output: { id: 'sonos', … } }])
  → [{ id: 5, name: 'Living room', output: null }]

with loxoneEnabled: true
POST /config/zones/create { name: 'Kitchen' }             → 409 {"error":"loxone-managed"}
POST /config/zones { zones: [{ id: 1, output: { … } }] }  → 204; zones: [{ id: 5, … }, { id: 1, name: null }]

Why

  • buildZoneConfigs (loxoneZoneExtractor.ts) keys the zones by Loxone player id, keeps the settings of an id the Miniserver still lists and drops the others, as its comment says. LoxoneConfigService.extractZonesFromPayload logs nothing about what was dropped.
  • handleZonesUpdate (configHandlers.ts) pushes a zone whose id is not in the config, with no loxoneEnabled check, unlike handleZoneCreate and handleZoneDelete.

Suggestions

  1. Log each zone a push drops, at warn level, with its output; perhaps also keep its settings aside, or carry them over when the push brings exactly one new zone in place of exactly one dropped.
  2. In POST /config/zones, when Loxone manages the zones, refuse (or skip) a zone id the config does not have, as create and delete do.
  3. A line in the pairing docs: pair first, then set up the zones the Miniserver pushes.

sebastienfouss avatar Nov 30 '26 11:11 sebastienfouss

Fixed on dev:

  • 22f5c54: when a push brings in exactly one new player in place of exactly one zone made here, that zone keeps its setup (output, receivers, volumes) under the new id. Every zone a push drops is now logged as a warning, with its output.
  • e196680: with Loxone managing the zones, POST /config/zones refuses a zone the config does not have with 409 loxone-managed, same as create and delete.

rudyberends avatar Nov 30 '26 14:11 rudyberends