Homematic IP support (#424)

* Update config.json

* Sync time of RF Daemon every 30min (#425)

* sync homematic time periodically

* Show "Run SetInterfaceClock" in log file

* signal handler added

* version incremented

* Update CHANGELOG.md

* Grammar fixes (#429)

* Update config.json

* Forward

* fix config

* small size

* fix copy

* fix path

* Debug

* Fix script

* fix settings

* fix path

* Update run.sh
This commit is contained in:
Pascal Vizeli
2018-10-28 23:28:27 +01:00
committed by GitHub
parent 0a48cb1541
commit a59deb7d6e
6 changed files with 108 additions and 15 deletions

View File

@@ -1,7 +1,12 @@
# Changelog
## 4
- New ubuntu base images
- Support firmware update of HM-MOD-RPI-PCB, HmIP-RFUSB
- Add HmIP support with HmIP-RFUSB
## 3
- Add periodically time sync
- Add periodically time sync
## 2
- Fix wrong Timezone

View File

@@ -5,9 +5,8 @@ FROM $BUILD_FROM
RUN apt-get update \
&& apt-get install -y \
curl \
jq \
libusb-1.0 \
tzdata \
openjdk-11-jre-headless \
&& rm -rf /var/lib/apt/lists/*
ARG OCCU_VERSION
@@ -19,18 +18,37 @@ RUN curl -sL -o occu.tar.gz https://github.com/eq-3/occu/archive/${OCCU_VERSION}
&& tar xzpf occu.tar.gz \
&& rm -f occu.tar.gz \
&& cd occu-${OCCU_VERSION} \
&& if [ "${BUILD_ARCH}" = "armhf" ]; then cd arm-gnueabihf; else cd X86_32_Debian_Wheezy; fi \
&& mkdir -p /opt/hm \
&& cp -R packages-eQ-3/RFD/* /opt/hm \
&& cp -R packages-eQ-3/LinuxBasis/* /opt/hm \
&& cp -R packages-eQ-3/HS485D/* /opt/hm \
&& mkdir -p /opt/hm/etc/config \
&& mkdir -p /opt/HmIP \
&& mkdir -p /opt/HMServer \
&& ln -s /opt/hm/etc/config /etc/config \
&& cp -r ../firmware /opt/hm/ \
&& if [ "${BUILD_ARCH}" = "armhf" ]; \
then \
cd arm-gnueabihf; \
else \
cd X86_32_Debian_Wheezy; \
fi \
&& cp -R packages-eQ-3/RFD/bin /opt/hm/ \
&& cp -R packages-eQ-3/RFD/lib /opt/hm/ \
&& cp -R packages-eQ-3/RFD/opt/HmIP/* /opt/HmIP/ \
&& cp -R packages-eQ-3/LinuxBasis/bin /opt/hm/ \
&& cp -R packages-eQ-3/LinuxBasis/lib /opt/hm/ \
&& cp -R packages-eQ-3/HS485D/bin /opt/hm/ \
&& cp -R packages-eQ-3/HS485D/lib /opt/hm/ \
&& cd ../ \
&& cp -r firmware /opt/hm/ \
&& cp -R HMserver/etc/config_templates/* /opt/hm/etc/config/ \
&& cp -R HMserver/opt/HmIP/* /opt/HmIP/ \
&& cp -a HMserver/opt/HMServer/HMIPServer.jar /opt/HMServer/ \
&& cp -R HMserver/opt/HMServer/groups /opt/HMServer/ \
&& cp -R HMserver/opt/HMServer/measurement /opt/HMServer/ \
&& cp -R HMserver/opt/HMServer/pages /opt/HMServer/ \
&& rm -rf /usr/src/occu-${OCCU_VERSION}
ENV HM_HOME=/opt/hm LD_LIBRARY_PATH=/opt/hm/lib:${LD_LIBRARY_PATH}
# Update config files
COPY rfd.conf hs485d.conf /etc/config/
COPY rfd.conf hs485d.conf crRFD.conf /etc/config/
# Setup start script
COPY run.sh /

View File

@@ -1,8 +1,8 @@
{
"build_from": {
"armhf": "multiarch/ubuntu-core:armhf-xenial",
"amd64": "multiarch/ubuntu-core:i386-xenial",
"i386": "multiarch/ubuntu-core:i386-xenial"
"armhf": "homeassistant/armhf-base-ubuntu:18.04",
"amd64": "homeassistant/i386-base-ubuntu:18.04",
"i386": "homeassistant/i386-base-ubuntu:18.04"
},
"args": {
"OCCU_VERSION": "3.37.8"

View File

@@ -1,6 +1,6 @@
{
"name": "HomeMatic OCCU",
"version": "3",
"version": "4",
"slug": "homematic",
"description": "HomeMatic central based on OCCU",
"url": "https://home-assistant.io/addons/homematic/",
@@ -12,7 +12,8 @@
"apparmor": false,
"ports": {
"2001/tcp": 2001,
"2000/tcp": 2000
"2000/tcp": 2000,
"2010/tcp": 2010
},
"options": {
"rf_enable": true,
@@ -30,6 +31,13 @@
"key": "abc",
"ip": "192.168.0.0"
}
],
"hmip_enable": false,
"hmip": [
{
"type": "HMIP_CCU2",
"device": "/dev/ttyUSB0"
}
]
},
"schema": {
@@ -48,6 +56,13 @@
"key": "str",
"ip": "str"
}
],
"hmip_enable": "bool",
"hmip": [
{
"type": "match(HMIP_CCU2)",
"device": "match(^/dev/.*$)"
}
]
},
"image": "homeassistant/{arch}-addon-homeassistant"

33
homematic/crRFD.conf Normal file
View File

@@ -0,0 +1,33 @@
Config.Dir=/etc/config/crRFD
Config.Include=hmip_user.conf
# Directory Configuration
Persistence.Home=/data/crRFD
FirmwareUpdate.BG.OTAU.Home=/opt/hm/firmware
FirmwareUpdate.BG.OTAU.divergent.device.type.definition.file=/opt/HmIP/crrfd.fwfix
# Legacy API Configuration
API.1.Type=XML-RPC
Legacy.Encoding=ISO-8859-1
Legacy.ResponseTimeout=20
Legacy.ReplacementURL=127.0.0.1
Legacy.Parameter.Definition.File=/opt/HmIP/legacy-parameter-definition.config
# Legacy.RemoveUnreachableClients=false
Legacy.AddressPrefix=3014F711A0
Legacy.SwitchTypeAndSubtype=true
Legacy.HandlersFilename=/var/LegacyService.handlers
Legacy.DiscardDutyCycleEvents=true
Legacy.SendUDPServiceMessages=true
# Miscellaneous Configuration
CyclicTimeout.TimerStartMaxDelay=90
CyclicTimeout.TimerCycleTime=600
Legacy.Parameter.ReplaceEnumValueWithOrdinal=true
### Configuration for Inclusion with key server (internet) or local key (offline)
KeyServer.Mode=KEYSERVER_LOCAL
KeyServer.Gateway.URL=secgtw.homematic.com
Vertx.WorkerPoolSize=5
# USB HM/IP TRX Adapter Configuration

View File

@@ -7,10 +7,13 @@ RF_ENABLE=$(jq --raw-output '.rf_enable' $CONFIG_PATH)
RF_DEVICES=$(jq --raw-output '.rf | length' $CONFIG_PATH)
WIRED_ENABLE=$(jq --raw-output '.wired_enable' $CONFIG_PATH)
WIRED_DEVICES=$(jq --raw-output '.wired | length' $CONFIG_PATH)
HMIP_ENABLE=$(jq --raw-output '.hmip_enable' $CONFIG_PATH)
HMIP_DEVICES=$(jq --raw-output '.hmip | length' $CONFIG_PATH)
WAIT_PIDS=()
# Init folder
mkdir -p /data/firmware
mkdir -p /data/crRFD
# RF support
if [ "$RF_ENABLE" == "true" ]; then
@@ -41,7 +44,7 @@ if [ "$RF_ENABLE" == "true" ]; then
fi
if [ "$RESET" == "true" ]; then
echo 1 > /sys/class/gpio/gpio18/value || echo "Can't reset module!"
sleep 0.5
sleep 0.5
fi
echo 0 > /sys/class/gpio/gpio18/value || echo "Can't set default value!"
sleep 0.5
@@ -75,6 +78,25 @@ if [ "$WIRED_ENABLE" == "true" ]; then
WAIT_PIDS+=($!)
fi
# HMIP support
if [ "$HMIP_ENABLE" == "true" ]; then
for (( i=0; i < "$HMIP_DEVICES"; i++ )); do
TYPE=$(jq --raw-output ".hmip[$i].type" $CONFIG_PATH)
DEVICE=$(jq --raw-output ".hmip[$i].device" $CONFIG_PATH)
ADAPTER=$((i+1))
# Update config
(
echo "Adapter.${ADAPTER}.Type=${TYPE}"
echo "Adapter.${ADAPTER}.Port=${DEVICE}"
) >> /etc/config/crRFD.conf
done
# Run HMIPServer
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+=($!)
fi
# Register stop
function stop_homematic() {
echo "Kill Processes..."