DTE Energy Bridge v2 as energy provider

It looks like there are a handful or so of similar topics on this subject but not many of them are recent, and the most recent ones are not helping much in getting this working for me.

I have a DTE Energy Bridge v2 with recent firmware that exposes current energy use over MQTT, here is an example of the output:

~ ❯❯❯ mosquitto_sub -h 192.168.1.113 -p 2883 -t ‘event/metering/instantaneous_demand/#’
{“time”:1660906268417,“demand”:789}
{“time”:1660906271407,“demand”:785}
{“time”:1660906274408,“demand”:787}

How do i get this into HomeAssistant for my Energy Dashboard? Id like to see the “demand” variable used in HomeAssistant to show my energy usage by the hour at the very least.

I’ve been experimenting with some different configuration.yaml settings from various old topics and github threads with no luck.

Apologies if my question is rather noob-ish, I’m only recently starting to get into integrating all of my smart appliances into my HomeAssistant instance and this type of integration is totally new to me. (This is actually the last of my devices i haven’t integrated yet)

Thank you in advance, any help would be greatly appreciated!

Do you have an MQTT broker already running on a different computer or device? Mosquitto can be used to bridge to the Energy Bridge MQTT broker either within the Mosquitto broker HA addon or via the mosquitto broker running on a different machine or device.

I have mosquitto running on my instance of haOS. I can see the energy bridge in MQTT explorer. I’m not understanding how to get it into Home Assistant.

Like the OP, I’m having no luck following old guides (as most of them have deprecated YAML examples)

Did you ever find a solution to getting this integrated? I see a lot of posts on here and Reddit with no actual solutions. This is the first one I seen with actual comments.

This is the yaml I have to read from mqtt that has been working for me for a while now including the latest release 2024.12:

mqtt:
  sensor:
    - name: "DTE Instantaneous Demand"
      icon: mdi:transmission-tower
      state_topic: "event/metering/instantaneous_demand"
      unit_of_measurement: "W"
      value_template: "{{ value_json.demand | default(0) | round(0) }}"
      device_class: power
      unique_id: dte_instantaneous_demand
    - name: "DTE Energy Bridge"
      icon: mdi:transmission-tower
      unique_id: dteenergybridge
      state_topic: "event/metering/summation/minute"
      unit_of_measurement: "kWh"
      # the Energy Bridge returns "Watt-minutes" every minute in the "value"; convert it to kilowatt-hours
      value_template: "{{ value_json.value | float / 60000 }}"
      # the "time" in the message is a Unix-like timestamp (in milliseconds) of the start of the last reading
      last_reset_value_template: "{{ now().fromtimestamp(value_json.time / 1000).replace(tzinfo=now().tzinfo) }}"
      device_class: energy
      state_class: total

and then in the /share/mosquitto.conf file I have:

connection dte
address 192.168.1.170:2883
clientid client-1
try_private false
start_type automatic
topic event/metering/# in 0
1 Like

And then in regards to the Energy dashboard, I setup a Utility Meter in the Device Helpers pointed to the DTE Energy Bridge sensor. And since I have dynamic peak pricing with DTE, I have 3 ‘tariffs’, Peak, Mid-Peak, and Off-Peak. That generates a few helpers with a select helper you tie up to an automation to change it based on DTE’s times. You can associate the tariffs to pricing and now I get a pretty close approximation to my monthly and daily electricity spend.

Weekday automation

alias: Home Energy Tariffs
description: ""
mode: single
triggers:
  - at: "07:00:00"
    id: MidPeak
    variables:
      tariff: midpeak
    trigger: time
  - at: "15:00:00"
    id: Peak
    variables:
      tariff: peak
    trigger: time
  - at: "19:00:00"
    id: MidPeakEvening
    variables:
      tariff: midpeak
    trigger: time
  - at: "23:00:00"
    id: OffPeak
    variables:
      tariff: offpeak
    trigger: time
conditions:
  - condition: time
    weekday:
      - mon
      - tue
      - wed
      - thu
      - fri
actions:
  - action: select.select_option
    target:
      entity_id: select.daily_energy_usage
    data:
      option: "{{ tariff }}"

Weekend Automation:

alias: Home Energy Tariffs - Off Peak
description: ""
mode: single
triggers:
  - at: "00:00:00"
    id: Begin
    variables:
      tariff: midpeak
    trigger: time
  - event: start
    trigger: homeassistant
conditions:
  - condition: time
    weekday:
      - sun
      - sat
actions:
  - action: select.select_option
    metadata: {}
    data:
      option: offpeak
    target:
      entity_id: select.daily_energy_usage
1 Like

I’ve been looking for a solution to the DTE Energy Bridge for years. Thank you for posting the only working solution I’ve ever seen. It works perfectly just as you posted.

I found another way to handle the DTE tariffs though. at https://github.com/ablyler/homeassistant-dte-current-price

Adding my slightly modified version to configuration.yaml seems to work well so far. I’m honestly still trying to figure out the actual USD/kWh rates though.


template:
  - sensor:
      - name: "D1.2 Inflow"
        unit_of_measurement: "USD/kWh"
        device_class: monetary
        state: >
          {% set month = now().month %}
          {% set weekday = now().weekday() %}
          {% set hour = now().hour %}
          {% if month in [10, 11, 12, 1, 2, 3, 4, 5] %}
          {% if weekday in [0, 1, 2, 3, 4, 5] and hour >= 15 and hour < 19 %}
            0.191
          {% else %}
            0.177
          {% endif %}
          {% elif month in [6, 7, 8, 9] %}
          {% if weekday in [0, 1, 2, 3, 4, 5] and hour >= 15 and hour < 19 %}
            0.234
          {% else %}
            0.177
          {% endif %}
          {% endif %}

Great, glad it worked. The reason I did the tariffs like I have is so it’s broken down in the energy dashboard better I believe.

Is this still working? I tried to implement this and I don’t seem to be getting data from my bridge.