From a9923cd19374c37760926725de7e29a0cd41ac5a Mon Sep 17 00:00:00 2001 From: jp112sdl Date: Sat, 28 Jul 2018 00:05:08 +0200 Subject: [PATCH] added new option for HB-UNI-Sen-WEA - show rain detector heater status in ccu --- ...ea_ge_v12.xml => hb-uni-sen-wea_e_v12.xml} | 15 +- .../rftypes/hb-uni-sen-wea_ge_v13.xml | 267 ++++++++++++++++++ src/addon/install_hb-uni-sen-wea | 58 ++++ src/addon/uninstall_hb-uni-sen-wea | 16 +- 4 files changed, 346 insertions(+), 10 deletions(-) rename src/addon/firmware/rftypes/{hb-uni-sen-wea_ge_v12.xml => hb-uni-sen-wea_e_v12.xml} (95%) create mode 100644 src/addon/firmware/rftypes/hb-uni-sen-wea_ge_v13.xml diff --git a/src/addon/firmware/rftypes/hb-uni-sen-wea_ge_v12.xml b/src/addon/firmware/rftypes/hb-uni-sen-wea_e_v12.xml similarity index 95% rename from src/addon/firmware/rftypes/hb-uni-sen-wea_ge_v12.xml rename to src/addon/firmware/rftypes/hb-uni-sen-wea_e_v12.xml index 73d536de..75e51950 100644 --- a/src/addon/firmware/rftypes/hb-uni-sen-wea_ge_v12.xml +++ b/src/addon/firmware/rftypes/hb-uni-sen-wea_e_v12.xml @@ -2,7 +2,7 @@ - + @@ -125,8 +125,14 @@ + + + + + + - + @@ -154,7 +160,7 @@ - + @@ -250,7 +256,8 @@ - + + diff --git a/src/addon/firmware/rftypes/hb-uni-sen-wea_ge_v13.xml b/src/addon/firmware/rftypes/hb-uni-sen-wea_ge_v13.xml new file mode 100644 index 00000000..82c0acd5 --- /dev/null +++ b/src/addon/firmware/rftypes/hb-uni-sen-wea_ge_v13.xml @@ -0,0 +1,267 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/addon/install_hb-uni-sen-wea b/src/addon/install_hb-uni-sen-wea index b4c820e9..910cf67b 100755 --- a/src/addon/install_hb-uni-sen-wea +++ b/src/addon/install_hb-uni-sen-wea @@ -4,6 +4,10 @@ DEVICE="HB-UNI-Sen-WEA" DEVICE_DESC="universeller Wetterdatensensor" DEVICE_IMG=hb-uni-sen-wea.png DEVICE_THUMB=hb-uni-sen-wea_thumb.png +FIRMWARE_FILES=/firmware/rftypes/hb-uni-sen-wea* + +### remove old Firmware Files, will be newly copied by rc-script +rm -f $FIRMWARE_FILES ### Edit DEVDB.tcl ### devdescrFile="/www/config/devdescr/DEVDB.tcl" @@ -41,6 +45,30 @@ if [ -z "`cat $webuiFile | grep \"$webuiInsertParam\"`" ]; then sed -i "s/\($webuiSearchBegin\)/\1$webuiInsert/g" $webuiFile fi +webuiInsertParam="WEATHER|RD_HEATING" +webuiInsertValue="stringTableWeatherRdHeating" +webuiInsert="\n" +webuiInsert="${webuiInsert}elvST['$webuiInsertParam'] = '\${$webuiInsertValue}';" +if [ -z "`cat $webuiFile | grep \"$webuiInsertParam\"`" ]; then + sed -i "s/\($webuiSearchBegin\)/\1$webuiInsert/g" $webuiFile +fi + +webuiInsertParam="WEATHER|RD_HEATING=TRUE" +webuiInsertValue="stringTableWeatherRdHeatingTrue" +webuiInsert="\n" +webuiInsert="${webuiInsert}elvST['$webuiInsertParam'] = '\${$webuiInsertValue}';" +if [ -z "`cat $webuiFile | grep \"$webuiInsertParam\"`" ]; then + sed -i "s/\($webuiSearchBegin\)/\1$webuiInsert/g" $webuiFile +fi + +webuiInsertParam="WEATHER|RD_HEATING=FALSE" +webuiInsertValue="stringTableWeatherRdHeatingFalse" +webuiInsert="\n" +webuiInsert="${webuiInsert}elvST['$webuiInsertParam'] = '\${$webuiInsertValue}';" +if [ -z "`cat $webuiFile | grep \"$webuiInsertParam\"`" ]; then + sed -i "s/\($webuiSearchBegin\)/\1$webuiInsert/g" $webuiFile +fi + webuiInsertParam="WEATHER|ANEMOMETER_RADIUS" webuiInsertValue="stringTableWeatherAnemometerRadius" webuiInsert="\n" @@ -89,6 +117,21 @@ if [ -z "`cat $stringtable_deFile | grep \"HBWEA_ALTITUDE"`" ]; then sed -i "1s/^/\1$stringtable_deInsert/" $stringtable_deFile fi +stringtable_deInsert="WEATHER|RD_HEATING \${stringTableWeatherRdHeating} \n" +if [ -z "`cat $stringtable_deFile | grep \"RD_HEATING"`" ]; then + sed -i "1s/^/\1$stringtable_deInsert/" $stringtable_deFile +fi + +stringtable_deInsert="WEATHER|RD_HEATING=TRUE \${stringTableWeatherRdHeatingTrue} \n" +if [ -z "`cat $stringtable_deFile | grep \"RD_HEATING=TRUE"`" ]; then + sed -i "1s/^/\1$stringtable_deInsert/" $stringtable_deFile +fi + +stringtable_deInsert="WEATHER|RD_HEATING=FALSE \${stringTableWeatherRdHeatingFalse} \n" +if [ -z "`cat $stringtable_deFile | grep \"RD_HEATING=FALSE"`" ]; then + sed -i "1s/^/\1$stringtable_deInsert/" $stringtable_deFile +fi + stringtable_deInsert="WEATHER|GUST_SPEED \${stringTableWeatherGustSpeed} \n" if [ -z "`cat $stringtable_deFile | grep \"GUST_SPEED"`" ]; then sed -i "1s/^/\1$stringtable_deInsert/" $stringtable_deFile @@ -189,3 +232,18 @@ translate_deInsert="\n \"stringTableWeatherGustThresholdExtraMessage\" : \"zu if [ -z "`cat $translate_deFile | grep \"stringTableWeatherGustThresholdExtraMessage\"`" ]; then sed -i "s/\($translate_deSearch\)/\1$translate_deInsert/g" $translate_deFile fi + +translate_deInsert="\n \"stringTableWeatherRdHeating\" : \"Regendetektor Heizung\"," +if [ -z "`cat $translate_deFile | grep \"stringTableWeatherRdHeating\"`" ]; then + sed -i "s/\($translate_deSearch\)/\1$translate_deInsert/g" $translate_deFile +fi + +translate_deInsert="\n \"stringTableWeatherRdHeatingTrue\" : \"Regendetektor Heizung EIN\"," +if [ -z "`cat $translate_deFile | grep \"stringTableWeatherRdHeatingTrue\"`" ]; then + sed -i "s/\($translate_deSearch\)/\1$translate_deInsert/g" $translate_deFile +fi + +translate_deInsert="\n \"stringTableWeatherRdHeatingFalse\" : \"Regendetektor Heizung AUS\"," +if [ -z "`cat $translate_deFile | grep \"stringTableWeatherRdHeatingFalse\"`" ]; then + sed -i "s/\($translate_deSearch\)/\1$translate_deInsert/g" $translate_deFile +fi \ No newline at end of file diff --git a/src/addon/uninstall_hb-uni-sen-wea b/src/addon/uninstall_hb-uni-sen-wea index 0e9281a3..27fa7ed4 100755 --- a/src/addon/uninstall_hb-uni-sen-wea +++ b/src/addon/uninstall_hb-uni-sen-wea @@ -3,9 +3,7 @@ DEVICE="HB-UNI-Sen-WEA" DEVICE_IMG=hb-uni-sen-wea.png DEVICE_THUMB=hb-uni-sen-wea_thumb.png -FIRMWARE_FILE_1=hb-uni-sen-wea_le_v10.xml -FIRMWARE_FILE_2=hb-uni-sen-wea.xml -FIRMWARE_FILE_3=hb-uni-sen-wea_ge_v12.xml +FIRMWARE_FILES=/firmware/rftypes/hb-uni-sen-wea* devdescrFile="/www/config/devdescr/DEVDB.tcl" devdescrSearch="$DEVICE {{50 \/config\/img\/devices\/50\/$DEVICE_THUMB} {250 \/config\/img\/devices\/250\/$DEVICE_IMG}} " @@ -22,6 +20,10 @@ webuiSearch="HBWEA_ALTITUDE" if [ "`cat $webuiFile | grep \"$webuiSearch\"`" ]; then sed -i "/\($webuiSearch\)/d" $webuiFile fi +webuiSearch="WEATHER|RD_HEATING" +if [ "`cat $webuiFile | grep \"$webuiSearch\"`" ]; then + sed -i "/\($webuiSearch\)/d" $webuiFile +fi webuiSearch="WEATHER|ANEMOMETER_RADIUS" if [ "`cat $webuiFile | grep \"$webuiSearch\"`" ]; then sed -i "/\($webuiSearch\)/d" $webuiFile @@ -48,6 +50,10 @@ stringtable_deSearch="HBWEA_ALTITUDE" if [ "`cat $stringtable_deFile | grep \"$stringtable_deSearch\"`" ]; then sed -i "/\($stringtable_deSearch\)/d" $stringtable_deFile fi +stringtable_deSearch="RD_HEATING" +if [ "`cat $stringtable_deFile | grep \"$stringtable_deSearch\"`" ]; then + sed -i "/\($stringtable_deSearch\)/d" $stringtable_deFile +fi stringtable_deSearch="WEATHER|GUST_SPEED" if [ "`cat $stringtable_deFile | grep \"$stringtable_deSearch\"`" ]; then sed -i "/\($stringtable_deSearch\)/d" $stringtable_deFile @@ -107,8 +113,6 @@ if [ "`cat $translate_deFile | grep \"$translate_deSearch\"`" ]; then sed -i "/\(${translate_deSearch}\)/d" $translate_deFile fi -rm -f $FIRMWARE_FILE_1 -rm -f $FIRMWARE_FILE_2 -rm -f $FIRMWARE_FILE_3 +rm -f $FIRMWARE_FILES rm -f /www/config/img/devices/250/$DEVICE_IMG rm -f /www/config/img/devices/50/$DEVICE_THUMB