Missing feature for zigbee2mqtt device

Good evening @AlexTrovato (zigbee expert!),
I’m noticing a curious phenomenon in the management of my Zigbee devices.
For several months, Gladys+ was running on a Synology DS218+ NAS, but I’ve noticed unbearable slowdowns with that CPU, so I decided to migrate to a Beelink BT3Pro.
Automatic restoration with previous backups did not work (zigbee2mqtt container stuck in continuous restarting), so I reconfigured my devices one by one, starting from a clean image.
For now, I kept my previous installation, so I can more easily copy the old one to the new one by comparison.
Among others, I have a Tuya TS011F_plug_1 smart plug that I use to record the output of my solar panels, and I notice that the « energy » feature is missing on my new installation.
Here is the excerpt from the two state.json files:
the first on the NAS


and the second on the Beelink :

What is unfortunate is that the « energy » feature is the only one I really need because it is recorded every evening into Google Sheets via IFTTT.
Do you see an explanation for this phenomenon?
Thanks Alex, I hope I’ve been clear?

Hi @jparbel,
I’m sorry that the backup didn’t work during your machine migration.

To be sure I understood correctly, I’m going to try to restate your problem in my own words.

Your issue is on the zigbee2mqtt side, not Gladys (outside of the backup).
One of your devices has lost the « energy » feature, for no reason.
And we’re talking specifically about this device Tuya TS011F_plug_1 control via MQTT | Zigbee2MQTT.

I’m going through the pages of the zigbee2mqtt application to try to find whether it’s possible to disable a feature of a device, but I don’t see anything.

I also searched z2m’s GitHub GitHub - Koenkk/zigbee2mqtt: Zigbee 🐝 to MQTT bridge 🌉, get rid of your proprietary Zigbee bridges 🔨, but no luck…


I just had an idea: « energy » → Sum of consumed energy.
You might have to turn the plug on to populate that value, right?

@AlexTrovato
Thanks for that quick reply, you translated my previous message very well.
For now the two Gladys instances are running simultaneously; one gives me the « energy » feature and the other doesn’t.
The outlet is indeed on, otherwise I wouldn’t be reporting any value.

As for the backup, it’s secondary, just a small waste of time!
The failure may have been because I was using my personal Mosquitto broker; I’m now using Gladys’s broker (I’m wondering if that’s the issue)

Attention @jparbel,
you can’t connect the same device to two Zigbee dongles. One of the dongles will lose the connection… well, I think…

Do you have a custom setup? With a homemade z2m / MQTT configuration?

I think it’s mainly that the device can only communicate with one broker, so with a single key; you do need to associate the device with the chosen key (I experienced this with two BT3PRO devices, one on Gladys and the other on Jeedom).

@cce66 @AlexTrovato
In fact, it works for me with 2 Zigbee dongles, and 2 installations.
The reason is simple: I use 2 different brokers: my NAS installation is connected to my Mosquitto broker while the other is connected to the Gladys broker.
That explains it, but it doesn’t solve my feature problem!

Maybe check the QoS setting, then.

OK thanks to both of you, I’ll keep looking on my end.

I just set the QoS to 2, let’s wait and see!

For each topic, MQTT allows managing the desired QoS; messages will be delivered:

  • QoS 0 : At most once
  • QoS 1 : At least once
  • QoS 2 : Exactly once

TCP ensures the reliability of transmissions on the network. But MQTT additionally handles connection losses — upon reconnection, with QoS 1 and QoS 2, any messages not transmitted are retransmitted.

In QoS 1, messages are acknowledged by the receiver; if this acknowledgment does not arrive the message is retransmitted:

Capture réseau wireshark avec la QoS MQTT à 1

MQTT QoS 1 network capture

In QoS 2, the acknowledgment itself is validated to ensure the message arrives only once:

Capture réseau wireshark avec la QoS MQTT à 2

MQTT QoS 2 network capture

In QoS 0, however, messages are simply transmitted and validated only by TCP:

Capture réseau wireshark avec la QoS MQTT à 0

The problem is that when the device publishes, the first client that receives it will acknowledge the message, and therefore the device will only publish again upon a change. It is likely that the same client will always receive the publishes and thus acknowledge them.

You should try QoS 0 or 1 instead.

Thanks for the clarification — I’ll try tomorrow!