DTE (Powerley) Energy Bridge Endpoint error

Ahah! thanks @kidmock, it works, I appreciate it! This is so satisfying to my family when I ask to turn everything OFF, when I see that anything has turned on, except for my toys…:crazy_face:

I also had a typo in mqtt section of configuration.yaml here’s what I have added in that works, in configuration.yaml

    mqtt:
      broker: <rasp_pi_ip>
      port: 1883
      client_id: home-assistant-1
      username: <mqtt_username>
      password: <mqtt_password>
    sensor:
      # Main meter electrical flow courtesy DTE monopoly
      - platform: mqtt
        name: "DTE Energy Bridge"
        state_topic: "event/metering/instantaneous_demand"
        unit_of_measurement: 'W'
        value_template: "{{ value_json.demand }}"

and in /etc/mosquitto/mosquitto.conf

connection dte
address <energybridge_ip>:2883
remote_username admin
remote_password trinity
try_private false
start_type automatic
topic # both 0
1 Like

Great find and thank you for sharing.

This is quasi-working for AEP too. I think they are testing because earlier today I was only getting some polling_mode topics. Then I started getting three variations of the /summation/minute topics and then eventually the instant demand topics. While I’m typing this the metering all stopped and came back. It’s a bit unreliable right now but I’ll leave it up and see if it stabilizes.

Also, for the mosquito.conf file, I would recommend setting topic to # in 0 and not both. I don’t think we should be publishing all of our topics to their broker. I ended up sending their broker a few retain clears because my initial config published all my topics to their broker and it retained the ones flagged retain.

You need to or at least I needed to publish “something” to request/is_app_open to keep the stats alive.

Hence why “topic # both 0” and the crontab entry.

*/5 *   * * * mosquitto_pub -h mqtt_server -p 1883 -u username -P password -t 'request/is_app_open' -m '{"request_id": "ha-monitor"}' >/dev/null 2>&1

ah! I should actually read the posts and not skim them :slight_smile: thank you for taking the time to reply - my bad. instantaneous works now. I opted for the crontab entry.

Just another point on the bridge configuration and crontab. With the mosquitto bridge configured to forward traffic in both directions with:

topic # both 0

I was getting a lot of duplicate MQTT messages (using ESPHome for a bunch of sensors and actuators). It seems that the Energy Bridge was reflecting the traffic back to mosquitto for some reason. To fix this I set the mosquitto configuration to just explicitly bridge the topics I need in the input direction with:

topic event/metering/# in 0

Then to keep the data coming I am sending the keep alive messages directly to the broker on the Energy Bridge device with this crontab entry:

*/5 * * * * mosquitto_pub -h <Energy Bridge IP> -p 2883 -u admin -P trinity -t 'remote/request/is_app_open' -m '{"request_id": "ha-monitor"} >/dev/null 2>&1'

This setup has been working well for a while. The only downside I see is that the Energy Bridge IP address and credentials need to be maintained in two places, but I’ve nailed it to a specific address in my router so that is no issue. Anyone see other reasons why this setup should not be used?

I get Error: Connection refused when running the following on my AEP (Ohio) Powerley Energy Bridge V2.

mosquitto_sub -h 10.0.1.135 -p 2883 -u admin -P trinity -t "event/metering/instantaneous_demand"

Anyone else having similar problems or have any suggestions?

That likely means its not listening on port 2883. Mine is still working as of this reply. Maybe reboot the bridge?

i noticed the instantaneous_demand topic is available at “event/metering/instantaneous_demand” and “remote/event/metering/instantaneous_demand” but you are not even getting connected to be able to receive published topics.

Already tried rebooting the bridge and no luck, maybe AEP has different credentials to login?

Try connecting with the app, is the phone app still working with the bridge? If not, something else going on.

Does this get you anything? subscribe to all messages. assuming mosquitto is working, and the ip is correct (check router if it ended up at a different address).

mosquitto_sub -h your.energy.bridge.ip -p 2883 -u admin -P trinity -t "#"
1 Like

I don’t think its credentials if you are getting a connection refused. Try a basic test with telnet to see if the port is listening. Here is a good and failed example from a linux host. Use your bridge’s ip.

