Seeking advice for energy meter integration (MQTT) and Ventilation

Dear all,

I’m in the migration from another system (so, new ho hass). In that process I want to migrate an energy meter, connected via MQTT. I’m completely free in how to create the messages (topic+payload) and want setup the sending edge in a way that it is best supporting HA MQTT discovery, or - so that HASS may understand in the best possible way how to setup/use the entities sending.

The device deliveres: energy as total (kWh) and current consumption (W). Also a mains frequency sensor (Hz). Gas and Water (essentially an impuls counter, so bonus would be the chance to set/updates values from HA).

I kindly ask for advice and wishdom:

  • how should the mqtt topic be structured in a most ideal way?
  • how the payload?
    to support the autodiscovery feature best (make HA understand what devices this are and use “in the most natural HA way”)

Also: a fan (the V in HVAC) is connected. Here I would follow the recommendations in MQTT Fan - Home Assistant ( ?

I admit that I not fully understand (yet) what, from the options provided there, I have to use as “best practise”.

Examples for the optimal mqtt message structure (topics+payload) are highly welcome.

many thanks fro advice, best