Domoticz just for flower power devices?

On various Hardware and OS systems: pi / windows / routers / nas, etc

Moderator: leecollings

Post Reply
gillesMa
Posts: 5
Joined: Sunday 26 April 2020 14:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Domoticz just for flower power devices?

Post by gillesMa »

Hello,

I have several flower power devices and pots, but Parrot, the manufacturer, has just decided to shut down its cloud servers. The devices have become useless as is.
My idea is to use Domoticz just to connect to these devices. Hence my requirements are rather minimal: if I understand things well, I only need to have a working bluetooth sensor on the host with Domoticz, and install the flower power plugin. What would be the easiest and cheapest way to achieve that?

I have thought about buying a Raspberry pi zero W, that seems to fit the bill. Would it be fine for running Domoticz in my special case?

Alternatively, my computer is a NUC with a bluetooth device. Would it be possible to use domoticz in a docker container, and detect bluetooth devices? I've tried to go this way so far. The container works well, but I don't know how to identify the bluetooth device inside the container (and I don't know if it's possible).

Thank you for your help.
HM31
Posts: 56
Joined: Friday 04 August 2017 16:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz just for flower power devices?

Post by HM31 »

Hello,

i'm trying to use Python plugin parrot_flower_plugin with Domoticz Version: 2021.1 on Raspberry Pi 4B but I got this error message in domoticz log file.

Code: Select all

2021-06-02 10:31:48.902 Flower hardware started.
2021-06-02 10:31:48.902 Status: Flower: (Flower) Started.
2021-06-02 10:31:48.902 Status: Flower: (Flower) Entering work loop.
2021-06-02 10:31:49.127 Error: Flower: (parrot_flower_plugin) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/parrot_flower_plugin/:/usr/lib/python37.zip:/usr/lib/python3.7:/usr/lib/python3.7/lib-dynload:/usr/local/lib/python3.7/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.7/dist-packages'.
2021-06-02 10:31:49.128 Error: Flower: (Flower) Module Import failed, exception: 'NameError'
2021-06-02 10:31:49.128 Error: Flower: (Flower) Error Line details not available.
2021-06-02 10:32:00.404 Status: LUA: Updating variables if necessary 
but plugin.py is here, in the Path and Domoticz works for other Python plugins I already used

Code: Select all

pi@domoticz:~/domoticz/plugins $ ls -al parrot_flower_plugin/
total 44
drwxr-xr-x  5 pi pi  4096 jun  2 10:29 .
drwxr-xr-x 12 pi pi  4096 jun  1 15:52 ..
-rwxr-xr-x  1 pi pi  3366 jun  1 15:48 demo.py
-rwxr-xr-x  1 pi pi   402 jun  1 15:48 fakeDomoticz.py
drwxr-xr-x  8 pi pi  4096 jun  1 15:48 .git
drwxr-xr-x  3 pi pi  4096 jun  1 15:55 parrot_flower
-rwxr-xr-x  1 pi pi 11249 jun  2 10:29 plugin.py
drwxr-x---  2 pi pi  4096 jun  1 15:59 __pycache__
-rw-r--r--  1 pi pi   720 jun  1 15:48 README.md
I installed the prerequisite as mentioned in Git : https://github.com/tazounet/parrot_flower_plugin
What could be the issue ?
User avatar
waltervl
Posts: 5158
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Domoticz just for flower power devices?

Post by waltervl »

Give the plugin.py file execute permissions. Right click on the file to change its permissions, or use the terminal to navigate to the directory, and then type: sudo chmod +x plugin.py

You could try to use sudo to install the libraries:
sudo pip3 install bluepy
sudo pip3 install btlewrap
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
HM31
Posts: 56
Joined: Friday 04 August 2017 16:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz just for flower power devices?

Post by HM31 »

Hi,

Many thanks, seems better, may be i forgot one of the prerequisites :

Code: Select all

pi@domoticz:~/domoticz/plugins/parrot_flower_plugin $ sudo pip3 install bluepy
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: bluepy in /usr/local/lib/python3.7/dist-packages (1.3.0)
WARNING: Running pip as root will break packages and permissions. You should install packages reliably by using venv: https://pip.pypa.io/warnings/venv
pi@domoticz:~/domoticz/plugins/parrot_flower_plugin $ sudo pip3 install btlewrap
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting btlewrap
  Downloading https://www.piwheels.org/simple/btlewrap/btlewrap-0.1.0-py3-none-any.whl (21 kB)
Installing collected packages: btlewrap
Successfully installed btlewrap-0.1.0
WARNING: Running pip as root will break packages and permissions. You should install packages reliably by using venv: https://pip.pypa.io/warnings/venv
But even if hcitool seems to detect some devices,

