DTE (Powerley) Energy Bridge Endpoint error

Is there a way to get the meter number from any topic that the energy bridge is bound to, I had two meters on my account 1 commercial & 1 residential my energy bridge seems to be connected to the commercial meter but I wanted it for my residential meter

You will need to contact DTE and tell them you’d like your Energy Bridge to bind to a different meter. AFAIK, you can’t have it bound to two meters (that would be very nice if it was possible!)

See the Troubleshooting section of the Insight page for the email/phone to reach somebody that knows about the Energy Bridge and can probably help. (If you find out it’s possible to bind the EB to multiple meters, let us know!)


On an unrelated note: I worked with the HA devs, and the latest release will iron out the issues with using the “minutely summation” data with the Energy dashboard without any extra “sensors”. Usage and cost are now being calculated correctly for me with this config:

sensor:
  - platform: mqtt
    name: "Household Electricity Usage"
    icon: mdi:transmission-tower
    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
3 Likes

I had multiple calls with their insight customer support, a ticket was raised to send a technician to make it bind to the correct meter, but no response after that. Still waiting :sleeping:
Technically the Energy Bridge is only for Residential customers. it shouldn’t work with commercial meters. this might be a bug in their system

I’m going to do a quick hijack of this thread to share a 3D printable bracket I made for the my v2 energy bridge. Feel free to print one for yourself! If you have any feedback it’s also appreciated.

I got sick of looking at mine sitting on my kitchen counter and decided to design a bracket and hang it in my pantry. Fit is pretty good (not perfect), but it shouldn’t be going in/out often so it shouldn’t be a big deal. Unfortunately it hangs upside down from their logo, but it does cover that pesky super bright LED.

I’m brand new to this system but am trying to integrate my Energy Bridge. It is a version 2 device from Powerley but is connected to my BCHydro meter.
I have been able to get data out of it using the line event/metering/minute but when I switch this to event/metering/instantaneous_demand I don’t get anything.
Where can the variables such as minute and instantaneous_demand be found. I feel like I’m working in the dark throwing in lines to see if I can get some kind of response from the bridge.
Any suggestions of the best resources I should be reading through to get a better handle on what I should be doing?
I would like to get a view that shows instantaneous use (number) as well as graphs showing hourly use and daily use (sums.)
Any assistance would be appreciated.

Edit: I finally figured out a couple of things. I was forgetting to remove the summation and was using value instead of demand.

    state_topic: "event/metering/instantaneous_demand"
    unit_of_measurement: 'W'
    value_template: "{{ value_json.demand }}"

This finally worked for me.

Before I try installing a Z-wave light switch and pairing it to my Powerley hub, does anyone know if the hub exposes control for z-wave devices via mqtt? This would be perfect for me as my z-wave network doesn’t reach my garage where this hub is located.

I’d also love if it exposed Z-wave / ZigBee devices via MQTT.

Thanks! I have been using the energy bridge for a long time, Some changes seem to have broken thing for me and that sensor yaml helped. I’ve been documenting everything and updating it in my notes. I’ve also been updating a guide on Reddit. I hope you don’t mind I’ve included you yaml.

1 Like

Does anyone have ideas on how to troubleshoot the case where I can ping the bridge and connect to it with an mqtt client, but no data is flowing out of it?

The bridge is bound to my meter, I can get the data from the app so that much is good but I have let a client sit on the bridge subscribed to the topic for over a day with nothing posted.

Thanks for any help

More info may be needed like what Mosquito broker you are using. Did you edit your Mosquito brokers .conf file or create one? Did you change your Mosquito broker to allow additional .conf files if you created a new one?

logins:
  - username: --
    password: --
customize:
  active: true
  folder: mosquito
certfile: fullchain.pem
keyfile: privkey.pem
require_certificate: false
anonymous: false
connection energy_bridge
address 192.168.2.51:2883
remote_username admin
remote_password trinity
clientid homeassistant-1
try_private false
start_type automatic
topic event/metering/# in 0

