Mi Flora sensors in the whole building

Hello,

I have Mi flora Sensors all over the place in my home and in my garden. I started to implement them with Mosquitto MQTT and an additional raspberry Pi with a Bluetooth dongle. Working fine.

Its Openhab 2.4 with a local install of Mosquitto.

The PI with the dongle was installed in a place where it can reach some of the sensors - but not all.

I have some Ideas how to extend the setup, but I dont know which one makes sense.

  1. Bluetooth Repeater - hard to find and to buy, they are expensive and the success is questionable.
  2. One or more additional PIs with a Bluetooth dongle.

Did I miss a good Idea?

  1. is my favorite, but if I buy more small PIs what is the best option to implement them?
    Install more and more Mosquitto Servers on the other PIs and bind them to Openhab?
    Or is there a way to forward the other MQTT instances to the central, already running one?

I guess all additional PIs need the Script running locally to read out the values?

Thanks for your help,
Simon

The question as asked indicates a misunderstanding about what MQTT is and how MQTT works. It would be good to read up on the technologies you are using so you are better able to solve problems like these.

You only need one MQTT broker on a given network. So as long as your additional RPis are on the same network and can reach your currently existing Mosquitto they should use that as their broker. You almost never want more than one broker running in a home.

Beyond that yes, the RPis will need to be running what ever it is that reads the Mi Flora signals and publishes them over MQTT.

1 Like

As @rlkoshak wrote you just need one MQQT broker as central MQTT element. I have realized a similar approach. One mosquitto server and three raspberries all over my home each raspberry covers several plant sensors. To simplyfy the setup all sensors are configured on ann rpis, but you are free to define a different set of sensors for every rpi. I use twi raspberry version 1 and one raspberry zero.

Just works and will be extended by two new sensors to 17 sensors in total.

One way to avoid multiple RPi’s is to use ESP32 and OpenMqtt gateway https://docs.openmqttgateway.com/

It is smaller, more power efficient and more economical (2-5€ each) and works with the Mi Flora sticks. (you just flash the firmware it onto the esp32 and it submits the data to your defined mqtt server).

Thanks for the replys.

@rlkoshak, you are right. The present PI does it exactly like this - Reporting to a central MQTT instance, so why configure a second MQTT. Additional PIs can also reach the central MQTT. My fault.

@Dibbler42, I bought one PI zero for 11€
I have already configured the plant sensor on the present PI for testing and included it into Openhab. I guess I can leave the whole Openhab config as it is - the distinguishing criterion for openhab is the miflora/xxx parameter so I can simply cut the config.ini line and add it to the PI zero config.ini file

@marcel_verpaalen I read about the ESP32 option and what I found it looks not totally stable.

But for the next sensors I will try it anyway.

Thanks!

@JanPatat Yes, it should be possible to copy the config.ini over. What happens if your sensor could bereached from both pi’s ist that you get more often an update.

openHABian comes packaged with a demon that talks to Mi flora sensors via BT and forwards to any MQTT broker.
That’ll work with all RPi models including Pi Zero. Just flash the image and install that from the menu.
You can inactivate the openHAB instance.

From there on, you have multiple options, forward to your central MQTT broker, install additional brokers on every satellite (openHABian also has an option to install mosquitto) and forward via MQTT, or even run openHAB on all satellites and “forward” using the remote openHAB binding.
The latter might be more useful as you could also make use of the GPIOs then.

Hi,

I placed the PI zero near the new sensors and everything works good. To good :wink: I added just for fun all Sensors in the config file and I am really confused about the bluetooth range the PI zero has. It can reach every present sensor - even the one´s outside the house. Arround 15-20 Meters away with massive walls between.

Anyway, thanks for the help!

1 Like