Code: Select all

sudo hcitool lescan
LE Scan ...
37:7E:82:E4:E1:13 (unknown)
59:E7:98:0B:8B:28 (unknown)
59:E7:98:0B:8B:28 (unknown)
4D:DB:CB:40:57:AA (unknown)
47:BD:40:04:32:3A (unknown)
47:BD:40:04:32:3A (unknown)
58:58:98:58:9F:5B (unknown)
58:58:98:58:9F:5B Salle à manger
C4:7C:8D:6C:83:C4 (unknown)
C4:7C:8D:6C:83:C4 Flower care
C4:7C:8D:6C:76:2C (unknown)
C4:7C:8D:6C:83:E2 (unknown)
15:ED:BE:18:18:BA (unknown)
C4:7C:8D:6C:76:2C Flower care
56:6B:0B:DE:C1:79 (unknown)
56:6B:0B:DE:C1:79 (unknown)
the plugin autoscan mode returns nothing

Code: Select all

 2021-06-02 11:55:51.466 Status: Flower Sensors: (Flower Sensors) Entering work loop.
2021-06-02 11:55:51.466 Status: Flower Sensors: (Flower Sensors) Started.
2021-06-02 11:55:51.678 Status: Flower Sensors: (Flower Sensors) Initialized version 1.0.0, author 'tazounet'
2021-06-02 11:55:56.811 Flower Sensors: (Flower Sensors) Number of devices found via bluetooth scan = 0
2021-06-02 11:55:56.878 Flower Sensors: (Flower Sensors) Using polling interval of 120 minutes 
I give the plugin the exact MAC address and stop auto scan, but it seems that it can't read information from the Flower device anyway

Code: Select all

 2021-06-02 12:12:52.178 Status: Flower Sensors: (Flower Sensors) Started.
2021-06-02 12:12:52.390 Status: Flower Sensors: (Flower Sensors) Initialized version 1.0.0, author 'tazounet'
2021-06-02 12:13:00.367 Status: LUA: Updating variables if necessary
2021-06-02 12:13:00.368 Status: EventSystem: Script event triggered: /home/pi/domoticz/scripts/lua/Script_time_variable_utiles.lua
2021-06-02 12:13:02.083 Flower Sensors: (Flower Sensors) Getting data from sensor: C4:7C:8D:6C:76:2C
2021-06-02 12:13:16.488 Error: Flower Sensors: (Flower Sensors) Can't get data from sensor C4:7C:8D:6C:76:2C 
User avatar
waltervl
Posts: 5158
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Domoticz just for flower power devices?

Post by waltervl »

on your RPi in a terminal window go to the plugin directory and run
sudo python demo.py

Then you should get some more information if the library is working.

Else make an issue on the plugin GitHub. Perhaps the plugin owner knows the solution.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
HM31
Posts: 56
Joined: Friday 04 August 2017 16:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz just for flower power devices?

Post by HM31 »

I replaced it with this one that works fine : https://www.domoticz.com/wiki/Plugins/Mi_flower_mate
User avatar
waltervl
Posts: 5158
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Domoticz just for flower power devices?

Post by waltervl »

HM31 wrote: Wednesday 02 June 2021 20:56 I replaced it with this one that works fine : https://www.domoticz.com/wiki/Plugins/Mi_flower_mate
Yes, that is also a possibility :-)
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
HM31
Posts: 56
Joined: Friday 04 August 2017 16:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz just for flower power devices?

Post by HM31 »

And made some custom icons ;-)
Mi Flower Mate.zip
Icon for "master" device that trigger updates
(5.24 KiB) Downloaded 40 times
Attachments
Mi-Flower-mate Moist.zip
Moisture icon
(6.02 KiB) Downloaded 29 times
Mi-Flower-mate Light.zip
Light icon
(6.31 KiB) Downloaded 25 times
HM31
Posts: 56
Joined: Friday 04 August 2017 16:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz just for flower power devices?

Post by HM31 »

Mi-Flower-mate NPK.zip
Conductivity icon (fertility)
(5.46 KiB) Downloaded 55 times
HM31
Posts: 56
Joined: Friday 04 August 2017 16:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz just for flower power devices?

Post by HM31 »

Added these above icons in a new version (plus correction of conductivity device unit) in https://github.com/flatsiedatsie/Mi_Flower_mate_plugin

This plugin works with all sensors that have 'flower mate' or 'flower care' in there name (when bluetooth scanned, or that have C4:7C:8D: in BT mac address prefix), thus not only Xiaomi sensors.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests