Hi there
I trying to switch my Avea bulb by a pythin script, but if I run the script from a rule I always get this error:
Logging from rule:
01-Feb-2019 23:24:24.727 [INFO ] [org.eclipse.smarthome.model.script.avea.rules ] - Command: /usr/bin/python3 /etc/openhab2/scripts/control_avea.py -l 4095 -r 4095 -g 2744 -b 1843
Failure:
01-Feb-2019 23:24:25.361 [INFO ] [g.eclipse.smarthome.model.script.Your command exec] - Result:Traceback (most recent call last):
File “/etc/openhab2/scripts/control_avea.py”, line 45, in
theColor = myBulb.get_color() # Query the current color
File “/usr/local/lib/python3.5/dist-packages/avea-1.0.6-py3.5.egg/avea/avea.py”, line 115, in get_color
File “/usr/local/lib/python3.5/dist-packages/avea-1.0.6-py3.5.egg/avea/avea.py”, line 50, in connect
File “/usr/local/lib/python3.5/dist-packages/bluepy-1.3.0-py3.5.egg/bluepy/btle.py”, line 445, in connect
self._connect(addr, addrType, iface)
File “/usr/local/lib/python3.5/dist-packages/bluepy-1.3.0-py3.5.egg/bluepy/btle.py”, line 426, in _connect
self._startHelper(iface)
File “/usr/local/lib/python3.5/dist-packages/bluepy-1.3.0-py3.5.egg/bluepy/btle.py”, line 284, in _startHelper
preexec_fn = preexec_function)
File “/usr/lib/python3.5/subprocess.py”, line 676, in init
restore_signals, start_new_session)
File “/usr/lib/python3.5/subprocess.py”, line 1282, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.5/dist-packages/bluepy-1.3.0-py3.5.egg/bluepy/bluepy-helper’
01-Feb-2019 23:24:33.451 [INFO ] [org.openhab.io.openhabcloud.internal.CloudClient ] - Connected to the openHAB Cloud service (UUID = db110844-cb8d-41aa-871a-5b4d1bfabfb9, base URL = http://localhost:8080)
Running via ssh, everything is fine:
[23:21:32] openhabian@openHABianPi3b:~$ /usr/bin/python3 /etc/openhab2/scripts/control_avea.py -l 4095 -r 4095 -g 2744 -b 1843
2744
bedroom
(2048, 4095, 2744, 1843)
[23:24:44] openhabian@openHABianPi3b:~$