Comments (11)
The container only has access to locations that are mounted in the docker run command. By default, the config folder is mounted under /config
You need to use the internal maooed location of the script (and first make sure that location is mounted)
from docker-ha-bridge.
Thanks for Your response!
I added a mounted path to the existing folder /docker using the docker gui and setting the folder to /docker and mount-path to /docker (correct?).
Added a simple python script into the subfolder "py" and added the command /usr/bin/python3 /docker/py/test.py
into ha-bridge.
It works manually with my user in a console but not with ha-bridge.
What else do I need to do?
from docker-ha-bridge.
I added a mounted path to the existing folder /docker using the docker gui and setting the folder to /docker and mount-path to /docker (correct?)
I don't quite understand this statement but I'm assuming that on the host, the script is at /docker/py/test.py, in the docker run command you used -v /docker:/docker:rw
and in the bridge you are using the location /docker/py/test.py
If so, that seems to be correct. As to why the script isn't firing, you should ask on bwssystems' github. I don't have any experience with firing python scripts from this bridge.
from docker-ha-bridge.
Well, I do not know how to manipulate the RUN command (I do not know where to put the -v /docker:/docker:rw
I am working on the synology's gui to do that:
And in ha-bridge:
I think, it should work having access to my added directory.
Firing up a shel script with it's name does not give me an 'file not found' - error anymore.
But does not work. (my test-script should write a file to my directory.)
Can I expect having access to all system programs (i.e. bash and python modules) root would have, without mounting any additional path?
EDIT:
I got a python script working now, which writes a text-output to my directory.
My script that should turn on/off my sharp-TV is still not working (could be something with the import socket
command...)
But thanks man!
You pushed me into the right direction by telling me to add a mounted path.
from docker-ha-bridge.
Good to hear that python works. Just so you know, the script will only have access to the libraries and modules inside the container, which is ubuntu.
If you want to test/troubleshoot your python script, it is best to do inside the container so you can see the console output. You can exec into the container with docker exec -it <containername> bash
from synology console.
from docker-ha-bridge.
Thanks for this hint!
When I connect as admin via SSH the command
docker exec -it aptalca-home-automation-bridge1 /bin/usr/python3 /docker/aquosON.py
gives me the response
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
Wrong user?
from docker-ha-bridge.
maybe try with sudo
?
from docker-ha-bridge.
Yes, but then it doesn't find python3.
It is not the same environment, as executed by ha-bridge.
from docker-ha-bridge.
/usr/bin/python3
or just python3
from docker-ha-bridge.
OMG, sure ist has to be /usr/bin/
Now I have a script error output.
Thanks again!
from docker-ha-bridge.
YESSS!
For all readers in the background:
Firing up python scripts worked now, but my script, that should turn ON/OFF my Sharp Aquos TV failed with the error message:
TypeError: 'str' does not support the buffer interface
This is caused by using a socket send command like s.send(user + "\r" + password + "\r")
.
With python 3 this should be
s.send((user + "\r" + password + "\r").encode())
That way it works.
Buuuut:
My Sharp TV looses IP-connection after being more than 10 minutes in standby... lol
from docker-ha-bridge.
Related Issues (18)
- Docker on LibreELEC (Kodi) HOT 8
- docker installed before or after ha-bridge initial install HOT 2
- Synology Install fail HOT 9
- ha-bridge-.jar HOT 9
- RaspberryPi?
- Please add more additional parameters (e.g. Dsecurity.key)
- Download backup config file via GUI
- Can't run scripts
- ha-bridge fails to start if unable to access Github
- error wrong java version HOT 8
- habridge id different in openhab then specified in habridge HOT 2
- Corrupt .jar file
- Having trouble with Docker version of Bridge after v.3.0.0 upgrade. HOT 1
- Auto-Update with restart=always HOT 2
- Can't get Alexa to find the bridge HOT 1
- Starting on Ubuntu 15.x HOT 1
- Does not match any known IP's on this host. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-ha-bridge.