Skip to content

Troubleshooting

Niklas Linz edited this page Oct 3, 2026 · 1 revision

Troubleshooting

First step for almost everything: look at the log, and if that doesn't explain it, enable frame logging (see Configuration) to see everything exchanged with the unit.

discover-config finds nothing

  • The bridge and the unit must be in the same network segment. Broadcasts don't cross VLANs or routers; guest Wi-Fi and client isolation block them too.
  • Ask the unit directly: java -jar midea2mqtt.jar discover-config --ip 192.168.1.50. That uses unicast and works as long as UDP ports 6445 and 20086 get through.
  • Look the unit up in your router's DHCP list to get its address.

"device 'x' skipped: protocol 3 needs 'token' and 'key'"

The unit is V3 and token or key is empty, for example right after discover-config. Fetch them with keys and put them into the config: Finding your units.

"No working token/key found" from keys

  • Use the account of the app the unit is really paired with: --cloud msmart, --cloud nethome or --cloud mideaair.
  • Try without --cloud (shared account), or the other way round.
  • Make sure the unit is paired and online in the app.

The unit stays offline / no state appears

  • Wait a minute after the start; the first refresh is slow.
  • Wrong host, or the unit lost its Wi-Fi connection.
  • Another program holds the connection: Home Assistant's midea integration, a second bridge, the watch command. Stop it.
  • Authentication errors in the log: token and key belong to another unit, or the unit was reset or paired again. Fetch them again.
  • Wrong protocol. Use what discovery reported.

"Cannot connect to MQTT broker"

  • Check mqtt.ip and mqtt.port.
  • Wrong credentials make the broker refuse the connection; check username and password.
  • Two clients with the same clientId kick each other off the broker. Give every bridge its own.

A command does nothing

  • Watch <base>/<device>/error: mosquitto_sub -v -t 'midea2mqtt/+/error'.
  • Is the topic right? The device name is case sensitive and must match the entry in config.yml. Commands for unknown devices are ignored silently.
  • Was the command published with the retain flag? Then the log says "Ignoring retained command". Publish without -r.
  • Some features simply aren't supported by every unit; check capabilities.

The unit switches back after a command

Something else is controlling it: an automation, a second bridge, or a retained command that was delivered before the bridge ignored retained messages. Clear stray retained messages with mosquitto_pub -t <topic> -r -n.

Energy figures look absurd

Try powerAnalysisMethod: 2 or 3 in the device's entry and restart. Different units encode energy differently.

ClassNotFoundException or NoClassDefFoundError at startup

The lib folder isn't next to midea2mqtt.jar. Copy the jar together with the whole lib folder from target/.

UnsupportedClassVersionError

The Java version is too old for one of the libraries. Use the version the libraries were built for (Java 21, or 25 if your simplyConfiguration build targets it).