mirror of
https://github.com/janishutz/mqtt-remote-gpio.git
synced 2026-10-08 20:56:22 +02:00
125 lines
4.0 KiB
JSON
125 lines
4.0 KiB
JSON
{
|
|
"$schema": "http://json-schema.org/draft-07/schema",
|
|
"type": "object",
|
|
"properties": {
|
|
"mqtt": {
|
|
"type": "object",
|
|
"description": "Configuration of the MQTT server upstream",
|
|
"properties": {
|
|
"host": {
|
|
"type": "string",
|
|
"description": "The hostname or IP of the MQTT server"
|
|
},
|
|
"port": {
|
|
"type": "number",
|
|
"description": "The port of the MQTT server",
|
|
"default": 1883
|
|
},
|
|
"authentication": {
|
|
"type": "boolean",
|
|
"description": "Whether or not the endpoint requires authentication",
|
|
"default": false
|
|
}
|
|
},
|
|
"if": {
|
|
"properties": {
|
|
"authentication": {
|
|
"const": true
|
|
}
|
|
}
|
|
},
|
|
"then": {
|
|
"properties": {
|
|
"user": {
|
|
"type": "string",
|
|
"description": "The username to log into MQTT",
|
|
"pattern": "([a-z-_]){2,}"
|
|
},
|
|
"password": {
|
|
"type": "string",
|
|
"description": "The user's password",
|
|
"pattern": "([\\w!#_\\-()]){3,}"
|
|
}
|
|
},
|
|
"required": [
|
|
"user",
|
|
"password"
|
|
]
|
|
},
|
|
"else": {
|
|
"additionalProperties": false
|
|
},
|
|
"required": [
|
|
"host",
|
|
"authentication"
|
|
]
|
|
},
|
|
"topics": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"topic": {
|
|
"type": "string"
|
|
},
|
|
"pin": {
|
|
"type": "number",
|
|
"description": "The pint that is controlled by this topic"
|
|
},
|
|
"mode": {
|
|
"type": "string",
|
|
"enum": [
|
|
"in",
|
|
"out"
|
|
],
|
|
"description": "The type of the pin. When set to IN, changes to this pin will be published to this topic, setting it to OUT, updates sent to this topic will make the pin change state to the specified state"
|
|
}
|
|
}
|
|
},
|
|
"if": {
|
|
"properties": {
|
|
"mode": {
|
|
"const": "in"
|
|
}
|
|
}
|
|
},
|
|
"then": {
|
|
"properties": {
|
|
"pollInterval": {
|
|
"type": "number",
|
|
"description": "The time between polls of the value of the GPIO pin, in cycles (as configured in general)",
|
|
"minimum": 1,
|
|
"maximum": 65535,
|
|
"default": 1
|
|
}
|
|
},
|
|
"required": [
|
|
"topic",
|
|
"pin",
|
|
"mode",
|
|
"pollInterval"
|
|
]
|
|
},
|
|
"else": {},
|
|
"required": [
|
|
"topic",
|
|
"pin",
|
|
"mode"
|
|
]
|
|
},
|
|
"pollInterval": {
|
|
"type": "number",
|
|
"minimum": 50,
|
|
"maximum": 65535,
|
|
"default": 100,
|
|
"description": "How many miliseconds should ellapse between polls of the pin states. Updates are only sent when the state actually changes"
|
|
}
|
|
},
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"pollInterval",
|
|
"topics",
|
|
"mqtt"
|
|
]
|
|
}
|