schema_example.json
What is the purpose of schema_example.json?
This file is a contract between the Unit Developer and Pepeunit:
- The Unit Developer guarantees that the Unit implements the standard Pepeunit topics listed in schema_example.json:
input_base_topicandoutput_base_topic. - The Unit Developer guarantees that
input_topicandoutput_topicwork according to the description they provide in the Readme. - Pepeunit guarantees correct interaction with the standard
input_base_topicandoutput_base_topictopics. - Pepeunit guarantees that it will maintain an up‑to‑date set of UnitNodes based on
input_topicandoutput_topicspecified by the developer in schema_example.json, for every Unit version.
Structure
json
{
"input_base_topic": [
"update/pepeunit",
"env_update/pepeunit",
"schema_update/pepeunit",
"log_sync/pepeunit"
],
"output_base_topic": [
"state/pepeunit",
"log/pepeunit"
],
"input_topic": [
"set_fan_state/pepeunit"
],
"output_topic": [
"current_fan_speed_percentage/pepeunit",
"current_temp/pepeunit"
]
}There are exactly 4 topic types in schema_example.json:
| Topic type | Description | Details |
|---|---|---|
input_base_topic | Standard MQTT command topics the Unit can handle | Standard MQTT commands |
output_base_topic | Standard data publication topics where the Unit can send data | Standard MQTT state topics |
input_topic | Input topics of the Unit Developer. Pepeunit uses them as templates to create Input UnitNodes | Developer topics |
output_topic | Output topics of the Unit Developer. Pepeunit uses them as templates to create Output UnitNodes | Developer topics |
INFO
When using client libraries for Micropython, Golang, or Python, you can include all topics from input_base_topic and output_base_topic; they will work correctly.
If you implement interaction with Pepeunit without using these libraries, you can leave only the topics you actually need for your Unit.
WARNING
When a Unit is created or its version changes, Pepeunit automatically creates missing and removes obsolete Input and Output UnitNodes according to schema_example.json.