How to Set Up NetRelay with Home Assistant
NetRelay can be used with Home Assistant through MQTT. Once the setup is complete, you can turn NetRelay relay outputs on and off, monitor digital input states, and use them in Home Assistant automations.
This guide is written for users who have little or no experience with Home Assistant or MQTT.
Important: NetRelay is not added directly to Apple Home or Google Home. First connect NetRelay to Home Assistant. Apple Home or Google Home integration can be added later if needed.
Before you start
You will need:
- A working Home Assistant installation
- A NetRelay device
- NetRelay and Home Assistant connected to the same local network
- The IP address of Home Assistant
- Access to the NetRelay web interface
Example:
- Home Assistant IP:
192.168.1.20 - NetRelay IP:
192.168.1.50
Your IP addresses may be different. These addresses are only examples.
1. Install Mosquitto MQTT Broker
Communication between NetRelay and Home Assistant is handled through MQTT.
You can think of MQTT as the communication channel that allows NetRelay and Home Assistant to exchange messages.
Open Home Assistant and follow these steps:
- Open Settings.
- Go to Add-ons.
- Open the Add-on Store.
- Search for
Mosquitto. - Select Mosquitto broker.
- Click Install.
- Enable Start on boot after installation.
- Click Start.
The Mosquitto add-on should now show that it is running.
2. Create an MQTT user
NetRelay needs a username and password to connect to Home Assistant.
In Home Assistant:
- Go to Settings → People.
- Open the Users tab.
- Select Add User.
- Enter a username such as
netrelay. - Create a password.
- Save the user.
Write down the username and password because you will enter them into the NetRelay web interface later.
The MQTT user does not need administrator privileges.
3. Add the MQTT integration
Now Home Assistant needs to be configured to use MQTT.
- Go to Settings → Devices & Services.
- Click Add Integration.
- Search for
MQTT. - Select the MQTT integration.
Home Assistant will usually detect the Mosquitto Broker automatically.
If a username and password are requested, enter the MQTT user credentials you created earlier.
Example:
- Username:
netrelay - Password: your MQTT password
If Home Assistant does not automatically detect the broker, use the Home Assistant IP address as the broker address.
Example:
- Broker:
192.168.1.20 - Port:
1883
4. Find the Home Assistant IP address
You need to enter the Home Assistant IP address into NetRelay.
For example, if you open Home Assistant using:
http://192.168.1.20:8123
then the Home Assistant IP address is:
192.168.1.20
Be careful with the port number:
8123is the Home Assistant web interface port.- Do not enter
8123as the MQTT port on NetRelay. - The MQTT port should be
1883.
5. Open the NetRelay web interface
Now configure the NetRelay side.
Enter the NetRelay IP address in your web browser.
Example:
http://192.168.1.50
Log in to the NetRelay web interface.
6. Give your NetRelay a device name
This step is optional but recommended, especially if you have multiple NetRelay devices.
Open the Settings section of NetRelay.
Example settings:
- Hostname:
Living-Room-Relay - Device ID:
1000
If you have more than one NetRelay device, each device should have a different Device ID.
You can also give the inputs and outputs meaningful names.
For example:
- Output 1:
Living Room Light - Output 2:
Garden Light - Input 1:
Door Sensor
Save the settings.
7. Configure NetRelay MQTT settings
Open the MQTT Client section of the NetRelay web interface.
Configure the settings as follows:
- MQTT Server: Home Assistant IP address
- MQTT Port:
1883 - MQTT User: MQTT username created in Home Assistant
- MQTT Password: MQTT user password
- MQTT TLS: Disabled
- MQTT Client Mode: Enabled
- Home Assistant: Enabled
Example:
MQTT Server : 192.168.1.20
MQTT Port : 1883
MQTT User : netrelay
MQTT Password : ********
MQTT TLS : Disabled
MQTT Client Mode : Enabled
Home Assistant : Enabled
Do not change the Topic or Sub Topic fields during the initial setup.
Save the settings. NetRelay may restart.
After it starts again, open the MQTT page.
You should see:
MQTT UP
in green.
If MQTT UP is displayed, NetRelay has successfully connected to the Home Assistant MQTT broker.
8. Find NetRelay in Home Assistant
Return to Home Assistant.
- Open Settings → Devices & Services.
- Select the MQTT integration.
- Open the devices list.
Your NetRelay should appear using the Hostname you configured.
For example:
Living-Room-Relay
The NetRelay device should normally contain:
- 4 switches: NetRelay relay outputs
- 4 binary sensors: NetRelay digital inputs
9. Test the relays
Open the NetRelay device in Home Assistant.
Turn on the first relay switch.
The corresponding relay on NetRelay should activate and you may hear a click from the relay.
Then trigger one of the digital inputs.
The corresponding binary sensor state in Home Assistant should change.
If both tests work, the setup is complete.
Home Assistant compatible NetRelay firmware
You can download the Home Assistant compatible NetRelay firmware from the link below:
Download NetRelay Firmware v3.3.5 HA
What should I do if MQTT UP does not appear?
If NetRelay displays MQTT DOWN, check the following items in order:
- Is the MQTT Server set to the correct Home Assistant IP address?
- Is the MQTT port set to
1883? - Are the MQTT username and password correct?
- Is Mosquitto Broker running in Home Assistant?
- Are NetRelay and Home Assistant on the same network?
- Is MQTT Client Mode enabled on NetRelay?
MQTT is UP but NetRelay does not appear in Home Assistant
If MQTT is connected but the device does not appear:
- Make sure the Home Assistant option is enabled on NetRelay.
- Check that the MQTT integration is installed in Home Assistant.
- Refresh the Home Assistant page.
- Restart NetRelay.
Can I use Apple Home or Google Home?
Yes, but NetRelay is not connected directly to Apple Home or Google Home.
The correct connection flow is:
NetRelay → Home Assistant → Apple Home / Google Home
For Apple Home, you can use the HomeKit Bridge integration in Home Assistant.
For Apple Home and Google Home support, an appropriate Matter Hub solution can also be used.
This step is optional. Apple Home or Google Home is not required to use NetRelay with Home Assistant.
Quick setup summary
Here is the complete setup in a few simple steps:
- Connect NetRelay and Home Assistant to the same network.
- Install Mosquitto Broker in Home Assistant.
- Create an MQTT user.
- Add the MQTT integration to Home Assistant.
- Write down the Home Assistant IP address.
- Open the NetRelay web interface.
- Enter the Home Assistant IP address as the MQTT Server.
- Set the MQTT port to
1883. - Enter the MQTT username and password.
- Enable MQTT Client Mode.
- Enable Home Assistant.
- Save the settings and check for MQTT UP.
- Find NetRelay under MQTT devices in Home Assistant.
- Test the relay outputs and digital inputs.
Once the setup is complete, you can control NetRelay relay outputs from Home Assistant, monitor digital inputs, and use both inputs and outputs in your Home Assistant automation scenarios.