Skip to content

DALI: warn about DALI-2 instances whose events cannot be attributed - #1227

Open
evgeny-boger wants to merge 2 commits into
masterfrom
split/dali-event-scheme-guard
Open

DALI: warn about DALI-2 instances whose events cannot be attributed#1227
evgeny-boger wants to merge 2 commits into
masterfrom
split/dali-event-scheme-guard

Conversation

@evgeny-boger

@evgeny-boger evgeny-boger commented Aug 31, 2026

Copy link
Copy Markdown
Member

Что сделано

IEC 62386-103, табл. 8: только схема адресации событий «короткий адрес устройства и номер компонента» (значение 2) кладёт в кадр события и адрес отправителя, и номер компонента — единственная комбинация, которую демон может атрибутировать устройству. Датчик с другой схемой (заводская — «тип и номер компонента») шлёт события, которые в мониторе шины декодируются, но контролы не обновляют: «Освещённость» навсегда 0, выглядит как баг опроса и диагностируется очень тяжело (SOFT-7398, реальный Tridonic MSensor с 18 такими компонентами).

Страница устройства DALI-2 показывает предупреждение для таких компонентов и кнопку «Установить рекомендуемую схему»: переписывает event_scheme у всех проблемных инстансов и сохраняет.

  • ATTRIBUTABLE_EVENT_SCHEME / wrongSchemeInstances() — чистая функция над конфигом устройства, экспортирована;
  • InstanceConfig в types.ts, CSS баннера в одну строку с переносом на узких экранах;
  • ключи event-scheme-warning, fix-event-schemes в en/ru.

Тесты

scheme-instances.test.ts — какие инстансы считаются проблемными (только числовая event_scheme ≠ 2, только ключи instanceN). tsc, eslint, vitest по каталогу DALI — чисто.

Задача: SOFT-7398

Скриншоты

Стенд WB8 с реальным WB-DALI: панель кнопок wb-dali_1_bus_1_dali2_0 на шине 1, все шесть компонентов «Кнопка» изначально на рекомендуемой схеме. Компонент 0 переключён на «тип и номер компонента» (схема 0, заводская) и сохранён — предупреждение появилось. После нажатия кнопки в баннере повторное чтение параметров с шины вернуло схему 2 на всех шести компонентах, то есть кнопка пишет в устройство, а не только в форму.

Панель кнопок DALI-2, у компонента 0 сохранена схема «тип и номер компонента» — предупреждение и кнопка исправления

Панель кнопок DALI-2, у компонента 0 сохранена схема «тип и номер компонента» — предупреждение и кнопка исправления

То же самое в английской локали

То же самое в английской локали

После «Установить рекомендуемую схему»: предупреждения нет, схема — «короткий адрес устройства и номер компонента», «Сохранить» неактивна

После «Установить рекомендуемую схему»: предупреждения нет, схема — «короткий адрес устройства и номер компонента», «Сохранить» неактивна

🤖 Generated with Claude Code

…uted

IEC 62386-103 Table 8: only the "device short and instance number" event
scheme puts both the sender's short address and the instance number into an
event frame — the only combination the daemon can attribute to a device. A
sensor left in another scheme (the factory default is "instance type and
number") sends events that decode fine in the bus monitor yet update nothing
— Illuminance stays 0 forever, and it reads as a polling bug (SOFT-7398).

The device page now shows a warning for such instances with a one-click
"Set recommended scheme" that rewrites every offending instance and saves.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 duplication

Metric Results
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

It had been inserted at the wrong "retry" anchor and sat in the
svg-dashboard block, so the button rendered the raw key.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@evgeny-boger
evgeny-boger marked this pull request as ready for review September 3, 2026 23:37
@evgeny-boger
evgeny-boger requested a review from a team as a code owner September 3, 2026 23:37
@evgeny-boger
evgeny-boger requested a review from KraPete September 3, 2026 23:37
Comment thread debian/changelog
@@ -1,3 +1,11 @@
wb-mqtt-homeui (2.250.1) stable; urgency=medium

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Странная версия

Comment thread debian/changelog
name the sender gets a warning with a one-click "Set recommended scheme" — such
events decode in the bus monitor but could never update the controls (SOFT-7398)

-- Wiren Board Robot <info@wirenboard.com> Mon, 31 Aug 2026 20:10:00 +0300

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Точно надо робота писать, а не тебя?

import type { ResetMode } from './types';
import type { InstanceConfig, ResetMode } from './types';

// IEC 62386-103 Table 8: only the "device short and instance number" scheme

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Очень длинное описание

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants