Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Bluetooth LE to mqtt gateway for Xiaomi Mi plant sensors. For more details see the documentation overview.
For many setups the Xiaomi Mi plant sensors are too far away from your home server to connect directly via Bluetooth LE. In such a scenario the plantgatway will poll the data from a list of Xiaomi Mi plant sensors via Bluetooth LE using miflora. The data is then published via mqtt to your home automation server.
The plantgateway is intended to be run on a small Linux machine (e.g. Raspberry Pi or a C.H.I.P) that has both Bluetooth LE and WiFi.
sudo apt-get install python3-pip build-essential libglib2.0-dev libyaml-dev
sudo pip install --upgrade plantgateway
or if you have multiple python and pip installations:
sudo pip3 install --upgrade plantgateway
If you have problems with the PyYaml installation, update your pip version
with sudo pip3 install --upgrade pip
and try again.
Copy the plantgw.yaml (in this repository) to your home directory and rename it to ".plantgw.yaml". Then change this file to match your requirements.
After the installation with pip you can simply run the tool from the command line:
plantgateway
There are no command line parameters and there is no interaction required. You probably want to add the script to your cron tab to be executed in regular intervals (e.q. every hour).
If you enable the MQTT discovery
feature by setting the discovery_prefix
parameter in
the config file, all configured sensors are automatically available in HomeAssistant.
To monitor the state of your plants, you can use the
"plant" component.
To check your plants in the home automation tool fhem, you can use the gardener module. The installation is explained on the github page of the module.
If you haven't done so, you need to configure your MQTT server in fhem with a MQTT module. For each sensor you have, set up a MQTT_Device and make it auto subscribe to the topic you configured in the plantgateway:
define <plant_name> MQTT_Device
attr <plant_name> autoSubscribeReadings <prefix_in_config>/<plant alias>/+
After that configure the gardener to match your requirements
A remark on security: Before running your MQTT server on the internet make sure that you enable SSL/TLS encryption and client authentication.
In case you have any problem with plantgateway, please check:
sudo hcitool lescan
, this should list all Low Energy devices.sudo apt update; sudo apt dist-upgrade
. This fixes these issues usually.If all this does not help, please file a bug ticket in github.
Unless stated otherwise all software in this repository is licensed under the Apache License 2.0 http://www.apache.org/licenses/LICENSE-2.0
FAQs
Bluetooth to mqtt gateway for Xiaomi Mi plant sensors
We found that plantgateway demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.