MQTT - Data description - Home Assistant

Hey gang,

I’m a home assistant user. I’m looking to pull in the data via MQTT. While accessing the data isn’t a problem. I’m struggling with understanding the data. The docs mostly it is describing how to get it, maybe I’m impatient, but! I’m not seeing descriptions of the data that’s published. I can hazard guesses based on the topic names.

I’m specifically tracking heat pump data, but I guess it would be useful to see descriptions of the data for all the other energy monitoring types. I’m hoping someone out there can help since they’ve decoded it already themselves? Or they helped put this project together. :flushed:

Falling short of contributing to the project and putting in discovery MQTT topics for home assistant- I’m adding this lot to a YAML file in the interim to keep my life simpler - but maybe this will help others to update the project. Both the docs and adding HA Discovery topics to the MQTT publication.

Here’s a screenshot of the MQTT data:

But to simplify re-typing entity names, here’s the JSON output that I’m publishing to MQTT:

{
  "electric_Power": 15.3,
  "electric_Energy": 409.459,
  "heatmeter_Energy": 1630,
  "heatmeter_Energy2": 0,
  "heatmeter_Volume": 979.822,
  "heatmeter_Volume2": 0,
  "heatmeter_Record5": 10700,
  "heatmeter_Record6": 1100,
  "heatmeter_Record7": 0.49845829606056213,
  "heatmeter_Record8": 0.12362194061279297,
  "heatmeter_FabNo": 29907100,
  "heatmeter_DateTime": 636619779,
  "heatmeter_Record11": -3615,
  "heatmeter_FlowT": 19.72314453125,
  "heatmeter_ReturnT": 19.697265625,
  "heatmeter_FlowRate": 0.5067667961120605,
  "heatmeter_Power": 0,
  "heatmeter_Record16": 0,
  "heatmeter_Ontime Hours": 3172,
  "heatmeter_Record18": 0,
  "heatmeter_heat_calc": 15.118185330518624,
  "time": 1684407840.08018
}

So I’m putting this lot into YAML config for Home Assistant. I’m hoping I can come back here and edit this based on kind folks helping me decode the data!

mqtt:
  ## Open Energy Monitor (Heatpump)
  sensor:    
    - name: "Heatpump - Electric Power"
      unique_id: UUID_heatpump_electric_power
      state_topic: "emon/UUID/electric_Power"
      # state_class: total_increasing
      # value_template: >-
      #   {{states.sensor.givtcp_battery_soc.state}}
      unit_of_measurement: 'W'
      device_class: power
      icon: |
        mdi:power

    - name: "Heatpump - Electric Energy"
      unique_id: UUID_heatpump_electric_energy
      state_topic: "emon/UUID/electric_Energy"
      # state_class: total_increasing
      # value_template: >-
      #   {{states.sensor.givtcp_battery_soc.state}}
      unit_of_measurement: 'Wh'
      device_class: energy
      icon: |
        mdi:battery

    - name: "Heatpump - Heating flow temperature"
      unique_id: UUID_heatpump_tempgenerated
      state_topic: "emon/UUID/heatmeter_FlowT"
      # state_class: total_increasing
      # value_template: >-
      #   {{states.sensor.givtcp_battery_soc.state}}
      unit_of_measurement: '°C'
      device_class: temperature
      icon: |
        mdi:thermometer
    
    - name: "Heatpump - Heating return temperature"
      unique_id: UUID_heatpump_tempreturn
      state_topic: "emon/UUID/heatmeter_ReturnT"
      # state_class: total_increasing
      # value_template: >-
      #   {{states.sensor.givtcp_battery_soc.state}}
      unit_of_measurement: '°C'
      device_class: temperature
      icon: |
        mdi:thermometer

    - name: "Heatpump - Heating flow rate"
      unique_id: UUID_heatpump_flow_rate
      state_topic: "emon/UUID/heatmeter_FlowRate"
      # state_class: total_increasing
      # value_template: >-
      #   {{states.sensor.givtcp_battery_soc.state}}
      unit_of_measurement: 'm3/s'
      device_class: speed
      icon: |
        mdi:dashboard

    - name: "Heatpump - Date time"
      unique_id: UUID_heatpump_time
      state_topic: "emon/json/UUID"
      # state_class: total_increasing
      value_template: >-
        {{value_json.time | timestamp_local }}
      # unit_of_measurement: 'm3/s'
      device_class: timestamp
      icon: |
        mdi:clock   

So some questions I’m looking to get help answering:

  • For the the data items I’ve done so far, have I got the descriptions and attributes correct?
  • Can you help enhance what’s there, if it is right?
  • For data items that are labelled ‘energy’ - when does this value reset? … or is that based on commissioning date? Or does it vary per data item?

For every other item I’ve not added:

  • What does it represent?
  • What is the units of measurement?
  • Is the value a: Measurement, Total or Total increasing over time?
  • If the value is a total increasing over time, when/where do I find out when it was last reset?
  • What’s the device class?

That should give us a good start!

Looking forward to collaborating on getting this data in.

Hi, welcome

Are you pushing to or pulling from emoncms?

There is an emoncms HA Integration - needs a bit of work but largely works in both directions.

This might help, but most of your questions are really for the HA forum not for OEM :slight_smile:

hey! Thanks for the quick response @borpin

I’m pulling data from Emon (the physical raspberry pi, not the cloud solution) via MQTT to HomeAssistant. The existing err, integration/custom component for home assistant is using the cloud, which isn’t what I’m trying to achieve. I am aiming for everything to be local. :slight_smile:

Do you know of any docs that point to what the data is in detail?

No, just give it the local IP as URL (Hostname). RTFM :slight_smile:

aaahhhhhhhhhh, so apparently I am impatient and not reading! :wink: Thanks @borpin

1 Like

If electricity_Power is the instantaneous rate, in Watts.

What is electric_Energy, please?

I see that the electric_Energy is used by the My Heatpump app uses for cumulative electric use.

In Home Assistant, the electric_Energy sensor has a device class of ‘power’ and ‘W’ unit_of_measurement, rather than ‘energy’ and ‘Wh’.

I created a Utility Meter helper against the electricity_Power sensor but the values are higher than the energy consumption values showing in the emoncms app.

The My Heatpump app is reporting a consumption for the day so far of 3.8 kWh.
The Utility meter reports W rather than Wh!?

I feel like I should be able to use the Riemann Integration but each configuration I have tried so far doesn’t return anything close to the consumption reported by emoncms.

Power is the instantaneous figure - Watts (W).

To determine how much power you use over a selected period, you need to add a time element and that is called Energy

Energy is Wh or more usually because of how much you use, kWh.

Thank you. Have figured out where things were going wrong. In my local Emoncms none of the feeds I created from the pre-configured inputs had the units configured so, as per the HA emoncms integration documentation, they all defaulted to W.