Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add WB 2024 naming convention MQTT topics #13

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@

The basic abstractions are *devices* and their *controls*.

Each *device* has some *controls* assigned to it, i.e. parameters that can be controlled or monitored. *Devices* and *controls* are identified by names (arbitrary strings), and have some metadata. Metadata messages are published on device startup with `retained` flag set.
Each *device* has some *controls* assigned to it, i.e. parameters that can be controlled or monitored.
*Devices* and *controls* are identified by names, which are generally arbitrary strings.

Starting from 2024, WirenBoard has established the following rules for naming new device and control MQTT topics:
- The topic name cannot include punctuation, brackets, or special characters such as %$#& etc.
- For a new device, the topic name should not contain more than four words and numbers. Write each word in lowercase and separate them with underscores.
- For a new version of an existing device, make the topics compatible with the old pattern (marked as deprecated). The names of new topics should be styled identically to the existing topics.

Each MQTT topic has some metadata.
Copy link
Contributor

Choose a reason for hiding this comment

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

Не совсем корректно, метадата публикуется только в топиках .../meta и сабтопики к ней.

Metadata messages are published on device startup with `retained` flag set.
For example, some room lighting control *device* with one input (for wall switch) and one output (for controlling the lamp) *controls* is represented with MQTT topics as following:

* `/devices/RoomLight/meta` - JSON with all meta information about *device*
Expand Down