Gude Systems PDU 8035 series integration via MQTT: Part 1 - Introduction
This project is about connecting a PDU to Home Assistant by using a MQTT Discovery script and allow Home Assistant to control the PDU. In doing so, I hope it can also serve others.
Sorry that this is a long post.
I needed to split this article up five parts:
- part 1: Introduction (the part you are reading now),
- part 2: Preparation,
- part 3: The MQTT Discovery script code,
- part 4: The automation script code,
- part 5: The Dashboard code.
What is a PDU and why use it?
PDU stands for Power Distribution Unit. Simply put: you use a PDU to power on devices in a certain fixed order. You might want this for example when the electricity turns back on after a power failure on the utility grid and you want to make sure that your router and internet connection is up, before starting up your Home Assistant computer.
By using a MQTT discovery script, an automation and an input.boolean variable, this PDU can be discovered via MQTT and added automatically when HA starts. I also made a simple dashboard in Home Assistant.
Below a partial picture of the PDU in MQTT
Compatibility with other Gude PDUs
The discovery script is designed for a Gude Systems 8035 series 8-fold switched and outlet-metered PDU, but it can easily be adapted to the 8031 series. The difference between the two is the 8035 also measures voltage, current and power per outlet. If you disable the per outlet current and per outlet power in my script, you can use the script also for the 8031 series PDU. The discovery script is a collection of building blocks to make adapting the script easier for the other PDU models of Gude Systems, since – at first sight – they only differ on the amount of ports and per outlet measurements. Gude Systems is a German manufacturer.
The dashboard
The dashboard is intentionally simple and consists of three main sections: Line In, Outlets, and Maintenance.
Below is a picture of the PDU dashboard
Line in section
Column 1 through 3 shows line voltage, total current, and power.
Column 4 shows the boolean state of variable pdu_mqtt_telemetry_received. You can press the envelope icon when you want the MQTT discovery script run again, for instance when dashboard data gives rubbish.
Column 5 enable you power cycle all outlets. All outlets are switched off from outlet 8 trough 1, and are turned on respecting the cold start delay defined in de PDU for each outlet.
Outlets section
This section shows per outlet:
- the outlet state (on/off),
- the outlet label as defined in the PDU. Labels are extracted from the telemetry data so it is one way: PDU > HA.
- power and current
- option to power cycle this outlet. To ensure that a switched power supply lasts longer, a power cycled outlet stays out for 30 seconds before turning it back on.
When an outlet is switched off, only outlet number, outlet and label is shown.
The state of each outlet is synced.
Maintenance section
Column 4 shows the boolean state of variable pdu_mqtt_telemetry_received. You can press the envelope icon when you want the MQTT discovery script run again, for instance when dashboard data gives rubbish. Since we rely on telemetry data, it is important to see if telemetry data is received.
Column 3 enables you to reboot the PDU. In my test lab, I discovered that the PDU sometimes did not send telemetry data anymore (probably because I messed around too much). The only remedy was to reboot the PDU. For the Gude Systems 8035 series PDU, this means that the OS reboots, but the state of the outlets remains unchanged. A great feature!
How does it all work?
I assume you use the default mqtt broker that comes with HA.
The PDU connects to the mqtt broker, and publishes each 60 seconds telemetry data on a mqtt topic (in my case) de/gudesystems/epc/00:19:32:02:4f:40/device/telemetry.
The automation script will be triggered when something is published on this mqtt topic, and check if the input.boolean variable pdu_mqtt_telemetry_received is set or not. If not, it will set the pdu_mqtt_telemetry_received variable to true and execute the MQTT Discovery script that defines our PDU in HA via MQTT Discovery.
Afterwards, the automation script will still be triggered when a message is received on mqtt topic de/gudesystems/epc/00:19:32:02:4f:40/device/telemetry, but it won’t execute the MQTT discovery script because the input.boolean variable pdu_mqtt_telemetry_received is set to true.
Because MQTT discovery devices are not remembered by HA after a reboot, this variable is set to false each time when HA starts, so my discovery script is executed automatically when HA is started and the PDU has checked in.
What you need
Before you start
- Make sure your MQTT integration and broker are set up in Home Assistant and works.
- Home Assistant is using MQTT over tcp. Make sure Home Assistant and the PDU can “see” each other (try pinging).
- Since MQTT communication (in this case) is not encrypted, it is best that you put the PDU – together with your Home Assistant – on a separate network segment and restrict access to that network segment.
- Make sure the PDU and Home Assistant have a fixed ip address. In my test lab, I used an ipv4 address, but you can use also an ipv6 address. For the latter, I suggest you use your link local (fe80…) address.
The MQTT discovery script
To script that defines the 8035 by using MQTT discovery, is actually a script bundle. I did this to make it easier for others to test and adapt the script.
Devices that are added via MQTT discovery, are forgotten by HA upon reboot. Also, when you would power on the PDU after HA is started, the PDU would not be seen by HA. My quick fix solution for this is to make:
- an automation script to execute my MQTT discovery script bundle when the PDU is “alive” by sending telemetry data.
- a variable to keep record if telemetry data is received from the PDU. When this variable is set, it also prevents the automation script to re-execute my MQTT discovery script. This has another advantage: by resetting this variable, you can re-execute the MQTT discovery script again when needed.
I rely on the telemetry data the PDU sends each 60 seconds, to
- know the PDU is alive,
- to get information in regard to power, voltage, current and port labels.
Special thanks
Getting this all worked out took me about a month fulltime. I never worked with mqtt and never wrote scripts in HA. I could not have done it with the help of AI (mostly Mistral AI and sometimes ChatGPT). Even when the suggested codes by AI was often wrong, it helped me pointing in the right direction. I also like to thank community member Didgeridrew and others who helped me pointing in the right direction when I was really stuck on a fundamental coding part.
I also like to thank Gude Systems for their excellent technical documentation https://wiki.gude-systems.com/MQTT_eng in regard to mqtt and what commands are available for cli via mqtt.
Johan



