diff --git a/homematic/CHANGELOG.md b/homematic/CHANGELOG.md index da57546..066cfc7 100644 --- a/homematic/CHANGELOG.md +++ b/homematic/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 10.3 + +- Flush ReGaHss config on shutdown +- Add ReGaHss reset option + ## 10.2 - Update Bashio to fix the wait function diff --git a/homematic/README.md b/homematic/README.md index 30d33ca..284ca88 100644 --- a/homematic/README.md +++ b/homematic/README.md @@ -16,7 +16,7 @@ to interface with your devices. ## Features - Your Raspberry Pi is your HomeMatic control center! -- WebUI (experimental) +- WebUI ReGaHss with ingress support - Firmware updates ## Installation @@ -53,6 +53,7 @@ hmip_enable: false hmip: - type: HMIP_CCU2 device: "/dev/ttyUSB0" +regahss_reset: false ``` ### Option: `rf_enable` (required) @@ -107,6 +108,10 @@ Device type for HMIP service. Check your device manual. Device on the host. +#### Option: `regahss_reset` + +If this is set and enabled, the ReGaHss setting will be removed before it will be started. + ## Home Assistant configuration Add the following to your Home Assistant configuration to enable @@ -124,6 +129,10 @@ homematic: hmip: host: core-homematic port: 2010 + group: + host: core-homematic + port: 9292 + path: /groups ``` ## Raspberry Pi3 diff --git a/homematic/config.json b/homematic/config.json index 9b7f8cb..eb88e47 100644 --- a/homematic/config.json +++ b/homematic/config.json @@ -1,6 +1,6 @@ { "name": "HomeMatic CCU", - "version": "10.2", + "version": "10.3", "slug": "homematic", "description": "HomeMatic central based on OCCU", "url": "https://github.com/home-assistant/hassio-addons/tree/master/homematic", @@ -8,6 +8,7 @@ "map": ["share:rw"], "startup": "system", "boot": "auto", + "timeout": 15, "auto_uart": true, "gpio": true, "apparmor": false, @@ -28,27 +29,8 @@ }, "options": { "rf_enable": false, - "rf": [ - { - "type": "CCU2", - "device": "/dev/ttyAMA0" - } - ], "wired_enable": false, - "wired": [ - { - "serial": "xy", - "key": "abc", - "ip": "192.168.0.0" - } - ], - "hmip_enable": false, - "hmip": [ - { - "type": "HMIP_CCU2", - "device": "/dev/ttyUSB0" - } - ] + "hmip_enable": false }, "schema": { "rf_enable": "bool", @@ -73,7 +55,8 @@ "type": "match(HMIP_CCU2)", "device": "match(^/dev/.*$)" } - ] + ], + "regahss_reset": "bool?" }, "image": "homeassistant/{arch}-addon-homematic" } diff --git a/homematic/data/run.sh b/homematic/data/run.sh index f1cc8d0..ea3f375 100755 --- a/homematic/data/run.sh +++ b/homematic/data/run.sh @@ -140,6 +140,11 @@ fi # Register stop function stop_homematic() { + # Store Regahss + echo "load tclrega.so; rega system.Save()" | "${HM_HOME}/bin/tclsh" 2> /dev/null || true + sleep 5 + + # Forward kill process bashio::log.info "Kill Processes..." kill -15 "${WAIT_PIDS[@]}" wait "${WAIT_PIDS[@]}" @@ -151,6 +156,13 @@ trap "stop_homematic" SIGTERM SIGHUP bashio::log.info "Wait until HomeMatic is setup" bashio::net.wait_for 9292 +# Reset Regahss +if bashio::config.true "regahss_reset"; then + bashio::log.warning "Reset ReGaHss" + rm -f /data/homematic.regadom + touch /data/homematic.regadom +fi + # Start Regahss bashio::log.info "Start ReGaHss" "$HM_HOME/bin/ReGaHss" -c -f /etc/config/rega.conf & @@ -159,7 +171,7 @@ WAIT_PIDS+=($!) # Start WebInterface bashio::log.info "Initialize webinterface routing" openssl req -new -x509 -nodes -keyout /etc/config/server.pem -out /etc/config/server.pem -days 3650 -subj "/C=DE/O=HomeMatic/OU=Hass.io/CN=$(hostname)" -lighttpd-angel -D -f /opt/hm/etc/lighttpd/lighttpd.conf & +lighttpd-angel -D -f "${HM_HOME}/etc/lighttpd/lighttpd.conf" & WAIT_PIDS+=($!) # Start Ingress