Energy monitoring

Hello,

I can’t get the energy monitoring to work. It says there is no data available, even though I think I have everything set up correctly.

I might have forgotten something or misconfigured something. If anyone has an idea of what might be blocking it, I’d appreciate it!

Does your device keep the ‹ energy consumed › data well? It’s this data that is analyzed every 30 minutes by the energy monitoring module to calculate consumption in kWh and cost.
If not, it results in what you see: no energy monitoring data.

I have no idea

How do I find out?

You need to look at your device’s features.

In my example, it’s in the zigbee2mqtt integration, and you click on Edit for your device:


And there you should have Yes, keep history checked for conso30 and cout30 (mandatory, but also the energy consumed (in kWh or Wh) as @StephaneB mentioned.

If that wasn’t the case, you check it and then let it run, it will fill your graph every 30 minutes but obviously some energy needs to be consumed.
And instead of looking at the month, look at the day, you will see more slots.

I must have missed something because I don’t have the 30-minute consumption

Indeed, the problem comes from there :thinking:

On the energy monitoring side, any device that has consumed energy (or index) appears.
It might be a bug to fix in the Gladys core so that only devices with conso30 and cout30 appear.

However, the MQTT meter should appear by default if it doesn’t have conso30 and cout30 (which is my case).

So how do we make conso30 and cout30 appear in zigbee2mqtt… and well, I’m stuck :frowning:
In MQTT Virtual Devices, there is a button to create them but not in the Z2M integration.
@cicoub13 do you have any idea?

Well spotted @mutmut, it’s indeed a bug in the Zigbee2mqtt integration :beetle:

The « 30 min consumption » and « 30 min cost » features are generated by Gladys when the device is added from the Z2M discovery page. For a device added before the arrival of energy tracking, these features are correctly calculated, but the device was not marked as « to be updated ». Result: no « Update » button in the discovery, and no way to retrieve them.

I opened a PR to fix this: Zigbee2mqtt: allow updating devices missing their energy consumption/cost features by cicoub13 · Pull Request #3288 · GladysAssistant/Gladys · GitHub
Once the fix is published, you will just need to go to Zigbee2mqtt > Discovery, click on « Update » on the plug, then check that « Keep history » is checked on the consumed energy (kWh).

@Prof_Techno In the meantime, if you don’t want to wait: delete the device in Gladys and then add it again from the Zigbee2mqtt discovery page. The consumption/cost features will be created.
:warning: Warning, you lose the device history, and you will need to put it back in your scenes and dashboards.

I’ll wait!!

It’s fixed and available in version 5.3.1

Keep us posted

So, first of all, the calculation works and data has appeared. However, not everything has been retrieved yet, even though I should have a year’s worth of history.

I’m going to run the calculation again to see if that changes anything.

So, I did manage to retrieve all my data after restarting the calculations. So that’s good on that front, even if it took 40 minutes for everything to be recalculated!

However, I have 2 devices that haven’t come back up and aren’t showing anything. I’ll open a new post about that.