Pixelix is a MQTT client which can be connected to a MQTT broker. The MQTT broker URL is configued in the settings via webinterface.
Format: [mqtt://][<USER>:<PASSWORD>@]<URI>
Examples:
- without authentication:
- mosquitto.at.home
- mqtt://mosquitto.at.home
- with authentication:
- myuser:[email protected]
- mqtt://myuser:[email protected]
Pixelix supports birth and last will messages.
After the successful connection establishment to the MQTT broker, Pixelix will send "online" to the <HOSTNAME>/status topic. In any disconnect case, "offline" will be sent to the <HOSTNAME>/status topic.
The base topic path to access plugin related topics can be setup with the plugin UID or the plugin alias:
- <HOSTNAME>/display/uid/<PLUGIN-UID>/...
- <HOSTNAME>/display/alias/<PLUGIN-ALIAS>/...
The complete topic name can be derived from the REST API documentation.
Example: JustTextPlugin
The REST API URL looks like the following: http://<HOSTNAME>/rest/api/v1/display/uid/<PLUGIN-UID>/text?text=<TEXT>
- Replace the http://<HOSTNAME>/rest/api/v1/ part with <HOSTNAME> --> <HOSTNAME>/display/uid/<PLUGIN-UID>/text?text=<TEXT>
- Every URL parameter, which is in this case show=<TEXT> must be sent in JSON format.
{
"text": "<text>"
}
The JSON data must have two keys:
- fileName: The name of the file which to upload.
- file: The file itself in BASE64 encoded.
Example: IconTextPlugin
{
"fileName": "hacker.bmp",
"file": "Qk32AAAAAAAAADYAAAAoAAAACAAAAAgAAAABABgAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAzEg/AAAAAAAAAAAAzEg/zEg/AAAAAAAAAAAAzEg/zEg/zEg/zEg/AAAAAAAAAAAAAAAAzEg/AAAAAAAAAAAAAAAAJBztJBztAAAAzEg/AAAAzEg/zEg/zEg/AAAAJBztAAAAAAAAzEg/AAAAAAAAAAAAAAAAJBztAAAAAAAAAAAAzEg/zEg/AAAAAAAAJBztAAAAAAAAAAAAzEg/zEg/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
}
The sensor topic path is valid if the sensor is available!
- Temperature in °C: <HOSTNAME>/sensors/0/temperature/state
- Humidity in %: <HOSTNAME>/sensors/1/humidity/state
- Illuminance in lx: <HOSTNAME>/sensors/2/illuminance/state
- Battery SOC in %: <HOSTNAME>/sensors/3/soc/state
If you have further ideas or you found some bugs, great! Create a issue or if you are able and willing to fix it by yourself, clone the repository and create a pull request.
The whole source code is published under the MIT license. Consider the different licenses of the used third party libraries too!
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, shall be licensed as above, without any additional terms or conditions.