$ telnet 192.168.10.25 2883
Trying 192.168.10.25...
Connected to 192.168.10.25.
Escape character is '^]'.
^]
telnet> close    
Connection closed.

$ telnet 192.168.10.25 2884
Trying 192.168.10.25...
telnet: Unable to connect to remote host: Connection refused

Which behavior do you get?

FYI, for anyone else having problems. I have an AEP Ohio (Powerley) Energy Bridge v2.

I was finally able to connect on port 1883 (with username and password above) and am now seeing multiple topics.

event/metering/summation/minute shows what appears to be the total usage in summary and is updated every minute automatically (no need to send a keep alive message)

event/metering/instantaneous_demand shows the instantaneous demand as discussed, it requires a message sent to request/is_app_open every so often to keep the topic updates alive.

2 Likes

Good find. This is a much better approach

No more need for the cronjob, and no more duplicate entries

If you followed this thread thus far change:

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

to

state_topic: "event/metering/summation/minute"
value_template: "{{value_json.value}}"

looks like there was an update again…

authentication is no longer required. In your mosqitto config make it something like:

connection energy_bridge
address IP_OF_BRIDGE:2883
clientid homeassistant-2
try_private false
start_type automatic
topic event/metering/# in 0

@kidmock @hasshoolio

Hi I’m a noobie to this MQtt stuff, but have been using Hassio on my NUC -(Debian with Docker) for about 6 months very successfully.
I just received my DTE Energy Bridge and want to try to pull data from it as a sensor in HA.
I’ve tried to follow this thread but it gets confusing since I’m not familiar with MQTT other than I have added the Mosquito broker add-on in. Some of the posts sound like I don’t need a “local” broker or am I just confused?

Can one of you more experienced users give a set of instructions to possibly get this up and running?
It would be much appreciated.

Thank you

So… MQTT is message queue protocol that a lot of devices use. Devices publish their information to the queue and stuff like HA subscribe to that queue to read state changes and the like.

Mosquitto is software that implements MQTT.

That being said if you have no devices that are publishing to YOUR Mosquitto server. You don’t need Mosquitto. I like many others use owntracks and sonoff devices and the like that publish to my own private MQTT server (mosquitto).

HA can’t subscribe to multiple MQTT servers, so you may need to aggregate the data to a single source. This is the majority of the detail spewed in this thread.

Now, if you are ONLY using the DTE Energy bridge… You don’t need to go through the hassle. You just configure the mqtt Server as the energy bridge itself.

like so:

mqtt:
  broker: <IP_OF_BRIDGE>
  port: 2883
  client_id: home-assistant-1

sensor energy:
  - platform: mqtt
    name: "DTE Energy Bridge"
    state_topic: "event/metering/summation/minute"
    unit_of_measurement: 'W'
    value_template: "{{ value_json.value }}"
 

BTW Hello from DTW

1 Like

Thanks for the info. That confirmed what I thought I was reading, I’ll give it a try later tonight.

Using your info worked perfect. Thank you

1 Like

I found this thread back when people hadn’t figured out a replacement for http://192.168.0.xx:8888/zigbee/se/instantaneousdemand. I’m back here and trying to make sense of the new findings. Previously I sent a simple API request to that URL to get the current load. Is there an HTTP equivalent for

sensor energy:
  - platform: mqtt
    name: "DTE Energy Bridge"
    state_topic: "event/metering/summation/minute"
    unit_of_measurement: 'W'
    value_template: "{{ value_json.value }}"

I am trying to connect with telnet to my Bridge’s IP on port 1883 or 2883, and getting “connection refused” in both cases, before I get to try any credentials. Port 2883 takes way longer to fail, though, so there may be something there. Port 8888 still responds to web with the same pages as before, so I know that it is online at the same address.

Edit: I ran Angry IP scanner against that IP for every possible port (1-65535, took nearly 4 hours) and found these open ports: 22, 53, 2883, 5355, 8888

HTTP no longer works for most. You’ll need to setup MQTT first like I mentioned in my last post.

Of course, your device may be different from my DTE Energy Bridge in the Detroit Market.

Fair. I have never heard of MQTT before. How can I set that up? I’ve tried a bunch of different programs that claim to be for MQTT and entered in the IP, port, credentials, topic, and never get anywhere. I am mostly looking for something command-line so I can monitor the power usage with my network monitor.