[RELEASE] Hubee - A framework to use DIY sensors/actuators with programmable XBee modules

This project is similar to HubDuino, but using programmable XBee modules instead of Arduino.

You can use sensors/actuators connected to an XBee, with the advantage of having a single device that talks to the sensors/actuators and communicates with the hub using Zigbee.
Also using a much more friendly programming language (in my opinion).

I started this project with only my own home in mind, but it turned out to be way more challenging than expected, took me long months of work since almost everything was new to me.
Then I thought that it would be big a waste of resources to use it only for myself, for a single home, so I've made it open source: GitHub - esimioni/hubee

If you are interested in the project please read the the README.md in the repository and if you can contribute, that will be very welcome.

I'm not a microcontroller or home automation developer, and I won't have a lot of free time in the coming months since I have to finish the rest of my house and move in.
Community contributions will probably make their way to the codebase much faster if done through pull requests.

The documentation still needs to be improved, if you run into issues or have suggestions, please share here.

Thanks @NoWon and @ogiewon for your work and help, without you and this amazing community this project wouldn't be possible.


This is awesome. Question-have you used the Hi-Link mW radar sensor? Aliexpress reviews say it is overly sensitive and outputs info even when the room is empty.


Yes! That review is mine BTW :smile:

Unfortunately AliExpress doesn't allow you to change the review, but what I found after writing it, is that this sensor is actually very sensitive to voltage drop.

If the voltage gets below a threshold (somewhere around 3.15V) the device will start to report presence when there isn't. Then, even if the voltage gets back above that threshold, the device won't recover, it needs to be power cycled.
It took me around a month of testing/headaches/frustration to find that out :sob:

Very tricky sensor to work with, because it uses UART instead of I2C, and the XBee model I'm using only has 1 UART, which is also used to communicate with the computer. Debugging wasn't straightforward at all.

Also you cannot ask for a "current reading" like most sensors. When it detects presence, it keeps throwing information at you at a very high rate.

After overcoming all those issues, it is working well so far.


I've made some changes lately and now I consider it to be production ready.

It was working before, but it could have some latency issues, because all sensors are checked in a loop and 2 of them had long sleep periods (1 second for illuminance reading!!!).
BME680 and TSL2591 were changed to work without any sleep.
Memory footprint has also been improved.

One of the things I like a lot about this framework it that for numeric sensor readings you can reduce or increase the amount of reported values to your liking, avoiding too many or too few reports.
Here is an example:

In this case I'm telling it to report only when the illuminance reading changes 10% or more (compared to the previous report).
It will report at most 1 reading per second, if trigger condition is met, and at least 1 reading per hour (3600s), even if the trigger condition is not met.
When the settings are saved, the configuration is sent to the XBee, so it calculates on the XBee side the triggers.

I plan to share more details of the hardware part as well, but as I said, my time is limited for a while.
For now, here is a picture of my testing table.

And some sample HE logs of an XBee starting:

dev:635 info Status: Restroom Air Quality: 55
dev:636 info Status: Restroom Lux: 66.52
dev:636 info Status: Restroom Lux: 20.05
dev:636 info Status: Restroom Lux: 9.90
dev:635 info Status: Restroom Air Quality: 51
dev:635 info Status: Restroom Air Quality: 42
dev:642 info Device info: Endpoint 9 configured, can now start reporting
dev:636 info Status: Restroom Lux: 65.75
dev:636 info Device info: Endpoint 8 configured, can now start reporting
dev:635 info Status: Restroom Air Quality: 56
dev:635 info Device info: Endpoint 7 configured, can now start reporting
dev:633 info Status: Restroom Humidity: 73.42
dev:633 info Device info: Endpoint 5 configured, can now start reporting
dev:632 info Status: Restroom Temperature: 25.74
dev:632 info Device info: Endpoint 4 configured, can now start reporting
dev:620 info Status: XB3 Restroom: 2.96
dev:620 info Device info: Endpoint 1 configured, can now start reporting
dev:642 info Status: Restroom Proximity: not present
dev:642 info << EP 09 sending 2: {"TO":1,"DI":300}
dev:642 info Configure...
dev:642 info Device request: Send me my config
dev:642 info Device on endpoint 9 started
dev:636 info << EP 08 sending 2: {"OF":0.0,"MI":1,"MA":3600,"AM":10.0,"FI":false}
dev:636 info Configure...
dev:636 info Device on endpoint 8 started
dev:636 info Device request: Send me my config
dev:635 info << EP 07 sending 2: {"OF":0.0,"MI":60,"MA":3600,"AM":5.0,"FI":false}
dev:635 info Configure...
dev:635 info Device request: Send me my config
dev:635 info Device on endpoint 7 started
dev:633 info << EP 05 sending 2: {"OF":0.0,"MI":60,"MA":3600,"AM":1.0,"FI":true}
dev:633 info Configure...
dev:633 info Device request: Send me my config
dev:633 info Device on endpoint 5 started
dev:632 info << EP 04 sending 2: {"OF":0.0,"MI":1,"MA":3600,"AM":0.25,"FI":true,"SC":"C"}
dev:632 info Configure...
dev:632 info Device request: Send me my config
dev:632 info Device on endpoint 4 started
dev:620 info << EP 01 sending 2: {"OF":0.0,"MI":1200,"MA":3600,"AM":0.1,"FI":true,"NA":"XB3 Restroom"}
dev:620 info Configure...
dev:620 info Device request: Send me my config
dev:620 info Device replied: Bluetooth on
dev:620 info Device on endpoint 1 started

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.