RoomHub - wired MQTT gateway for multiple devices

Edit 17.03.2021:
I’ve created next revision of RoomHub which is now called MqGateway. You can read more in the separate thread.
Thank you for all the suggestions in this thread. They helped me to introduce changes to my project and improve it.

Hi All,

I would like to introduce RoomHub - MQTT Gateway for multiple wired sensors and controllers.

RoomHub has been created to support multi-device, fully wired solution. It supports MQTT Homie convention and provides easy integration with OpenHab.

Typical use case for RoomHub is house with sensors and controllers distributed all around with wired connections. It is possible to plug in simple and inexpensive devices, like relay modules, PIR motion sensors or just plain wall switches into RoomHub to make capable home automation system. These are the same sensors/modules which you would use with Arduino projects, but you don’t need to do any programming yourself - just simple configuration.

RoomHub communicates with OpenHab through MQTT message broker.

In theory, single RoomHub allows to connect:

  • up to 64 digital input/output devices (like relays or switch buttons) and

  • up to 16 analog input devices and

  • up to 255 devices with PJON protocol.

For now supported devices are:

  • relay module

  • switch button

  • emulated switch (useful for opening gates)

  • motion detector

  • SCT013 for current measurement

  • BME280 for temperature and humidity (through single-wire PJON)

Hardware-wise RoomHub consists of rather simple electronic components. The aim was to make it easy to assemble for amateur electronic hobbyist.

All the work done for RoomHub is available freely under Open Source Licenses.

Why I’ve created RoomHub

When I was doing major renovation at my house, I’ve decided to go with as much wired smart devices as possible. RoomHub 3 is my third approach to create inexpensive, wired MQTT gateway for Arduino-capable modules.

I’ve created the device for my own needs, because I haven’t found anything which would suit my requirements. However, with the third approach, I believe it is flexible and quite easy to use, so maybe others can benefit from it as well.

What’s next

Find out more in the documentation: RoomHub 3

I’ve got six RoomHub devices around the house working for about 7 months now. It has proved to be stable now, although I still consider it to be in development. I am working to add support for more type of sensors and additional features (like firmware upgrade over-the-wire).

I would like to know if there is any interest in device like RoomHub. There is considerable amount of work related to creating documentation and maintaining project in an open source manner. I want to know if this is of any value for anyone else than me :slight_smile: .

Is there any need for wired solution at all? Do you use something else for the similar use case?

Let me know if RoomHub is something which makes sense for you. Any feedback is welcome.

Edit: 22.09.2020
Because of the problems with W5500 and ESP32 (Ethernet connection stability problems) I have replaced ESP32 microcontroller with full fledged SoC. I am using NanoPi NEO, but it could also run with RaspberryPi and other similar boards. This setup gives me more possibilities. I have finally solved support for more complex sensors like BME280 and DHT22. I have also improved support for existing devices.
I am still working on some parts and I hope to present more details soon.


There is no details on how to connect the device with Ethernet. All that is mentionned is additional ethernet controller (W5500). And that another firmware is required for that.
How do I connect the W5500?
Where is that firmware?
Where do I get the gerber files for the boards?

Hi @vzorglub,
Thank you for pointing this out. I am still working on improving documentation.

Currently there are two versions of RoomHub firmware built - one for WiFi connection and second one Ehernet-based connection.
Switching between these versions is done on the compilation level with “define” directives in the code.

W5500 can be connected to ESP32 with the SPI pins which are exposed on the RoomHub mainboard.

Gerber files are not yet published. I will publish it soon and let you know.

1 Like

It would be great to document this.
The way I see it, this device enables wired connection to sensors.
I prefer wired to wireless. Safer, more reliable…
So in my mind the device should be enabled for Ethernet by default.
Where does the W5500 goes?

1 Like

By W5500 I meant modules like this.

If you look at the photo in my first post - you can see there is a hole on the left side of the RoomHub case. This is where Ethernet port from W5500 module can be exposed.

Saying that, with the modules I was using, I had some intermittent connection issues. I haven’t solved that yet. It is described better in the GitHub issue.

1 Like

A PoE version would be handy for sensors

1 Like

Which sensors are running PoE?

It’s an obvious thing to do with self-build wired sensors. There are hardly any commercial ethernet sensors, except big boys industrial items.

But I think I completely misread this device, thinking the “downstream” side was ETH.
So far as I can make out,it can supply +5V to wired sensors which fits the power-over-one-cable need.

A +12V supply would sometimes be useful for e.g. standard (cheap) burglar alarm PIRs, but that can be arranged externally.

I guess it would have to support 3.3volt, 5.5volt and probably somewhere between 9-24volt all DC to cover most parts. I do like the idea of having PoE powered devices. I hate those damn battery devices. But I think it would be too complicated as there isn´t any clear stardard for powering devices this way…

I’ll second the idea about sensor voltages. It would be great if we could use the typical ranges from 3.3v up to 24v for those of us who already have wired sensors with the wires left dangling in a closet because the alarm company tore out the controller when the previous owner of the house cancelled their service.

1 Like

I dont need this device personally, because I have a small flat.

