Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

MQTT Publishes

Chris Elsworth edited this page Aug 31, 2023 · 7 revisions

lxp-bridge publishes MQTT messages translating most packets it sees from the inverter (there are a couple of exceptions, heartbeat packets for instance don't produce an MQTT message).

Since v0.10, messages for holding registers (lxp/$datalog/hold/X and lxp/$datalog/hold/X/bits) are published to the broker with the retain bit set.

lxp/$datalog/hold/X, payload = int

Published when we see the contents of holding register X. X is known to run between 0-119 but newer inverter models may have more.

The payload of these messages is a raw unprocessed value. This means it can be a bitwise register containing many values, or only part of a value composed up of multiple registers. It may also be an odd unit, for example a few registers are expressed as 0.1V, so 2415 = 241.5V.

A list of registers can be found in List of Holding Registers.

lxp/$datalog/hold/X/bits, payload = JSON (added in v0.10)

Published when we see the contents of holding register 21 or 110 currently. These are the aforementioned bitwise registers.

These contain a breakdown of the bits in these registers into a more useful format. Honestly I don't know what half of these mean and you're on your own if you try changing some of them! The interesting ones mostly are related to ac charging, and force charging/discharging.

Example for register 21:

{
 "eps_en":"ON",
 "ovf_load_derate_en":"OFF",
 "drms_en":"ON",
 "lvrt_en":"OFF",
 "anti_island_en":"ON",
 "neutral_detect_en":"OFF",
 "grid_on_power_ss_en":"ON",
 "ac_charge_en":"ON",
 "sw_seamless_en":"ON",
 "set_to_standby":"ON",
 "forced_discharge_en":"OFF",
 "charge_priority_en":"OFF",
 "iso_en":"ON",
 "gfci_en":"ON",
 "dci_en":"ON",
 "feed_in_grid_en":"ON"
}

Example for register 110:

{
 "ub_pv_grid_off_en":"OFF",
 "ub_run_without_grid":"ON",
 "ub_micro_grid_en":"OFF"
}

lxp/$datalog/input/X, payload = int (added in v0.10)

Published when we see the contents of input register X. X is known to run between 0-119 but newer inverter models may have more.

Note that these are only published if the configuration option mqtt.publish_individual_input is set to true.

The payload of these messages is a raw unprocessed value. This means it can be a bitwise register containing many values, or only part of a value composed up of multiple registers. It may also be an odd unit, for example a few registers are expressed as 0.1V, so 2415 = 241.5V.

lxp/$datalog/input/X/parsed, payload = string (added in v0.12)

These are "parsed" equivalents of lxp/$datalog/input/X. They are primarily useful for getting more interesting information into Home Assistant dashboards.

They only appear for certain values of X for now:

  • 0 is a string representing the current status, for example, if input/0 is 0, then this will be "Standby". (a full list can be found here)
  • fault_code is a string representing the current fault code (these are derived from registers 60 and 61), for example, "E014: Bus short".
  • warning_code is a string representing the current warning code (these are derived from registers 62 and 63), for example, "W015: Battery reverse connection".

Note that these are only published if the configuration option mqtt.publish_individual_input is set to true. It is recommended to set this if you use Home Assistant to populate all the sensors properly.

lxp/$datalog/inputs/X, payload = JSON

These are JSON hashes of input registers, which depending on your inverter/firmware, can either come as dumps of registers 0-39 / 40-79 / 80-119, or 0-127 all at once.

  • In the former case, you'll get lxp/$datalog/inputs/1 (and 2, and 3). At the same time as 3 is published, you'll also get lxp/$datalog/inputs/all which merges all 3 prior JSON hashes.
  • In the latter case, newer inverters will only result in the lxp/$datalog/inputs/all message being published.

Therefore, depending on your inverter, it's usually probably best to use the all topic and ignore the 1/2/3 if they're present (and they may eventually be removed).

For details of what you'll see in these JSON hashes, see List of Input Registers.

Remember - if you have an inverter that sends these registers in 3 batches:

  • any register in the 0-39 range will be in inputs/1
  • .. 40-79 will be in inputs/2
  • .. 80-119 will be in inputs/3

lxp/$datalog/param/X, payload = int

Published when we see the contents of datalogger parameter X.

These are largely unknown; the only parameter we're sure of is 0, which is the interval between power data broadcasts from the inverter. This has been successfully set as low as 20 seconds, but doesn't seem to accept anything lower.