aptalca / docker-ha-bridge Goto Github PK
View Code? Open in Web Editor NEWDocker container for Home Automation Bridge
License: GNU General Public License v2.0
Docker container for Home Automation Bridge
License: GNU General Public License v2.0
I installed Docker on Windows to run HA-Bridge. When I put in the machine's server IP I get the error "does not match any known IP's on this host" ... but it IS the IP of the machine.
And the logs show HA-Bridge running but I cant get to the GUI. Tried setting port 80 and 8080 and 8099.
To build the container I used Kitematic, and the "Create" button. It downloaded the image and built the container automatically.
There are 2 IPs (this is a must as Docker on Windows requires HyperV)... one for the PC/host OS and one virtual IP for HyperV . I tried manually set SERVERIP and SERVERPORT in Docker, and tried both IPs.
I also tried to create the container (port 80 and 8080) through command line using the docker run example provided here: https://hub.docker.com/r/aptalca/home-automation-bridge/
No matter what I try I get the same error.
here's the log...
Running /etc/my_init.d/00_regen_ssh_host_keys.sh...
*** Running /etc/my_init.d/firstrun.sh...
setting the correct local time
Current default time zone: 'Etc/UTC'
Local time is now: Sun Jan 15 03:58:24 UTC 2017.
Universal Time is now: Sun Jan 15 03:58:24 UTC 2017.
Latest version on bwssystems github repo is 3.5.1
Installing version '3.5.1'
--2017-01-15 03:58:30-- https://github.com/bwssytems/ha-bridge/releases/download/v3.5.1/ha-bridge-3.5.1.jar
Resolving github.com (github.com)... 192.30.253.112, 192.30.253.113
Connecting to github.com (github.com)|192.30.253.112|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://github-cloud.s3.amazonaws.com/releases/39848099/5bf392d4-ae62-11e6-826a-3388fce10feb.jar?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAISTNZFOVBIJMK3TQ%2F20170115%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20170115T035840Z&X-Amz-Expires=300&X-Amz-Signature=73ba1bde943e180081a981f3ffff3369f8075c76f4bc22c9f5dea9c84dfd3412&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dha-bridge-3.5.1.jar&response-content-type=application%2Foctet-stream [following]
--2017-01-15 03:58:35-- https://github-cloud.s3.amazonaws.com/releases/39848099/5bf392d4-ae62-11e6-826a-3388fce10feb.jar?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAISTNZFOVBIJMK3TQ%2F20170115%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20170115T035840Z&X-Amz-Expires=300&X-Amz-Signature=73ba1bde943e180081a981f3ffff3369f8075c76f4bc22c9f5dea9c84dfd3412&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dha-bridge-3.5.1.jar&response-content-type=application%2Foctet-stream
Resolving github-cloud.s3.amazonaws.com (github-cloud.s3.amazonaws.com)... 54.231.49.202
Connecting to github-cloud.s3.amazonaws.com (github-cloud.s3.amazonaws.com)|54.231.49.202|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 7296493 (7.0M) [application/octet-stream]
Saving to: ‘ha-bridge-3.5.1.jar’
0% [ ] 0 --.-K/s 1% [ ] 94,794 393KB/s 6% [=> ] 442,954 984KB/s 19% [======> ] 1,417,802 2.07MB/s 45% [================> ] 3,353,125 3.75MB/s 78% [=============================> ] 5,728,768 5.19MB/s 100%[======================================>] 7,296,493 5.87MB/s in 1.2s
2017-01-15 03:58:37 (5.87 MB/s) - ‘ha-bridge-3.5.1.jar’ saved [7296493/7296493]
Setting correct permissions
Parameters used:
Server IP : 10.0.75.1
Server Port : 80
Starting Home Automation Bridge
2017-01-15 03:58:37,685 [main] INFO com.bwssystems.HABridge.HABridge - HA Bridge (v3.5.1) starting....
2017-01-15 03:58:37,696 [main] INFO com.bwssystems.HABridge.BridgeSettings - reading from system properties
2017-01-15 03:58:37,700 [main] WARN com.bwssystems.HABridge.BridgeSettings - The upnp config address, 10.0.75.1, does not match any known IP's on this host.
2017-01-15 03:58:37,700 [main] INFO com.bwssystems.HABridge.HABridge - HA Bridge initializing....
2017-01-15 03:58:37,712 [main] INFO com.bwssystems.HABridge.SystemControl - System control service started....
2017-01-15 03:58:37.819:INFO::Thread-0: Logging initialized @388ms
2017-01-15 03:58:37,848 [main] WARN com.bwssystems.HABridge.dao.DeviceRepository - Error reading the file: data/device.db - Does not exist or is not readable. continuing...
2017-01-15 03:58:37,848 [main] INFO com.bwssystems.HABridge.devicemanagmeent.DeviceResource - HABridge device management service started....
2017-01-15 03:58:37,860 [main] INFO com.bwssystems.HABridge.upnp.UpnpSettingsResource - Hue description service started....
2017-01-15 03:58:37,863 [main] INFO com.bwssystems.util.UDPDatagramSender - Initializing UDP response Seocket...
2017-01-15 03:58:37,866 [main] INFO com.bwssystems.util.UDPDatagramSender - UDP response Seocket initialized to: 50000
2017-01-15 03:58:37,921 [Thread-0] INFO spark.webserver.JettySparkServer - == Spark has ignited ...
2017-01-15 03:58:37,923 [Thread-0] INFO spark.webserver.JettySparkServer - >> Listening on 0.0.0.0:80
2017-01-15 03:58:37.926:INFO:oejs.Server:Thread-0: jetty-9.3.z-SNAPSHOT
2017-01-15 03:58:37,998 [Thread-0] ERROR spark.webserver.JettySparkServer - ignite failed
java.net.SocketException: Permission denied
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:433)
at sun.nio.ch.Net.bind(Net.java:425)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:326)
at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)
at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:244)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.server.Server.doStart(Server.java:384)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at spark.webserver.JettySparkServer.ignite(JettySparkServer.java:131)
at spark.SparkInstance.lambda$init$0(SparkInstance.java:341)
at java.lang.Thread.run(Thread.java:745)
*** Running /etc/rc.local...
*** Booting runit daemon...
*** Runit started as PID 58
Jan 15 03:58:38 c63f01b8cb44 syslog-ng[65]: syslog-ng starting up; version='3.5.3'
*** Shutting down runit daemon (PID 58)...
*** Killing all processes...
I did a
docker pull aptalca/home-automation-bridge
which ran fine.
Then did
docker run -d --name="Home-Automation-Bridge" -e SERVERIP="192.168.3.110" -e SERVERPORT="8055" -p 8055:8055 -v /Users/hd/habridge/config/:/config:rw -v /etc/localtime:/etc/localtime:ro aptalca/home-automation-bridge
The console shows:
Error: Invalid or corrupt jarfile ha-bridge-5.4.0.jar
Can anyone help?
Hi, would it be possible to build in a backup configuration option to save externally? To a file?
Yes I can make backups "inside" my docker container. But which to "download" via the GUI my config in a file.
First reported on bwssytems' Github page.
Will this dockerfile run on a RaspberryPi?
If ha-bridge cannot access github during startup in /etc/my_init.d/firstrun.sh the $VERSION variable ends up with no value and the script attempts to download and run "ha-bridge-.jar"
eg.
wget tries: https://github.com/bwssytems/ha-bridge/releases/download/v/ha-bridge-.jar
Workaround is to set the environment variable to override the version (I'm using docker) and ha_bridge will start normally. Of course future updates are disabled until the container is rebuilt and environment variable removed.
Would it be possible to have some error checking in the script so that if it fails to connect to github for the version check, it uses the existing highest version?
do i need to install the docker prior to install or after installing the ha-bridge?
I had two problems that took me some time to work through as being new to Docker:
I had to replace -v /etc/localtime:/etc/localtime:ro with -e TZ="America/New_York" because I kept getting mv: cannot move '/etc/localtime.dpkg-new' to '/etc/localtime': Device or resource busy
I couldn't get it to start on port 80 - even though I started the container as root, the task inside the container doesn't get root privileges? So I started it on a high port and forwarded it back on Ubuntu main:
iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-port
Could you add this to the README?
Hi. Thanks for making this!
Trying to see if I can run ha-bridge in the background of a Kodi install on RPi2 with LibreELEC. Got the docker add-on installed and ran the following:
docker run -d --name="Home-Automation-Bridge" --net="host" -e SERVERIP="192.168.137.8" -e SERVERPORT="80" -v /storage/downloads/habridge:/config:rw -e TZ="Pacific/Auckland" aptalca/home-automation-bridge
It all seems to work as the container is created but when I run docker ps -a
I get the following:
LibreELEC:~ # docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
96cc921c5951 aptalca/home-automation-bridge "/sbin/my_init" 9 seconds ago Exited (1) 3 seconds ago Home-Automation-Bridge
How to I debug the exit issue?
I had been using this docker on my Synology and it worked great. I am in process of migrating to a full PC to take over. It's running Ubuntu 16.04. One minor issue... the Docker container I've created starts before the network is running. It doesn't seem that there is a command to delay the starting of containers. Anything that could be added to this docker-ha-bridge image to loop for network availability? Perhaps have it check 30 times, with a 1 second delay. Once good, proceed... else just start the jar without attempting auto-update.
My testing: Installed. Worked great. Rebooted. Docker indicated it was running. No access. Restarted container using UIFD. HA Bridge worked. Looked at logs. Complaining about inability to resolve github.com. Removed container. Re-added with "version" environment variable defined. Now works flawlessly over reboot. However, it won't auto-update anymore.
trying to add habridge to openhab.
i get a failed to create new user error
the Hue hub id in openhab is way lower then current versions
it should be 00178820e229
i have put this number in the emulate hub filed but it does not seem to pass it along to openhab(or any other app)
is the error i get related to the lower hub version and where does this lower version come from?
The bridge is running inside a docker container on a MacOS Sierra box, v 1.12.1 of docker. I forwarded in 8080/tcp as well as 1900 and 50000 UDP. I see a lot of log activity but Alexa never discovers it. Any one else doing the same thing? Apparently due to the way docker works on MacOS, you can't use --net="host", and must manually forward the ports. Is there another set of ports I need to forward?
firstrun.sh
ADDPARAM="-Dsecurity.key=$SECURITYKEY -Dupnp.config.address=$SERVERIP -Dserver.port=$SERVERPORT"
Re-downloaded version for arm on Pi on the same Pi I was using before for testing but now in a deployed environment with a new IP address (10.1.1.101). ha-bridge does not start now with the error log that it cannot find ha-bridge-.jar
which of course, is not the name of the .jar file. Is there a typo in the latest code somewhere?
trying to install this on a synology runnig dsm 6.2.2
the container available on docker does not seem to be compiled properly.
DSM version is the latest
i installed latest java 211 but it dooes not solve the problem
Error: A JNI error has occurred, please check your installation and try again Exception in thread "main" java.lang.UnsupportedClassVersionError: com/bwssystems/HABridge/HABridge has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:763) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) at java.net.URLClassLoader.access$100(URLClassLoader.java:73) at java.net.URLClassLoader$1.run(URLClassLoader.java:368) at java.net.URLClassLoader$1.run(URLClassLoader.java:362) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:361) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:495)
I have installed this on my synology via Docker and following the instructions here: https://hub.docker.com/r/aptalca/home-automation-bridge/ but I cant seem to get the IP or page to login to portal. What am i doing wrong? The logs show no IP or Port despite my configure stating one.
ha-bridge 4.5.0 runs on my synology via docker.
Everything works fine, but I can't get any exec-command to work.
Most of the times I get a "file not found" error.
Tried everything I can imagine.
I get a green response in the ha-bridge interface but nothing is executed by using for example:
/usr/bin/python3 /volume1/Data/haactions/py/aquosOFF.py
The same for shell scripts.
I guess, it is a question of user-rights.
Am I right, that everything is executed by root (how can I find out?), but on the synology the user root has limited rights?
How could I get around this?
Hello, currently I am running HA Bridge through a Docker Container on LibreElec on a Raspberry PI. I am using the Raspberry to control an Ambilight clone for my television. A year ago everything went fine, and I had all the things working, but a few days ago the SD card crashed, and everything is gone now :((
At the moment, I am trying to get HA Bridge working again, but I can't get any scripts running. For testing purposes I have made a script called "test.sh" and placed it under "/storage/downloads/habridge".
Content of "test.sh":
#!/bin/bash
mkdir /storage/downloads/habridge/test
If I call that script using Putty from my PC everything works fine (see Screenshot below):
I am now trying to execute this script using HA Bridge, but i don't get it working again (see configuration below):
If I click on "TEST ON" i get the green message "Request Executed" but nothing happens :-(
Can you maybe help me get it working again, please?
Thanks in advance.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.