---
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                    | {<br/>"voltage_milli_volt":"12860",<br/>"current_milli_ampere":"-16",<br/>"cycle_count":"12",<br/>"design_milli_ampere":"6000",<br/>"remaining_milli_ampere":"806",<br/>"state_of_charge":"15",<br/>"state_of_health":"93",<br/>"temperature":"2957"<br/>}                                                                   | Dump of battery data                        |
| water                      | {<br/>"enough_water":true,<br/>"warn_level":false,<br/>"left_ml":1337,<br/>"sensor_error":false,<br/>"raw":0,"water_frozen":<br/>"tank sensor error"<br/>}                                                                                                                                                                   | Water Status dump                           |
| plant1                     | {<br/>"a":"disabled",<br/>"a_raw":"0",<br/>"b":"disabled",<br/>"b_raw":"0",<br/>"mode":"OFF",<br/>"consecutive_pump_count":0,<br/>"dry":false,<br/>"active":false,<br/>"pump_error":false,<br/>"not_effective":false,<br/>"cooldown":false,<br/>"out_of_work_hour":false,<br/>"last_pump":"N/A",<br/>"next_pump":"N/A"<br/>} | Plant status dump                           |
| light                      | {<br/>"active":false,<br/>"out_of_work_hour":true,<br/>"battery_low":true,<br/>"is_day":false<br/>}                                                                                                                                                                                                                          | Light status dump                           | 
| deepsleep                  | night 1h                                                                                                                                                                                                                                                                                                                     | Why and how long the ESP will sleep         |