3.8 KiB
3.8 KiB
title, date, draft, description, tags
| title | date | draft | description | tags | ||
|---|---|---|---|---|---|---|
| MQTT | 2025-01-27 | false | a description |
|
MQTT
A configured MQTT server will receive statistical and status data from the controller.
Topics
| Topic | Example | Description |
|---|---|---|
firmware/address |
192.168.1.2 |
IP address in station mode |
firmware/state |
VersionInfo { ... } |
Debug information about the current firmware and OTA slots |
firmware/last_online |
2025-01-22T08:56:46.664+01:00 |
Last time the board was online |
state |
online |
Current state of the controller |
mppt |
{"current_ma":1200,"voltage_ma":18500} |
MPPT charging metrics |
battery |
{"Info":{"voltage_milli_volt":12860,"average_current_milli_ampere":-16,...}} |
Battery health and charge data |
water |
{"enough_water":true,"warn_level":false,"left_ml":1337,...} |
Water tank status |
plant{1-8} |
{"sensor_a":...,"sensor_b":...,"mode":"TargetMoisture",...} |
Detailed status for each plant slot |
pump{1-8} |
{"enabled":true,"pump_ineffective":false,...} |
Metrics for the last pump activity |
light |
{"enabled":true,"active":true,...} |
Night light status |
deepsleep |
night 1h |
Why and how long the ESP will sleep |
Data Structures
Firmware State (firmware/state)
Contains a debug dump of the VersionInfo struct:
git_hash: Branch and commit hashbuild_time: Compilation timestampcurrent: Current running partitionslot0_state: State of OTA slot 0slot1_state: State of OTA slot 1
MPPT (mppt)
current_ma: Solar charging current in mAvoltage_ma: Solar panel voltage in mV
Battery (battery)
Can be "Unknown" or an Info object:
voltage_milli_volt: Battery voltageaverage_current_milli_ampere: Current draw/chargedesign_milli_ampere_hour: Battery capacityremaining_milli_ampere_hour: Remaining capacitystate_of_charge: Charge percentage (0-100)state_of_health: Health percentage (0-100)temperature: Temperature in degrees Celsius
Water (water)
enough_water: Boolean, true if level is above empty thresholdwarn_level: Boolean, true if level is below warning thresholdleft_ml: Estimated remaining water in mlpercent: Estimated fill level in percentraw: Raw sensor voltage in mVsensor_error: Details if the level sensor failswater_frozen: Boolean, true if temperature is below freezingwater_temp: Water temperature in degrees Celsiustemp_sensor_error: Details if the temperature sensor fails
Plant (plant{1-8})
sensor_a/sensor_b: Moisture sensor statusDisabled{"MoistureValue":{"raw_hz":5000,"moisture_percent":65}}{"SensorError":{"ShortCircuit":{"hz":...,"max":...}}}
mode: Watering mode (Off,TargetMoisture,MinMoisture,TimerOnly)do_water: Boolean, true if watering is currently requireddry: Boolean, true if moisture is below targetcooldown: Boolean, true if the pump is in cooldown periodout_of_work_hour: Boolean, true if currently outside allowed watering hoursconsecutive_pump_count: Number of pump cycles without reaching targetpump_error: Details if the pump is failinglast_pump: Timestamp of last activitynext_pump: Estimated timestamp for next allowed activity
Pump (pump{1-8})
enabled: Boolean, pump was activepump_ineffective: Boolean, no flow detected during pumpingmedian_current_ma: Median pump currentmax_current_ma: Peak pump currentmin_current_ma: Minimum pump current
Light (light)
enabled: Boolean, is enabled in configactive: Boolean, led is currently onout_of_work_hour: Boolean, led should not be on at this time of daybattery_low: Boolean, battery is low so led usage is restrictedis_day: Boolean, the sun is up (determined by solar panel voltage)