JXCT Soil Sensor 7-in-1 3.10.1
IoT система мониторинга почвы на базе ESP32
|
Взаимодействие с MQTT-брокером и Home Assistant. Подробнее...
#include "mqtt_client.h"
#include <Arduino.h>
#include <ArduinoJson.h>
#include <NTPClient.h>
#include <PubSubClient.h>
#include <WiFiClient.h>
#include <array>
#include "debug.h"
#include "jxct_config_vars.h"
#include "jxct_constants.h"
#include "jxct_device_info.h"
#include "jxct_format_utils.h"
#include "logger.h"
#include "modbus_sensor.h"
#include "ota_manager.h"
#include "wifi_manager.h"
Функции | |
PubSubClient | mqttClient (espClient) |
void | publishAvailability (bool online) |
void | setupMQTT () |
bool | connectMQTT () |
void | handleMQTT () |
void | publishSensorData () |
void | publishHomeAssistantConfig () |
void | removeHomeAssistantConfig () |
void | handleMqttCommand (const String &cmd) |
void | mqttCallback (const char *topic, const byte *payload, unsigned int length) |
void | invalidateHAConfigCache () |
const char * | getMqttLastError () |
Переменные | |
NTPClient * | timeClient |
WiFiClient | espClient |
Взаимодействие с MQTT-брокером и Home Assistant.
Реализация подключения, публикации данных, обработки команд и интеграции с Home Assistant через discovery.
PubSubClient mqttClient | ( | espClient | ) |
void publishAvailability | ( | bool | online | ) |
void setupMQTT | ( | ) |
bool connectMQTT | ( | ) |
void handleMQTT | ( | ) |
void publishSensorData | ( | ) |
void publishHomeAssistantConfig | ( | ) |
void removeHomeAssistantConfig | ( | ) |
void handleMqttCommand | ( | const String & | cmd | ) |
void mqttCallback | ( | const char * | topic, |
const byte * | payload, | ||
unsigned int | length | ||
) |
void invalidateHAConfigCache | ( | ) |
const char * getMqttLastError | ( | ) |
|
extern |
WiFiClient espClient |