final fixes for homematic addon (#2360)

* added missing gnu.io.rxtx.SerialPorts java option to get hmipserver running with raw-uart device.

* use openjdk-8-jre-headless because hmipserver is compatibly to max. java-8 only.

* disabled hmip rf-firmware update to prevent accidently performed firmware downgrade (not required anymore for obsolete addon anyway)

* version bump.

* fixed shellcheck errors.

* use openjdk-11-jre-headless again since bullseye does not have java-8
package anymore.
This commit is contained in:
Jens Maus
2022-01-26 09:30:28 +01:00
committed by GitHub
parent 1915626f36
commit 37aeb25706
4 changed files with 35 additions and 26 deletions

View File

@@ -2,6 +2,13 @@
#### WARNING: This add-on is considered to be obsolete/retired in favor of the much more advanced third-party [RaspberryMatic CCU](https://github.com/jens-maus/RaspberryMatic/tree/master/home-assistant-addon) add-on for running a HomeMatic/homematicIP smart home central within HomeAssistant. If you want to migrate to the new add-on, please make sure to update to the latest version of this old "HomeMatic CCU" add-on first and then use the WebUI-based backup routines to export a `*.sbk` config backup file which you can then restore in the new "RaspberryMatic CCU" add-on afterwards (cf. [RaspberryMatic Documentation](https://github.com/jens-maus/RaspberryMatic/wiki/Installation-HomeAssistant))
## 99.0.2
- disabled hmip rf-firmware update to prevent accidently performed
firmware downgrade (not required anymore for obsolete addon anyway)
- added missing gnu.io.rxtx.SerialPorts java option to get hmipserver
running with raw-uart device.
## 99.0.1
- minor bugfix to get webui backup routines running.

View File

@@ -1,4 +1,4 @@
version: 99.0.1
version: 99.0.2
slug: homematic
name: HomeMatic CCU
description: HomeMatic central based on OCCU

View File

@@ -3,10 +3,10 @@
# Update HomeMatic firmware
# ==============================================================================
# shellcheck disable=SC2012
declare hmip_index
declare hmip_device
declare version_to
declare version_from
#declare hmip_index
#declare hmip_device
#declare version_to
#declare version_from
# HMIP support
if bashio::config.false 'hmip_enable'; then
@@ -26,22 +26,22 @@ if [ -f /data/hmip_address.conf ]; then
fi
# Update Firmware
for hmip_index in $(bashio::config 'hmip|keys'); do
hmip_device=$(bashio::config "hmip[${hmip_index}].device")
# Skeep device path with id
if echo "${hmip_device}" | grep "by-id"; then
bashio::log.warning "Skip firmware for ${hmip_device}"
continue
fi
version_from="$(java -Xmx64m -jar /opt/HmIP/hmip-copro-update.jar -p "${hmip_device}" -v | grep "Application version =" | cut -d' ' -f5)"
version_to="$(ls /firmware/HmIP-RFUSB/hmip_coprocessor_update-*.eq3 | sed 's/.*hmip_coprocessor_update-\(.*\)\.eq3/\1/' | tail -n1)"
if [ "${version_from}" != "${version_to}" ]; then
if java -Xmx64m -jar /opt/HmIP/hmip-copro-update.jar -p "${hmip_device}" -f "/firmware/HmIP-RFUSB/hmip_coprocessor_update-${version_to}.eq3"; then
bashio::log.info "HmIP update to ${version_to} was successful"
else
bashio::log.error "HmIP update ${version_to} fails!"
fi
fi
done
#for hmip_index in $(bashio::config 'hmip|keys'); do
# hmip_device=$(bashio::config "hmip[${hmip_index}].device")
#
# # Skeep device path with id
# if echo "${hmip_device}" | grep "by-id"; then
# bashio::log.warning "Skip firmware for ${hmip_device}"
# continue
# fi
#
# version_from="$(java -Xmx64m -jar /opt/HmIP/hmip-copro-update.jar -p "${hmip_device}" -v | grep "Application version =" | cut -d' ' -f5)"
# version_to="$(ls /firmware/HmIP-RFUSB/hmip_coprocessor_update-*.eq3 | sed 's/.*hmip_coprocessor_update-\(.*\)\.eq3/\1/' | tail -n1)"
# if [ "${version_from}" != "${version_to}" ]; then
# if java -Xmx64m -jar /opt/HmIP/hmip-copro-update.jar -p "${hmip_device}" -f "/firmware/HmIP-RFUSB/hmip_coprocessor_update-${version_to}.eq3"; then
# bashio::log.info "HmIP update to ${version_to} was successful"
# else
# bashio::log.error "HmIP update ${version_to} fails!"
# fi
# fi
#done

View File

@@ -3,10 +3,12 @@
# Start HomeMatic HMServer service
# ==============================================================================
# shellcheck disable=SC2086
declare hmip_device
hmip_device=$(bashio::config "hmip[0].device")
if bashio::config.true 'hmip_enable'; then
bashio::log.info "Starting HMIPServer..."
exec java -Xmx64m -Dlog4j.configuration=file:///etc/config/log4j.xml -Dfile.encoding=ISO-8859-1 -jar /opt/HMServer/HMIPServer.jar /etc/config/crRFD.conf /etc/config/HMServer.conf
exec java -Xmx64m -Dgnu.io.rxtx.SerialPorts="${hmip_device}" -Dlog4j.configuration=file:///etc/config/log4j.xml -Dfile.encoding=ISO-8859-1 -jar /opt/HMServer/HMIPServer.jar /etc/config/crRFD.conf /etc/config/HMServer.conf
else
bashio::log.info "Starting HMServer..."
exec java -Xmx64m -Dlog4j.configuration=file:///etc/config/log4j.xml -Dfile.encoding=ISO-8859-1 -jar /opt/HMServer/HMServer.jar /etc/config/HMServer.conf
exec java -Xmx64m -Dgnu.io.rxtx.SerialPorts="${hmip_device}" -Dlog4j.configuration=file:///etc/config/log4j.xml -Dfile.encoding=ISO-8859-1 -jar /opt/HMServer/HMServer.jar /etc/config/HMServer.conf
fi