---
title: "MQTT"
date: 2025-01-27
draft: false
description: "a description"
tags: ["mqtt", "esp"]
---
# MQTT
An Mqtt server can be configured and will be used to dump all kinds of statistical data.
|Topic|Example|Description|
|/firmware/address|
| Topic                      | Example                                                                                                                                                                                                                                                                                                                      | Description                                 |
|----------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------|
| firmware/address           | 192.168.1.2                                                                                                                                                                                                                                                                                                                  | The Ip address in station mode              |
| firmware/githash           | feature/esp32c6@1ce4d74a                                                                                                                                                                                                                                                                                                     | The branch and hash during build time       |
| firmware/buildtime         | 2025-01-21T20:56:18.168163570Z                                                                                                                                                                                                                                                                                               | Compile time                                |
| firmware/last_online       | 2025-01-22T08:56:46.664+01:00                                                                                                                                                                                                                                                                                                | Last time this board was online             |
| firmware/ota_state         | Partition state is ESP_OTA_IMG_VALID                                                                                                                                                                                                                                                                                         | The OTA state, relevant for rollback        | 
| firmware/partition_address | 0x10000                                                                                                                                                                                                                                                                                                                      | The OTA partition used, 0x10000 is ota_1    |
| state                      | online                                                                                                                                                                                                                                                                                                                       | Current State, expected are online or sleep |
| battery                    | {
"voltage_milli_volt":"12860",
"current_milli_ampere":"-16",
"cycle_count":"12",
"design_milli_ampere":"6000",
"remaining_milli_ampere":"806",
"state_of_charge":"15",
"state_of_health":"93",
"temperature":"2957"
}                                                                   | Dump of battery data                        |
| water                      | {
"enough_water":true,
"warn_level":false,
"left_ml":1337,
"sensor_error":false,
"raw":0,"water_frozen":
"tank sensor error"
}                                                                                                                                                                   | Water Status dump                           |
| plant1                     | {
"a":"disabled",
"a_raw":"0",
"b":"disabled",
"b_raw":"0",
"mode":"OFF",
"consecutive_pump_count":0,
"dry":false,
"active":false,
"pump_error":false,
"not_effective":false,
"cooldown":false,
"out_of_work_hour":false,
"last_pump":"N/A",
"next_pump":"N/A"
} | Plant status dump                           |
| light                      | {
"active":false,
"out_of_work_hour":true,
"battery_low":true,
"is_day":false
}                                                                                                                                                                                                                          | Light status dump                           | 
| deepsleep                  | night 1h                                                                                                                                                                                                                                                                                                                     | Why and how long the ESP will sleep         |