I am using the HA add on for mosquito with the above configuration. The log is showing some socket errors for it, not all the time but on occasion. I have a ping sensor setup in HA which is stable.

1644193579: Warning: Mosquitto should not be run as root/administrator.
1644193579: Connecting bridge energy_bridge (192.168.2.51:2883)
1644193579: mosquitto version 1.6.12 running
1644193579: New connection from 127.0.0.1 on port 1883.
1644193579: Socket error on client <unknown>, disconnecting.
1644193580: New connection from 192.168.2.101 on port 1883.

When it first boots this is consistent, so its possible the HA client may not be connecting.

I was able to get a solid connection using MQTT.fx on my desktop before I moved the bridge to my smart home VLAN, but it never posted anything.

Thanks again

Sorry I never saw your reply. Did you get this sorted? My best guess is MQTT isn’t properly subscribed. It looks like you have mosquitto spelled wrong.

Does anyone subscribe to the energy bridge’s MQTT server directly from an ESPhome device (say a Sonoff smartplug), and do some simple relay logic on it to control a load (say a L1 EVSE to charge the EV starting when there is some excess solar).

This should be possible with a standalone ESPhome device, listening to the main meter energy bridge, no other devices required, right?

Just in case someone could use it. Below is my template to track time of day pricing for DTE. It uses the rates from http://dteenergy.com/timeofday which don’t include some of the fees. I’ll be double checking the accuracy of their pricing once I get a full bill time of day bill (I like to roll in the fees to get a better feel for how much my bill will actually be).

(also let me know if you see an error)

- platform: template
    sensors:
      dte_price:
        friendly_name: DTE Time of Day Pricing (15:00 to 19:00 peak)
        unit_of_measurement: 'USD/kWh'
        value_template: >
          {% set tariff = { "PeakSummer": 0.2098, "PeakWinter": 0.1675, "OffPeak": 0.1545 } %}
          {% set time = { "month": (now().strftime('%m') | int), "hour": (now().strftime('%H') | int), "weekday": (now().weekday() | int ) } %}
          {%if (time.hour > 19) or (time.hour < 15) %}
              {{ tariff.OffPeak }}
          {%elif ((time.month >= 10) or (time.month <= 5)) and (time.weekday < 5) %}
             {%if (time.hour >= 15) and (time.hour <= 19) %}
              {{ tariff.PeakWinter }}
             {%endif%}
          {%elif ((time.month > 5) and (time.month < 10)) and (time.weekday < 5) %}
             {%if (time.hour >= 15) and (time.hour <= 19) %}
              {{ tariff.PeakSummer }}
             {%endif%}
          {%else%}
              {{ tariff.OffPeak }}
          {%endif%}

Thanks for sharing!

I set mine up with an automation and input select entity to switch between the rates, but I like the way yours combines that into one sensor. I may look into revising mine (or correcting if anyone sees anything wrong with mine). I’m using the following for the Time of Day 11A-7P plan, which was updated to reflect the actual charges I’ve seen on my bills over the last year. So I’m sharing this as well in case anyone has that specific rate plan.

Also, I did notice a minor change in winter pricing between 2022 and 2023, so it seems like this still requires some frequent upkeep and checks.

#--------------------------------------------------------------------------------------------------
# Accurate Tariff Prices
#--------------------------------------------------------------------------------------------------
  - name: Tariff Consumption Price
    unit_of_measurement: $/kWh
    state: >
      {% if is_state('select.dte_daily_consumption', 'peak') and (now().month in (6,7,8,9,10)) %}
        {{ 0.24157 }}
      {% elif is_state('select.dte_daily_consumption', 'offpeak') and (now().month in (6,7,8,9,10)) %}
        {{ 0.13476 }}
      {% elif is_state('select.dte_daily_consumption', 'peak') %}
        {{ 0.21110 }}
      {% elif is_state('select.dte_daily_consumption', 'offpeak') %}
        {{ 0.13220 }}
      {% endif %}

  - name: Tariff Export Price
    unit_of_measurement: $/kWh
    state: >
      {% if is_state('select.dte_daily_export', 'peak') and (now().month in (6,7,8,9,10)) %}
        {{ 0.15994 }}
      {% elif is_state('select.dte_daily_export', 'offpeak') and (now().month in (6,7,8,9,10)) %}
         {{ 0.05313 }}
      {% elif is_state('select.dte_daily_export', 'peak') %}
        {{ 0.13452 }}
      {% elif is_state('select.dte_daily_export', 'offpeak') %}
        {{ 0.05562 }}
      {% endif %}

