![]() |
rasProject_01 / weSweetHome
R. 116 2026-05-14
process control / RasPi software by weinert-automation
|
MQTT related definitions for an experimental smart home (lab) project. More...
#include <mosquitto.h>Functions | |
| void | mqttClean () |
| End as MQTT client. | |
| int | mqttInit () |
| Initialise as MQTT client. | |
| void | mqttPlg01Set (uint8_t const on) |
| Switch the plug Plug01. | |
| void | mqttPlg02Set (uint8_t const on) |
| Switch the plug PLG2. | |
| void | mqttPlg03Set (uint8_t const on) |
| Switch the plug PLG3. | |
| void | mqttPlg04Set (uint8_t const on) |
| Switch the plug PLG4. | |
Variables | |
| char | clientId [38] |
| MQTT client ID. | |
| char | subTopStPlg01 [14] |
| State sub topic of S20 plug Number 01 to 09. | |
MQTT related definitions for an experimental smart home (lab) project.
MQTT is used to control relay devices like Sonoff S20 switchable plugs with Tasmota.
Revision history
| int mqttInit | ( | ) |
Initialise as MQTT client.
On success only: subscribe, loop and publish.
| void mqttPlg01Set | ( | uint8_t const | on | ) |
Switch the plug Plug01.
This function publishes the switch command via MQTT to the relay device Plug01, usually a Sonoff S20 with Tasmota.
| on | switch on when true, else off |
| void mqttPlg02Set | ( | uint8_t const | on | ) |
Switch the plug PLG2.
See mqttPlg01Set
| void mqttPlg03Set | ( | uint8_t const | on | ) |
Switch the plug PLG3.
See mqttPlg01Set
| void mqttPlg04Set | ( | uint8_t const | on | ) |
Switch the plug PLG4.
See mqttPlg01Set
|
extern |
State sub topic of S20 plug Number 01 to 09.
It's preset as plug01/POWER for 01, but the digit at index [5] will be set before each use accordingly.
|
extern |
MQTT client ID.
default value: sweetHomeControl; length: 15; max. length: 36
May be changed before mqttInit().