But I think the idea is great and I would like to provide some thoughts:

  • add support for 1-wire bus
    or DS18B20 sensor
  • add at least one status LED
    You would want to know if the device is powered.
    Maybe an RGB-LED.(green=powered on, yellow=wifi/lan connected, blue=mqtt connected, …)
    Maybe even multiple LEDs that can be defined by the user to show states of relays or switches.
  • add the board layout (all about the hardware) to the git repository, so other users can provide improvements via pull requests.
  • post this in the home assistant forum if you didn’t do that already.
    It might double the popularity of this project. :wink:

Just my 2 cents. :smile:


And a completely other thought:

If the RoomHub would use ESP8266 (fewer pins, I know), you could just use Tasmota, right?

1 Like

Great idea @maniekq, I have been looking for something like this for a while. I was thinking on a whole house level, located at the patch panel, however I guess this could be used on a room/pair of rooms level.

Most home automation stuff is wireless, but I sought to go down the wired route to avoid maintaining battery powered sensors, issues with wifi. I found nothing out there for wired sensors/switches like this.

I’m using STM32 BluePill-like boards in each location with W5500 ethernet (mbedOS/MQTT), however this is overkill for a simple light switch.

1 Like

Thank you all for the feedback and ideas.

RoomHub does not support 1-wire. Instead, I’ve decided to support PJON protocol. This way it is possible to add more complex devices (which cannot be connected to regular digital or analog pins - also 1-wire devices). However, this requires some Arduino (e.g. Mini) on the other side, together with the sensor. Currently BME280 is supported this way.
For temperature sensor, I also plan to support DHT22 (it can be connected to simple digital port).
I like the idea about LED very much. It is definitely something I miss. I will add it in the next board revision. For now - there are a few unused ESP32 ports left exposed on the RoomHub board and I will try to use those.
I have published schematics and PCB design files from KiCad on GitHub.
Thanks a lot for your feedback. A lot of valuable thoughts.

@keeperlit I am glad there are more people looking to solve similar problem to mine.
The way I use RoomHub is having them distributed around the house (that’s how it got it’s name :wink:). This is because I was renovating old house, but didn’t want to change the electricity part so I keep relay modules in the wall switch boxes. I’ve saved some cables by distributing RoomHubs. Also, first version of RoomHub was pretty big so couldn’t fit five of those in one room :laughing:.
However, I think it makes perfect sense to locate RoomHub (or even few of them) in the central place when you have proper electrical wiring around the house and you can control it with multi-relay module next to RoomHub.

@vzorglub I have published schematics and PCB design files from KiCad on GitHub. Please let me know if Gerber files are preferred.

1 Like

Publish the gerbers as well. So of us don’t have the software to create these and a pcb can be ordered from gerbers only.

Good point. You can now download Gerber files from GitHub release.

I was thinking quite similar but went slightly different way. My “RoomHub”, or better “FloorHub” is simply Arduino Mega with W5500 LAN module and I/O pins from Arduino Mega wired to RJ45 female connectors.

So Arduino Mega is linked via W5500 LAN directly to my network router, the Openhab server with running MQTT Broker is also connected to the same network. And all sensors are connected to the Arduino Mega box via LAN cable and RJ45 connector. Arduino Mega is then sending and receiving data and commands to / from sensors via MQTT.


  • Easy to obtain and replace HW
  • Relatively inexpensive


  • you must code the Mega yourself (may also be in pros :-))
1 Like

@FrankCZ Sounds like your FloorHub fulfills very similar requirements to mine. I’ve actually started with Arduino Mega, W5100 Ethernet shield and I/O pins connected to patch panel in my first approach. This solution has its limitations, but it is certainly very simple and easy to manage in some scale. It is great to hear that others are also going into wired solutions.
I’ve been struggling with some problems having this setup, so it is very interesting for me if you’ve overcame them.
Do I understand correctly that you connect multiple devices/sensors/modules to single Arduino Mega?
Do you have many types of devices (e.g. relays, switches, motion sensors) supported by the same Arduino Mega or you support one type per Arduino? I remember that I hit memory limits when trying to support multiple types of sensors :frowning: .

What I’ve tried to achieve with Roomhub is easy way for configuring sensors/devices. My six RoomHubs are currently control 29 light points with wall switches, 3 roller shutters, 1 garage door, 4 motion sensors, 2 reed switches, 1 temperature and humidity sensor (I hope I counted it properly). It’s not much, but I plan to add another 8 motion sensors, more than 30 reed switches and 10 temperature sensors. With that many devices I thought I need something easy to configure to stay sane :slight_smile: .

I would like RoomHub to be also fully wired. It is working with W5500 ethernet module, but there is some instability with MQTT connection sometimes which I am currently trying to fix.

1 Like

It’s AWESOME project!
I have only one concern, PIR motion sensors are 9v-15v, do You have any solution how to power them with your RoomHub?

Great comments so far, I’m really interested to see how this develops!

@Le_Gal I use simple PIRs that can run off 5v:

What kind of cable lengths were you able to use reliably @FrankCZ and @maniekq between the arduino and sensors? I’ve got light switches run over ~5-15m between micro and wall switch and would like to add temp/humidity, PIR and eventually a screen. Was considering squeezing a board, W5500 and PoE power into the wall but it’s tight!