Python script to push data from Miflora flower care to SQL database using the library of open-homeautomation (https://github.com/open-homeautomation/miflora)
If you havent installed miflora library, bluez and mysql-connector for python yet, follow instructions 1-4, else continue with 5.
sudo apt-get update sudo apt-get upgrade sudo apt-get bluez
sudo pip3 install miflora
sudo pip3 install bluepy
sudo pip3 install mysql-connector-python
sudo hcitool lescan
git clone https://github.com/Hotwheels93/miflora-sql.git cd miflora-sql
Open miflora-sql-update.py
- database credentials (host, user, pw, database [line 24-27])
- MAC adress [line 11]
- device/plant name[12]
Save and exit file
Login to your server via phpMyAdminand and import the plants.sql or create table manually
sudo python3 miflora-sql-update.py
sudo crontab -e
e.g. for updating every 30 minutes
*/30 * * * * sudo python3 /home/pi/miflora-sql/miflora-sql-update.py . (change to your location)