Thank you so much for this!!! Just what I was looking for. I adjusted it for the D1.2 rates and worked great!

I’m on D1.2 as well, so I’m curious if you’re seeing the same calculated rates I shared in the post above this.

Glad to hear it’s working! I’m going to adjust mine into a single sensor like @cearum 's post above soon to see how it works.

Oh shoot, no! I am using the rates advertised on the website (which are likely out of date). I didn’t think to use the ones on my bill. I will check on that. These rates will likely change again this year when the new rate case is approved. Hopefully not by too much.

1 Like

Hi Guys - Looking for a little bit of help here .

I am able to see the mqtt traffic from my bridge by going to settings->integrations-> MQTT → Configure and listen to “event/metering/#” but no matter what I have done I cannot see any entities or any mqtt devices.

Below are my files.
share/mosquitto/dte.conf

connection dte
address x.x.x.x:2883
clientid homeassistant-1
try_private false
start_type automatic
topic event/metering/# in 0

then my configuration.yaml

# Loads default set of integrations. Do not remove.
default_config:

# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes

# Text to speech
tts:
  - platform: google_translate

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

#try 2 - 6/16/23
#######
sensor:
  - platform: mqtt
    name: "DTE Energy Bridge"
    state_topic: "event/metering/summation/minute"
    unit_of_measurement: "W"
    value_template: "{{ value_json.value }}"
  - platform: mqtt
    name: "Instant Energy Use"
    state_topic: "event/metering/instantaneous_demand"
    unit_of_measurement: "W"
    value_template: "{{ value_json.demand | int }}"
  - platform: integration
    source: sensor.dte_energy_bridge #Name of the MQTT sensor#
    name: energy_used
    unit_prefix: k
    round: 2

#try3
sensor:
  - platform: srb_dte_energy_bridge
    ip: x.x.x.x

#try4
sensor:
  - platform: mqtt
    name: "Household Electricity Usage"
    icon: mdi:transmission-tower
    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

Lastly - my mosquitto broker add-on configuration

logins: []
require_certificate: false
certfile: fullchain.pem
keyfile: privkey.pem
customize:
  active: true
  folder: mosquitto

any help or advice would be greatly appreciated!

Are you running a current version of HA?

mqtt should be in its own section now, like this:

mqtt:
  sensor:
    - name: "Raw Energy Usage"
      unique_id: energy_bridge_summation_minute
      state_topic: "event/metering/summation/minute"
      icon: mdi:flash
      value_template: "{{ value_json.value }}"
      # the Energy Bridge outputs the Watt-minutes of energy used in the last minute
      unit_of_measurement: 'Wmin'

    - name: "Household Electricity Usage"
      unique_id: energy_bridge_summation_minute_kwh
      state_topic: "event/metering/summation/minute"
      icon: mdi:transmission-tower
      unit_of_measurement: 'kWh'
      # the Energy Bridge returns "Watt-minutes" (Wmin) every minute; 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

Note: that the Raw Energy Usage sensor is optional; you really only need the second one.

BTW, you shouldn’t need to send anything but event/metering/summation/minute in your mosquitto.conf file — the “instantaneous” readings are just that, an “instantaneous” power (not energy) reading, and just fills up your history database with power readings for that particular instant of time every few seconds. If you decide you want to display that instantaneous value on a dashboard, you should exclude the instantaneous sensor from the recorder.