Unable to use WallBox python script from domoticz
Posted: Sunday 09 May 2021 13:28
Hi,
I'm struggling with the WallBox python library when using from a script called from Domoticz. When I use the python3 script from terminal all works fine. This is what I've tried so far:
* Create an bash to call the script
/usr/bin/python3 /home/pi/domoticz/scripts/python/WallBox.py
or
Python3 /home/pi/domoticz/scripts/python/WallBox.py
* direct call of the script:
/usr/bin/python3 /home/pi/domoticz/scripts/python/WallBox.py
or
Python3 /home/pi/domoticz/scripts/python/WallBox.py
wallbox.py
#!/usr/bin/python3
import sys
try:
from wallbox import Wallbox
except ImportError:
sys.path.append(sys.path[0] + '/..')
from wallbox import Wallbox
import time
etc
The rights of the script set at 755.
In all cases the wallbox is not found????
This is the domoticz error log:
2021-05-09 13:05:03.830 File "/home/pi/domoticz/scripts/python/WallBox.py", line 8, in <module>
2021-05-09 13:05:03.830 from wallbox import Wallbox
2021-05-09 13:05:03.830 ModuleNotFoundError: No module named 'wallbox'
2021-05-09 13:05:03.831 Error: dzVents: Wallbox: Traceback (most recent call last):
2021-05-09 13:05:03.831 File "/home/pi/domoticz/scripts/python/WallBox.py", line 4, in <module>
2021-05-09 13:05:03.831 from wallbox import Wallbox
2021-05-09 13:05:03.831 ModuleNotFoundError: No module named 'wallbox'
2021-05-09 13:05:03.831
2021-05-09 13:05:03.831 During handling of the above exception, another exception occurred:
2021-05-09 13:05:03.831
2021-05-09 13:05:03.831 Traceback (most recent call last):
2021-05-09 13:05:03.831 File "/home/pi/domoticz/scripts/python/WallBox.py", line 8, in <module>
2021-05-09 13:05:03.831 from wallbox import Wallbox
2021-05-09 13:05:03.831 ModuleNotFoundError: No module named 'wallbox'
2021-05-09 13:05:03.831 ::ERROR::
2021-05-09 13:05:03.831
any suggestions???
Mark
I'm struggling with the WallBox python library when using from a script called from Domoticz. When I use the python3 script from terminal all works fine. This is what I've tried so far:
* Create an bash to call the script
/usr/bin/python3 /home/pi/domoticz/scripts/python/WallBox.py
or
Python3 /home/pi/domoticz/scripts/python/WallBox.py
* direct call of the script:
/usr/bin/python3 /home/pi/domoticz/scripts/python/WallBox.py
or
Python3 /home/pi/domoticz/scripts/python/WallBox.py
wallbox.py
#!/usr/bin/python3
import sys
try:
from wallbox import Wallbox
except ImportError:
sys.path.append(sys.path[0] + '/..')
from wallbox import Wallbox
import time
etc
The rights of the script set at 755.
In all cases the wallbox is not found????
This is the domoticz error log:
2021-05-09 13:05:03.830 File "/home/pi/domoticz/scripts/python/WallBox.py", line 8, in <module>
2021-05-09 13:05:03.830 from wallbox import Wallbox
2021-05-09 13:05:03.830 ModuleNotFoundError: No module named 'wallbox'
2021-05-09 13:05:03.831 Error: dzVents: Wallbox: Traceback (most recent call last):
2021-05-09 13:05:03.831 File "/home/pi/domoticz/scripts/python/WallBox.py", line 4, in <module>
2021-05-09 13:05:03.831 from wallbox import Wallbox
2021-05-09 13:05:03.831 ModuleNotFoundError: No module named 'wallbox'
2021-05-09 13:05:03.831
2021-05-09 13:05:03.831 During handling of the above exception, another exception occurred:
2021-05-09 13:05:03.831
2021-05-09 13:05:03.831 Traceback (most recent call last):
2021-05-09 13:05:03.831 File "/home/pi/domoticz/scripts/python/WallBox.py", line 8, in <module>
2021-05-09 13:05:03.831 from wallbox import Wallbox
2021-05-09 13:05:03.831 ModuleNotFoundError: No module named 'wallbox'
2021-05-09 13:05:03.831 ::ERROR::
2021-05-09 13:05:03.831
any suggestions???
Mark