rasProject_01 / weSweetHome
R. 240
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. More... | |
void | mqttPlg01Set (uint8_t const on) |
Switch the plug Plug01. More... | |
void | mqttPlg02Set (uint8_t const on) |
Switch the plug PLG2. More... | |
void | mqttPlg03Set (uint8_t const on) |
Switch the plug PLG3. More... | |
void | mqttPlg04Set (uint8_t const on) |
Switch the plug PLG4. More... | |
Variables | |
char | clientId [38] |
MQTT client ID. More... | |
char | mqttHost [68] |
The MQTT broker URL or name. More... | |
int | mqttPort |
MQTT port 1883. | |
char | subTopStPlg01 [14] |
State sub topic of S20 plug Number 01 to 09. More... | |
MQTT related definitions for an experimental smart home (lab) project.
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 |
The MQTT broker URL or name.
May be set by option –mqttHost meterPi or –mqttBroker 192.168.178.87
default: localhost MQTTBroker (currently localhost !)
|
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().
MQTT client ID.