I'm building a domoticz python plugin for a MillHeat WiFi heater: https://github.com/appelflap/domoticz-millheat
And it needs this code as a connector to the heater: https://github.com/Danielhiversen/pymill
I've installed the needed code through pip3 (package name `millheater`), but domoticz keeps saying it can't find it. I've also made a fake Domoticz and the status fetching functions of the plugin are working properly outside of Domoticz.
Code: Select all
2018-11-26 09:58:57.095 Error: (MillHeat) failed to load 'plugin.py', Python Path used was '/home/appelflap/domoticz/plugins/millheat/:/usr/lib/python36.zip:/usr/lib/python3.6:/usr/lib/python3.6:/usr/lib/python3.6/lib-dynload'.
2018-11-26 09:58:57.095 Error: (MillHeat) Module Import failed, exception: 'ModuleNotFoundError'
2018-11-26 09:58:57.095 Error: (MillHeat) Module Import failed: ' Name: mill'
2018-11-26 09:58:57.095 Error: (MillHeat) Error Line details not available.
What would be the cleanest way to add the local store the python search path in Domoticz so its all userspace?
This is my latest attempt.. It works (ubuntu) but I don't think its very portable

Code: Select all
import getpass
# Add pip3 locations
sys.path.append('/home/'+getpass.getuser()+'/.local/lib/python3.6/dist-packages')
sys.path.append('/home/'+getpass.getuser()+'/.local/lib/python3.6/site-packages')
sys.path.append('/usr/lib/python3/dist-packages')
import mill