Help with DTE Energy Bridge (Powerley Energy Meter) and MQTT

I have spent maybe months trying to get this to work. I currently am having many different issues. I am working on trying to integrate my DTE energy bridge that gives real time data in the app and I want to bring it to HASS. I have a V2 model from DTE and it does not work with the integration that is there in HASS. The goal is to bring that into the energy tab but I cannot even get MQTT to even start with some configuration files changed and added.

Error 1:
When starting Mosquitto broker I get this error:

1673055200: Error: Unable to open include_dir '/share/mosquitto/'.
1673055200: Error found at /etc/mosquitto/mosquitto.conf:37.

This causes the addon to stop running.

Error 2: Seems maybe no data is coming through (I am still trying to understand MQTT as a whole) yet confirming

mosquitto_sub -h 172.16.101.170 -p 2883 -i some_identifier -t 'event/metering/summation/minute' -v

through HASS terminal I do see data by the minute.

Error 3: I know that my configuration.yaml might have some deprecated ways that sensors are shown but I cannot still figure that part out.

About my setup:
Using ESX 8.0 following: Alternative - Home Assistant .ova.
Running the latest version of home assistant.
Configuration.yaml (With a few parts removed for privacy):

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

# Text to speech
tts:
  - platform: google_translate

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
frontend:
  themes: !include_dir_merge_named themes
device_tracker:
  - platform: bluetooth_tracker
aerogarden:
    username: redacted
    password: redacted
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

I have Mosquitto broker configuration as:

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

I have in the home assistant terminal /share/mosquitto/dte.conf as: 
```
connection dte
address 172.16.101.170:2883
clientid homeassistant-1
try_private false
start_type automatic
topic # both 0
```

I have followed through different forum posts on here so my config has changed around trying different things. 

Some links to what I have tried to see where I am getting data from:
https://community.home-assistant.io/t/dte-powerley-energy-bridge-endpoint-error/91160/72 (This whole thread)
https://www.reddit.com/r/homeassistant/comments/sa1l43/dte_energy_bridge_home_assistant/
https://www.reddit.com/r/homeassistant/comments/xa2de0/dte_energy_bridge_with_mqtt/ (this can point me somewhere in the right direction for the new configuration.yaml new template but still not fully understanding)
https://www.reddit.com/r/homeassistant/comments/fby8bo/finished_setup_for_power_meter_dte_smart_bridge/ 

The main issue that is stopping me from moving further is error 1. I have tried a new vm and restoring my configuration from a backup before the reinstall and that has not changed anything. I have refollowed the MQTT install directions from the home assistant integration page and different posts many times and still no luck. I have an MQTT local user. Administrator and regular user no difference. Any help would be really appreciated. If I need to work on a different HASS instance to get it working and move the rest of the home over I can. 

Thanks again in advance!

(Small note that is not too relevant but I am working on my water meter and gas meter with: https://github.com/jomjol/AI-on-the-edge-device and this uses MQTT as well. I have also looked into an rtl-sdr dongle for the electric meter since its compatible and that is on the way soon.)

I wanted to update this thread with what got it working for me.

Error 1: I had to clean install and start everything back from scratch. (Maybe could have been able to get away with a restore from backup but I wanted to ensure that I had nothing bad transfer over) First thing I did was set it up and it worked.

Error 2: I read through the reddit threads and forum posts even more here to understand MQTT a bit more to help. I will post what worked for me for anyone else that might have the same issue below.

Error 3: I read through some examples and explanations of the new configuration.yaml template for MQTT. I will post what got it working for me below as well.

My code:

/share/mosquitto/dte.conf (Create this if you do not already have it)

connection dte
address <ip-address-of-bridge>:2883
try_private false
start_type automatic
topic event/metering/# in 0

Mosquitto addon configuration:

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

Finally 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
mqtt:
    sensor:
          name: "Energy Bridge"
          icon: mdi:transmission-tower
          state_topic: "event/metering/summation/minute"
          unit_of_measurement: 'W'
          value_template: "{{ value_json.value | round(0) }}"  
aerogarden:
    username: redacted
    password: redacted

I am not using the energy tab since I am having issues with helpers converting it right. If anyone has a way to get it to properly show kwh without it not being wrong let me know. It keeps calculating less than 1.5kwh when I use on average 3KWs consistently all the time. Maybe I am not giving it enough time to calculate out.

I know this is a very stale thread but here is my code that worked before I re-setup my MQTT to work with Mosquitto (previously I had MQTT setup just to see the energy Bridge), I used your setup to see if I can get it working again since I am now on Z2M and needed Mosquitto and MQTT back.

mqtt:
  sensor:
    - name: "DTE Energy Bridge"
      state_topic: "event/metering/summation/minute"
      unit_of_measurement: 'W'
      value_template: "{{ value_json.value | round (0) }}"

sensor:
  - platform: integration
    source: sensor.dte_energy_bridge
    name: energy_spent
    unit_prefix: k
    round: 2
  
utility_meter:
  energy_daily:
    source: sensor.energy_spent
    cycle: daily

EDIT: I have gotten it working with it going through Mosquitto MQTT instead of just native HA MQTT and it’s in energy tab