diff --git a/homematic/CHANGELOG.md b/homematic/CHANGELOG.md index 9b7f125..964c16c 100644 --- a/homematic/CHANGELOG.md +++ b/homematic/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 5 +- Save hmip_address.conf persistent + ## 4 - New ubuntu base images - Support firmware update of HM-MOD-RPI-PCB, HmIP-RFUSB diff --git a/homematic/Dockerfile b/homematic/Dockerfile index a315571..551de1d 100644 --- a/homematic/Dockerfile +++ b/homematic/Dockerfile @@ -54,4 +54,5 @@ COPY rfd.conf hs485d.conf crRFD.conf /etc/config/ COPY run.sh / RUN chmod a+x /run.sh +WORKDIR /data CMD [ "/run.sh" ] diff --git a/homematic/config.json b/homematic/config.json index 1f6d4eb..710e3be 100644 --- a/homematic/config.json +++ b/homematic/config.json @@ -1,6 +1,6 @@ { "name": "HomeMatic OCCU", - "version": "4", + "version": "5", "slug": "homematic", "description": "HomeMatic central based on OCCU", "url": "https://home-assistant.io/addons/homematic/", diff --git a/homematic/crRFD.conf b/homematic/crRFD.conf index 808394f..89275ea 100644 --- a/homematic/crRFD.conf +++ b/homematic/crRFD.conf @@ -1,5 +1,5 @@ -Config.Dir=/etc/config/crRFD +Config.Dir=/data/crRFD Config.Include=hmip_user.conf # Directory Configuration diff --git a/homematic/run.sh b/homematic/run.sh index 93cfb1b..903c8c5 100644 --- a/homematic/run.sh +++ b/homematic/run.sh @@ -15,6 +15,11 @@ WAIT_PIDS=() mkdir -p /data/firmware mkdir -p /data/crRFD +# Restore data +if [ -f /data/hmip_address.conf ]; then + cp -f /data/hmip_address.conf /etc/config/ +fi + # RF support if [ "$RF_ENABLE" == "true" ]; then for (( i=0; i < "$RF_DEVICES"; i++ )); do @@ -93,8 +98,14 @@ if [ "$HMIP_ENABLE" == "true" ]; then done # Run HMIPServer + # shellcheck disable=SC2086 java -Xmx128m -Dos.arch=arm -Dlog4j.configuration=file:///etc/config/log4j.xml -Dfile.encoding=ISO-8859-1 -Dgnu.io.rxtx.SerialPorts=${DEVICE} -jar /opt/HMServer/HMIPServer.jar /etc/config/crRFD.conf & WAIT_PIDS+=($!) + + if [ ! -f /data/hmip_address.conf ]; then + sleep 30 + cp -f /etc/config/hmip_address.conf /data/ + fi fi # Register stop