From 1a6152011e4400f46192ae3965df89da76addb2f Mon Sep 17 00:00:00 2001 From: Lutz Bender Date: Thu, 9 Jun 2022 11:22:56 +0200 Subject: [PATCH] update grid modules --- modules/bezug_alphaess/main.sh | 16 ++---- modules/bezug_batterx/main.sh | 8 +-- modules/bezug_carlogavazzilan/main.sh | 14 ++--- modules/bezug_discovergy/main.sh | 18 +++++-- modules/bezug_e3dc/main.sh | 3 +- modules/bezug_ethmpm3pm/main.sh | 12 ++--- modules/bezug_ethmpm3pmflex/main.sh | 14 ++--- modules/bezug_fems/fems.py | 10 ++-- modules/bezug_fems/main.sh | 3 +- .../bezug_fronius_sm/froniusloadmeterdata.php | 8 +-- modules/bezug_good_we/main.sh | 4 +- modules/bezug_http/main.sh | 16 ++---- modules/bezug_huawei/main.sh | 2 +- modules/bezug_janitza/main.sh | 14 ++--- modules/bezug_json/main.sh | 14 ++--- modules/bezug_kostalpiko/main.sh | 3 +- modules/bezug_ksem/main.sh | 3 +- modules/bezug_lgessv1/main.sh | 4 +- modules/bezug_mqtt/main.sh | 6 +-- modules/bezug_powerdog/main.sh | 13 ++--- modules/bezug_powerfox/main.sh | 3 +- modules/bezug_powerfox/powerfox.py | 1 + modules/bezug_rct2/rct_read_status.py | 29 +++++----- modules/bezug_rct2/status.sh | 2 +- modules/bezug_sbs25/main.sh | 17 ++++-- modules/bezug_sbs25/sbs25.py | 53 +++++++++---------- modules/bezug_siemens/main.sh | 16 ++---- modules/bezug_smartfox/main.sh | 16 ++---- modules/bezug_smartfox/smartfox.py | 16 +++--- modules/bezug_smartme/main.sh | 16 ++---- modules/bezug_smartme/smartme.py | 6 +-- modules/bezug_smashm/main.sh | 8 +-- modules/bezug_solarlog/main.sh | 17 ++---- modules/bezug_solarworld/main.sh | 16 ++---- modules/bezug_solarworld/solarworld.py | 5 +- modules/bezug_solax/main.sh | 12 ++--- modules/bezug_sonneneco/main.sh | 11 ++-- modules/bezug_sungrow/main.sh | 12 ++--- modules/bezug_varta/varta.py | 5 +- modules/bezug_victrongx/main.sh | 2 +- packages/modules/janitza/counter.py | 12 ++++- packages/modules/json/counter.py | 1 + 42 files changed, 196 insertions(+), 265 deletions(-) diff --git a/modules/bezug_alphaess/main.sh b/modules/bezug_alphaess/main.sh index bb9a8eb61..5e3873293 100755 --- a/modules/bezug_alphaess/main.sh +++ b/modules/bezug_alphaess/main.sh @@ -1,23 +1,17 @@ #!/bin/bash -OPENWBBASEDIR=$(cd `dirname $0`/../../ && pwd) +OPENWBBASEDIR=$(cd "$(dirname "$0")/../../" && pwd) RAMDISKDIR="${OPENWBBASEDIR}/ramdisk" -MODULEDIR=$(cd `dirname $0` && pwd) #DMOD="EVU" DMOD="MAIN" -Debug=$debug - -#For development only -#Debug=1 if [ ${DMOD} == "MAIN" ]; then - MYLOGFILE="${RAMDISKDIR}/openWB.log" + MYLOGFILE="${RAMDISKDIR}/openWB.log" else - MYLOGFILE="${RAMDISKDIR}/evu.log" + MYLOGFILE="${RAMDISKDIR}/evu.log" fi -bash "$OPENWBBASEDIR/packages/legacy_run.sh" "modules.alpha_ess.device" "counter" "${alphasource}" "${alphav123}" "${alphaip}" >>${MYLOGFILE} 2>&1 +bash "$OPENWBBASEDIR/packages/legacy_run.sh" "modules.alpha_ess.device" "counter" "${alphasource}" "${alphav123}" "${alphaip}" >>"${MYLOGFILE}" 2>&1 ret=$? openwbDebugLog ${DMOD} 2 "EVU RET: ${ret}" -wattbezug=$(<${RAMDISKDIR}/wattbezug) -echo $wattbezug +cat "${RAMDISKDIR}/wattbezug" diff --git a/modules/bezug_batterx/main.sh b/modules/bezug_batterx/main.sh index 555cd9391..5c4f83bb1 100755 --- a/modules/bezug_batterx/main.sh +++ b/modules/bezug_batterx/main.sh @@ -7,15 +7,15 @@ DMOD="MAIN" #Debug=1 if [ ${DMOD} == "MAIN" ]; then - MYLOGFILE="${RAMDISKDIR}/openWB.log" + MYLOGFILE="${RAMDISKDIR}/openWB.log" else - MYLOGFILE="${RAMDISKDIR}/evu.log" + MYLOGFILE="${RAMDISKDIR}/evu.log" fi # Werte werden im WR ausgelesen, max eine Abfrage pro Sekunde if [ ${pvwattmodul} != "wr_batterx" ]; then - bash "$OPENWBBASEDIR/packages/legacy_run.sh" "modules.batterx.device" "counter" "${batterx_ip}" >>"${MYLOGFILE}" 2>&1 - ret=$? + bash "$OPENWBBASEDIR/packages/legacy_run.sh" "modules.batterx.device" "counter" "${batterx_ip}" >>"${MYLOGFILE}" 2>&1 + ret=$? fi openwbDebugLog ${DMOD} 2 "EVU RET: ${ret}" diff --git a/modules/bezug_carlogavazzilan/main.sh b/modules/bezug_carlogavazzilan/main.sh index 1a208bd63..18b8e44d2 100755 --- a/modules/bezug_carlogavazzilan/main.sh +++ b/modules/bezug_carlogavazzilan/main.sh @@ -1,24 +1,18 @@ #!/bin/bash -OPENWBBASEDIR=$(cd `dirname $0`/../../ && pwd) +OPENWBBASEDIR=$(cd "$(dirname "$0")/../../" && pwd) RAMDISKDIR="${OPENWBBASEDIR}/ramdisk" -MODULEDIR=$(cd `dirname $0` && pwd) #DMOD="EVU" DMOD="MAIN" -Debug=$debug - -#For development only -#Debug=1 if [ ${DMOD} == "MAIN" ]; then MYLOGFILE="${RAMDISKDIR}/openWB.log" else - MYLOGFILE="${RAMDISKDIR}/evu_carlo_gavazzi.log" + MYLOGFILE="${RAMDISKDIR}/evu.log" fi -bash "$OPENWBBASEDIR/packages/legacy_run.sh" "modules.carlo_gavazzi.device" "counter" "${bezug1_ip}" >>${MYLOGFILE} 2>&1 +bash "$OPENWBBASEDIR/packages/legacy_run.sh" "modules.carlo_gavazzi.device" "counter" "${bezug1_ip}" >>"${MYLOGFILE}" 2>&1 ret=$? openwbDebugLog ${DMOD} 2 "EVU RET: ${ret}" -wattbezug=$(<${RAMDISKDIR}/wattbezug) -echo $wattbezug +cat "${RAMDISKDIR}/wattbezug" diff --git a/modules/bezug_discovergy/main.sh b/modules/bezug_discovergy/main.sh index 43549d65f..0727f0f62 100755 --- a/modules/bezug_discovergy/main.sh +++ b/modules/bezug_discovergy/main.sh @@ -1,5 +1,14 @@ #!/bin/bash -OPENWBBASEDIR=$(cd `dirname $0`/../../ && pwd) +OPENWBBASEDIR=$(cd "$(dirname "$0")/../../" && pwd) +RAMDISKDIR="${OPENWBBASEDIR}/ramdisk" +#DMOD="EVU" +DMOD="MAIN" + +if [ ${DMOD} == "MAIN" ]; then + MYLOGFILE="${RAMDISKDIR}/openWB.log" +else + MYLOGFILE="${RAMDISKDIR}/evu.log" +fi # If both wr_discovergy and bezug_discovergy are activated, then runs/loadvars.sh will run `wr_discovergy` first. # In this case that wr_discovergy will fetch data for both inverter end counter and there is nothing left for us to do @@ -9,9 +18,8 @@ OPENWBBASEDIR=$(cd `dirname $0`/../../ && pwd) # # The usage of wr_discovergy without bezug_discovergy is not intended and thus not handled. -if [[ "$pvwattmodul" != "wr_discovergy" ]] -then - bash "$OPENWBBASEDIR/packages/legacy_run.sh" "modules.discovergy.device" "$discovergyuser" "$discovergypass" "$discovergyevuid" "" >> "$OPENWBBASEDIR/ramdisk/openWB.log" 2>&1 +if [[ "$pvwattmodul" != "wr_discovergy" ]]; then + bash "$OPENWBBASEDIR/packages/legacy_run.sh" "modules.discovergy.device" "$discovergyuser" "$discovergypass" "$discovergyevuid" "" >> "$MYLOGFILE" 2>&1 fi -cat /var/www/html/openWB/ramdisk/wattbezug +cat "${RAMDISKDIR}/wattbezug" diff --git a/modules/bezug_e3dc/main.sh b/modules/bezug_e3dc/main.sh index 108909772..e07b72d7e 100755 --- a/modules/bezug_e3dc/main.sh +++ b/modules/bezug_e3dc/main.sh @@ -14,5 +14,4 @@ bash "$OPENWBBASEDIR/packages/legacy_run.sh" "bezug_e3dc.e3dc" "${e3dcip}" >>"${ ret=$? openwbDebugLog ${DMOD} 2 "EVU RET: ${ret}" -wattbezug=$(<"${RAMDISKDIR}/wattbezug") -echo "$wattbezug" +cat "${RAMDISKDIR}/wattbezug" diff --git a/modules/bezug_ethmpm3pm/main.sh b/modules/bezug_ethmpm3pm/main.sh index a7f1a1d50..e7d2df7da 100755 --- a/modules/bezug_ethmpm3pm/main.sh +++ b/modules/bezug_ethmpm3pm/main.sh @@ -7,14 +7,14 @@ DMOD="MAIN" #Debug=1 if [ ${DMOD} == "MAIN" ]; then - MYLOGFILE="${RAMDISKDIR}/openWB.log" + MYLOGFILE="${RAMDISKDIR}/openWB.log" else - MYLOGFILE="${RAMDISKDIR}/evu.log" + MYLOGFILE="${RAMDISKDIR}/evu.log" fi if { [[ $pvwattmodul != "wr_ethmpm3pmaevu" ]] || [[ $pv2wattmodul != "wr2_ethlovatoaevu" ]]; } && [[ $speichermodul != "speicher_sdmaevu" ]]; then - bash "$OPENWBBASEDIR/packages/legacy_run.sh" "modules.openwb_evu_kit.device" "counter" "${evukitversion}" >>"${MYLOGFILE}" 2>&1 - ret=$? - - openwbDebugLog ${DMOD} 2 "EVU RET: ${ret}" + bash "$OPENWBBASEDIR/packages/legacy_run.sh" "modules.openwb_evu_kit.device" "counter" "${evukitversion}" >>"${MYLOGFILE}" 2>&1 + ret=$? + openwbDebugLog ${DMOD} 2 "EVU RET: ${ret}" fi + cat "${RAMDISKDIR}/wattbezug" diff --git a/modules/bezug_ethmpm3pmflex/main.sh b/modules/bezug_ethmpm3pmflex/main.sh index 244b5067c..519709675 100755 --- a/modules/bezug_ethmpm3pmflex/main.sh +++ b/modules/bezug_ethmpm3pmflex/main.sh @@ -1,24 +1,18 @@ #!/bin/bash -OPENWBBASEDIR=$(cd `dirname $0`/../../ && pwd) +OPENWBBASEDIR=$(cd "$(dirname "$0")/../../" && pwd) RAMDISKDIR="${OPENWBBASEDIR}/ramdisk" -MODULEDIR=$(cd `dirname $0` && pwd) #DMOD="EVU" DMOD="MAIN" -Debug=$debug - -#For development only -#Debug=1 if [ ${DMOD} == "MAIN" ]; then MYLOGFILE="${RAMDISKDIR}/openWB.log" else - MYLOGFILE="${RAMDISKDIR}/evu_json.log" + MYLOGFILE="${RAMDISKDIR}/evu.log" fi -bash "$OPENWBBASEDIR/packages/legacy_run.sh" "modules.openwb_flex.device" "counter" "${evuflexversion}" "${evuflexip}" "${evuflexport}" "${evuflexid}" >>${MYLOGFILE} 2>&1 +bash "$OPENWBBASEDIR/packages/legacy_run.sh" "modules.openwb_flex.device" "counter" "${evuflexversion}" "${evuflexip}" "${evuflexport}" "${evuflexid}" >>"${MYLOGFILE}" 2>&1 ret=$? openwbDebugLog ${DMOD} 2 "EVU RET: ${ret}" -wattbezug=$(<${RAMDISKDIR}/wattbezug) -echo $wattbezug +cat "${RAMDISKDIR}/wattbezug" diff --git a/modules/bezug_fems/fems.py b/modules/bezug_fems/fems.py index 299524619..6fcee04ac 100755 --- a/modules/bezug_fems/fems.py +++ b/modules/bezug_fems/fems.py @@ -13,9 +13,8 @@ def write_ramdisk(val, file): try: - f = open('/var/www/html/openWB/ramdisk/'+file, 'w') - f.write(str(val)) - f.close() + with open('/var/www/html/openWB/ramdisk/'+file, 'w') as f: + f.write(str(val)) except: traceback.print_exc() @@ -24,9 +23,8 @@ def get_value(url, file): try: response = requests.get(url, timeout=2).json() val = response["value"] - f = open('/var/www/html/openWB/ramdisk/'+file, 'w') - f.write(str(val)) - f.close() + with open('/var/www/html/openWB/ramdisk/'+file, 'w') as f: + f.write(str(val)) except: traceback.print_exc() diff --git a/modules/bezug_fems/main.sh b/modules/bezug_fems/main.sh index 2b30a8199..b7fc78403 100644 --- a/modules/bezug_fems/main.sh +++ b/modules/bezug_fems/main.sh @@ -17,5 +17,4 @@ bash "$OPENWBBASEDIR/packages/legacy_run.sh" "bezug_fems.fems" "$femskacopw" "$f ret=$? openwbDebugLog ${DMOD} 2 "EVU RET: ${ret}" -wattbezug=$(<"${RAMDISKDIR}/wattbezug") -echo "$wattbezug" +cat "${RAMDISKDIR}/wattbezug" diff --git a/modules/bezug_fronius_sm/froniusloadmeterdata.php b/modules/bezug_fronius_sm/froniusloadmeterdata.php index 1ad26bdc7..8a6b26155 100644 --- a/modules/bezug_fronius_sm/froniusloadmeterdata.php +++ b/modules/bezug_fronius_sm/froniusloadmeterdata.php @@ -1,7 +1,7 @@ \ No newline at end of file diff --git a/modules/bezug_good_we/main.sh b/modules/bezug_good_we/main.sh index d0e90289c..d5ccdc2be 100755 --- a/modules/bezug_good_we/main.sh +++ b/modules/bezug_good_we/main.sh @@ -8,9 +8,9 @@ DMOD="MAIN" #Debug=1 if [ ${DMOD} == "MAIN" ]; then - MYLOGFILE="${RAMDISKDIR}/openWB.log" + MYLOGFILE="${RAMDISKDIR}/openWB.log" else - MYLOGFILE="${RAMDISKDIR}/evu.log" + MYLOGFILE="${RAMDISKDIR}/evu.log" fi bash "$OPENWBBASEDIR/packages/legacy_run.sh" "modules.good_we.device" "counter" "${good_we_ip}" "${good_we_id}">>"${MYLOGFILE}" 2>&1 diff --git a/modules/bezug_http/main.sh b/modules/bezug_http/main.sh index 2c9e8ddd0..df549c721 100755 --- a/modules/bezug_http/main.sh +++ b/modules/bezug_http/main.sh @@ -1,24 +1,18 @@ #!/bin/bash -OPENWBBASEDIR=$(cd `dirname $0`/../../ && pwd) +OPENWBBASEDIR=$(cd "$(dirname "$0")/../../" && pwd) RAMDISKDIR="$OPENWBBASEDIR/ramdisk" -MODULEDIR=$(cd `dirname $0` && pwd) #DMOD="EVU" DMOD="MAIN" -Debug=$debug - -#For development only -#Debug=1 if [ $DMOD == "MAIN" ]; then - MYLOGFILE="$RAMDISKDIR/openWB.log" + MYLOGFILE="$RAMDISKDIR/openWB.log" else - MYLOGFILE="$RAMDISKDIR/evu.log" + MYLOGFILE="$RAMDISKDIR/evu.log" fi -bash "$OPENWBBASEDIR/packages/legacy_run.sh" "modules.http.device" "counter" "${bezug_http_w_url}" "${bezug_http_ikwh_url}" "${bezug_http_ekwh_url}" "${bezug_http_l1_url}" "${bezug_http_l2_url}" "${bezug_http_l3_url}" >>$MYLOGFILE 2>&1 +bash "$OPENWBBASEDIR/packages/legacy_run.sh" "modules.http.device" "counter" "${bezug_http_w_url}" "${bezug_http_ikwh_url}" "${bezug_http_ekwh_url}" "${bezug_http_l1_url}" "${bezug_http_l2_url}" "${bezug_http_l3_url}" >>"$MYLOGFILE" 2>&1 ret=$? openwbDebugLog ${DMOD} 2 "RET: ${ret}" -wattbezug=$(>${MYLOGFILE} 2>&1 +bash "$OPENWBBASEDIR/packages/legacy_run.sh" "modules.janitza.device" "counter" "${bezug1_ip}" >>"${MYLOGFILE}" 2>&1 ret=$? openwbDebugLog ${DMOD} 2 "EVU RET: ${ret}" -wattbezug=$(<${RAMDISKDIR}/wattbezug) -echo $wattbezug +cat "${RAMDISKDIR}/wattbezug" diff --git a/modules/bezug_json/main.sh b/modules/bezug_json/main.sh index c51ba87b8..fd7096016 100755 --- a/modules/bezug_json/main.sh +++ b/modules/bezug_json/main.sh @@ -1,18 +1,13 @@ #!/bin/bash -OPENWBBASEDIR=$(cd `dirname $0`/../../ && pwd) +OPENWBBASEDIR=$(cd "$(dirname "$0")/../../" && pwd) RAMDISKDIR="${OPENWBBASEDIR}/ramdisk" -MODULEDIR=$(cd `dirname $0` && pwd) #DMOD="EVU" DMOD="MAIN" -Debug=$debug - -#For development only -#Debug=1 if [ ${DMOD} == "MAIN" ]; then MYLOGFILE="${RAMDISKDIR}/openWB.log" else - MYLOGFILE="${RAMDISKDIR}/evu_json.log" + MYLOGFILE="${RAMDISKDIR}/evu.log" fi openwbDebugLog ${DMOD} 2 "EVU URL: ${bezugjsonurl}" @@ -20,10 +15,9 @@ openwbDebugLog ${DMOD} 2 "Filter Watt : ${bezugjsonwatt}" openwbDebugLog ${DMOD} 2 "Filter Bezug: ${bezugjsonkwh}" openwbDebugLog ${DMOD} 2 "Filter Einsp: ${einspeisungjsonkwh}" -bash "$OPENWBBASEDIR/packages/legacy_run.sh" "modules.json.device" "counter" "${bezugjsonurl}" "${bezugjsonwatt}" "${bezugjsonkwh}" "${einspeisungjsonkwh}" >>$MYLOGFILE 2>&1 +bash "$OPENWBBASEDIR/packages/legacy_run.sh" "modules.json.device" "counter" "${bezugjsonurl}" "${bezugjsonwatt}" "${bezugjsonkwh}" "${einspeisungjsonkwh}" >>"$MYLOGFILE" 2>&1 ret=$? openwbDebugLog ${DMOD} 2 "RET: ${ret}" -evuwatt=$(<${RAMDISKDIR}/wattbezug) -echo ${evuwatt} +cat "${RAMDISKDIR}/wattbezug" diff --git a/modules/bezug_kostalpiko/main.sh b/modules/bezug_kostalpiko/main.sh index 8a639785a..536521f7f 100755 --- a/modules/bezug_kostalpiko/main.sh +++ b/modules/bezug_kostalpiko/main.sh @@ -15,5 +15,4 @@ ret=$? openwbDebugLog ${DMOD} 2 "RET: ${ret}" -wattbezug=$(<"$RAMDISKDIR/wattbezug") -echo "$wattbezug" +cat "${RAMDISKDIR}/wattbezug" diff --git a/modules/bezug_ksem/main.sh b/modules/bezug_ksem/main.sh index 833b58d2b..c56b809f7 100644 --- a/modules/bezug_ksem/main.sh +++ b/modules/bezug_ksem/main.sh @@ -14,5 +14,4 @@ bash "$OPENWBBASEDIR/packages/legacy_run.sh" "bezug_ksem.readksem" "${ksemip}" > ret=$? openwbDebugLog ${DMOD} 2 "EVU RET: ${ret}" -wattbezug=$(<"${RAMDISKDIR}/wattbezug") -echo "$wattbezug" +cat "${RAMDISKDIR}/wattbezug" diff --git a/modules/bezug_lgessv1/main.sh b/modules/bezug_lgessv1/main.sh index 637386a1e..b7002a211 100755 --- a/modules/bezug_lgessv1/main.sh +++ b/modules/bezug_lgessv1/main.sh @@ -8,9 +8,9 @@ DMOD="MAIN" #Debug=1 if [ ${DMOD} == "MAIN" ]; then - MYLOGFILE="${RAMDISKDIR}/openWB.log" + MYLOGFILE="${RAMDISKDIR}/openWB.log" else - MYLOGFILE="${RAMDISKDIR}/evu.log" + MYLOGFILE="${RAMDISKDIR}/evu.log" fi bash "$OPENWBBASEDIR/packages/legacy_run.sh" "modules.lg.device" "counter" "${lgessv1ip}" "${lgessv1pass}" >>"${MYLOGFILE}" 2>&1 diff --git a/modules/bezug_mqtt/main.sh b/modules/bezug_mqtt/main.sh index 8b8ac5baf..55e2a9510 100755 --- a/modules/bezug_mqtt/main.sh +++ b/modules/bezug_mqtt/main.sh @@ -1,9 +1,7 @@ #!/bin/bash -OPENWBBASEDIR=$(cd `dirname $0`/../../ && pwd) +OPENWBBASEDIR=$(cd "$(dirname "$0")/../../" && pwd) RAMDISKDIR="$OPENWBBASEDIR/ramdisk" -MODULEDIR=$(cd `dirname $0` && pwd) -wattbezug=$(<$RAMDISKDIR/wattbezug) -echo $wattbezug +cat "${RAMDISKDIR}/wattbezug" openwbModulePublishState "EVU" 0 "Kein Fehler" diff --git a/modules/bezug_powerdog/main.sh b/modules/bezug_powerdog/main.sh index 26f53318e..05811ed49 100755 --- a/modules/bezug_powerdog/main.sh +++ b/modules/bezug_powerdog/main.sh @@ -1,14 +1,8 @@ - #!/bin/bash -OPENWBBASEDIR=$(cd `dirname $0`/../../ && pwd) +OPENWBBASEDIR=$(cd "$(dirname "$0")/../../" && pwd) RAMDISKDIR="${OPENWBBASEDIR}/ramdisk" -MODULEDIR=$(cd `dirname $0` && pwd) #DMOD="EVU" DMOD="MAIN" -Debug=$debug - -#For development only -#Debug=1 if [ ${DMOD} == "MAIN" ]; then MYLOGFILE="${RAMDISKDIR}/openWB.log" @@ -16,10 +10,9 @@ else MYLOGFILE="${RAMDISKDIR}/evu_powerdog.log" fi -bash "$OPENWBBASEDIR/packages/legacy_run.sh" "modules.powerdog.device" "counter" "${bezug1_ip}" >>${MYLOGFILE} 2>&1 +bash "$OPENWBBASEDIR/packages/legacy_run.sh" "modules.powerdog.device" "counter" "${bezug1_ip}" >>"${MYLOGFILE}" 2>&1 ret=$? openwbDebugLog ${DMOD} 2 "EVU RET: ${ret}" -wattbezug=$(<${RAMDISKDIR}/wattbezug) -echo $wattbezug +cat "${RAMDISKDIR}/wattbezug" diff --git a/modules/bezug_powerfox/main.sh b/modules/bezug_powerfox/main.sh index a40f3e40d..2a2b15bd3 100644 --- a/modules/bezug_powerfox/main.sh +++ b/modules/bezug_powerfox/main.sh @@ -14,5 +14,4 @@ bash "$OPENWBBASEDIR/packages/legacy_run.sh" "bezug_powerfox.powerfox" "${powerf ret=$? openwbDebugLog ${DMOD} 2 "RET: ${ret}" -wattbezug=$(<"${RAMDISKDIR}/wattbezug") -echo "$wattbezug" +cat "${RAMDISKDIR}/wattbezug" diff --git a/modules/bezug_powerfox/powerfox.py b/modules/bezug_powerfox/powerfox.py index 28d57a234..c4e146885 100644 --- a/modules/bezug_powerfox/powerfox.py +++ b/modules/bezug_powerfox/powerfox.py @@ -44,5 +44,6 @@ def update(powerfoxid: str, powerfoxuser: str, powerfoxpass: str): exit(1) log.debug('Watt: ' + str(watt)) + def main(argv: List[str]): run_using_positional_cli_args(update, argv) diff --git a/modules/bezug_rct2/rct_read_status.py b/modules/bezug_rct2/rct_read_status.py index eadec9ed5..d55f3e1dc 100644 --- a/modules/bezug_rct2/rct_read_status.py +++ b/modules/bezug_rct2/rct_read_status.py @@ -1,6 +1,8 @@ #!/usr/bin/python3 from typing import List -import os, sys, traceback, time +import sys +import traceback +import time import rct_lib from rct_lib import rct_id @@ -13,10 +15,10 @@ def main(argv: List[str]): start_time = time.time() rct = rct_lib.RCT(argv) - if rct.connect_to_server() == True: + if rct.connect_to_server() is True: try: MyTab = [] - MyTab.append(rct_id(0 , 0, '-----------------Batterie-------------------- ')) + MyTab.append(rct_id(0, 0, '-----------------Batterie-------------------- ')) rct.add_by_name(MyTab, 'battery.soc') rct.add_by_name(MyTab, 'battery.efficiency') rct.add_by_name(MyTab, 'acc_conv.i_acc_lp_fast') @@ -28,40 +30,40 @@ def main(argv: List[str]): rct.add_by_name(MyTab, 'g_sync.p_acc_lp') rct.add_by_name(MyTab, 'energy.e_dc_total[0]') rct.add_by_name(MyTab, 'energy.e_dc_total[1]') - MyTab.append(rct_id(0 , 0, '------------------- Panels A -----------------')) + MyTab.append(rct_id(0, 0, '------------------- Panels A -----------------')) rct.add_by_name(MyTab, 'dc_conv.dc_conv_struct[0].p_dc') rct.add_by_name(MyTab, 'dc_conv.dc_conv_struct[0].p_dc_lp') rct.add_by_name(MyTab, 'dc_conv.dc_conv_struct[0].u_sg_lp') rct.add_by_name(MyTab, 'g_sync.u_sg_avg[0]') - MyTab.append(rct_id(0 , 0, '----------------- Panels B --------------------')) + MyTab.append(rct_id(0, 0, '----------------- Panels B --------------------')) rct.add_by_name(MyTab, 'dc_conv.dc_conv_struct[1].p_dc') rct.add_by_name(MyTab, 'dc_conv.dc_conv_struct[1].p_dc_lp') rct.add_by_name(MyTab, 'dc_conv.dc_conv_struct[1].u_sg_lp') rct.add_by_name(MyTab, 'g_sync.u_sg_avg[1]') - MyTab.append(rct_id(0 , 0, '---------- WR/Netz/Haus Spannungen --------------')) + MyTab.append(rct_id(0, 0, '---------- WR/Netz/Haus Spannungen --------------')) rct.add_by_name(MyTab, 'g_sync.u_l_rms[0]') rct.add_by_name(MyTab, 'g_sync.u_l_rms[1]') rct.add_by_name(MyTab, 'g_sync.u_l_rms[2]') - MyTab.append(rct_id(0 , 0, '----------------------- WR --------------------- ')) + MyTab.append(rct_id(0, 0, '----------------------- WR --------------------- ')) rct.add_by_name(MyTab, 'g_sync.i_dr_eff[0]') rct.add_by_name(MyTab, 'g_sync.i_dr_eff[1]') rct.add_by_name(MyTab, 'g_sync.i_dr_eff[2]') - MyTab.append(rct_id(0 , 0, '--------WR 3* U*I = Watt erzeugung des WR ------')) + MyTab.append(rct_id(0, 0, '--------WR 3* U*I = Watt Erzeugung des WR ------')) rct.add_by_name(MyTab, 'g_sync.p_ac[0]') rct.add_by_name(MyTab, 'g_sync.p_ac[1]') rct.add_by_name(MyTab, 'g_sync.p_ac[2]') - MyTab.append(rct_id(0 , 0, '--------------- HAUS Verbrauch --------------------')) + MyTab.append(rct_id(0, 0, '--------------- HAUS Verbrauch --------------------')) rct.add_by_name(MyTab, 'g_sync.p_ac_load[0]') rct.add_by_name(MyTab, 'g_sync.p_ac_load[1]') rct.add_by_name(MyTab, 'g_sync.p_ac_load[2]') - MyTab.append(rct_id(0 , 0, '--------------------- Netz ------------------' )) + MyTab.append(rct_id(0, 0, '--------------------- Netz ------------------')) rct.add_by_name(MyTab, 'g_sync.p_ac_sc[0]') rct.add_by_name(MyTab, 'g_sync.p_ac_sc[1]') rct.add_by_name(MyTab, 'g_sync.p_ac_sc[2]') rct.add_by_name(MyTab, 'g_sync.p_ac_grid_sum_lp') rct.add_by_name(MyTab, 'grid_offset') rct.add_by_name(MyTab, 'grid_pll[0].f') - MyTab.append(rct_id(0 , 0, '--------------------- ----- ------------------')) + MyTab.append(rct_id(0, 0, '--------------------- ----- ------------------')) # read via rct_id list response = rct.read(MyTab) @@ -75,6 +77,7 @@ def main(argv: List[str]): rct.close() rct = None - + + if __name__ == "__main__": - main(sys.argv[1:]) \ No newline at end of file + main(sys.argv[1:]) diff --git a/modules/bezug_rct2/status.sh b/modules/bezug_rct2/status.sh index bec84286d..49221cd66 100644 --- a/modules/bezug_rct2/status.sh +++ b/modules/bezug_rct2/status.sh @@ -1,3 +1,3 @@ #!/bin/bash MODULEDIR=$(cd "$(dirname "$0")" && pwd) -timeout -k 9 10 python3 "$MODULEDIR/rct_read_status.py" --ip="$bezug1_ip" \ No newline at end of file +timeout -k 9 10 python3 "$MODULEDIR/rct_read_status.py" --ip="$bezug1_ip" diff --git a/modules/bezug_sbs25/main.sh b/modules/bezug_sbs25/main.sh index 3929c5f80..53b4753c4 100755 --- a/modules/bezug_sbs25/main.sh +++ b/modules/bezug_sbs25/main.sh @@ -1,6 +1,17 @@ #!/bin/bash +OPENWBBASEDIR=$(cd "$(dirname "$0")/../../" && pwd) +RAMDISKDIR="${OPENWBBASEDIR}/ramdisk" +#DMOD="EVU" +DMOD="MAIN" -sudo python /var/www/html/openWB/modules/bezug_sbs25/sbs25.py $sbs25ip +if [ ${DMOD} == "MAIN" ]; then + MYLOGFILE="${RAMDISKDIR}/openWB.log" +else + MYLOGFILE="${RAMDISKDIR}/evu.log" +fi -wattbezug=$(>"${MYLOGFILE}" 2>&1 +ret=$? + +openwbDebugLog ${DMOD} 2 "RET: ${ret}" +cat "${RAMDISKDIR}/wattbezug" diff --git a/modules/bezug_sbs25/sbs25.py b/modules/bezug_sbs25/sbs25.py index 4d9560888..b76414354 100755 --- a/modules/bezug_sbs25/sbs25.py +++ b/modules/bezug_sbs25/sbs25.py @@ -1,33 +1,30 @@ -#!/usr/bin/python -import sys -# import os -# import time -# import getopt -# import socket -# import ConfigParser +#!/usr/bin/python3 +from typing import List import struct -# import binascii from pymodbus.client.sync import ModbusTcpClient -ipaddress = str(sys.argv[1]) +from helpermodules.cli import run_using_positional_cli_args -client = ModbusTcpClient(ipaddress, port=502) -# print "evu watt bezug" -resp= client.read_holding_registers(30865,2,unit=3) -value1 = resp.registers[0] -value2 = resp.registers[1] -all = format(value1, '04x') + format(value2, '04x') -bezug = int(struct.unpack('>i', all.decode('hex'))[0]) -resp= client.read_holding_registers(30867,2,unit=3) -value1 = resp.registers[0] -value2 = resp.registers[1] -all = format(value1, '04x') + format(value2, '04x') -einsp = int(struct.unpack('>i', all.decode('hex'))[0]) -if bezug > 5: - final=bezug -else: - final=einsp * -1 -f = open('/var/www/html/openWB/ramdisk/wattbezug', 'w') -f.write(str(final)) -f.close() +def update(ipaddress: str): + with ModbusTcpClient(ipaddress, port=502) as client: + resp = client.read_holding_registers(30865, 2, unit=3) + value1 = resp.registers[0] + value2 = resp.registers[1] + all = format(value1, '04x') + format(value2, '04x') + bezug = int(struct.unpack('>i', all.decode('hex'))[0]) + resp = client.read_holding_registers(30867, 2, unit=3) + value1 = resp.registers[0] + value2 = resp.registers[1] + all = format(value1, '04x') + format(value2, '04x') + einsp = int(struct.unpack('>i', all.decode('hex'))[0]) + if bezug > 5: + final = bezug + else: + final = einsp * -1 + with open('/var/www/html/openWB/ramdisk/wattbezug', 'w') as file: + file.write(str(final)) + + +def main(argv: List[str]): + run_using_positional_cli_args(update, argv) diff --git a/modules/bezug_siemens/main.sh b/modules/bezug_siemens/main.sh index ef1c64199..7a01a4520 100755 --- a/modules/bezug_siemens/main.sh +++ b/modules/bezug_siemens/main.sh @@ -1,23 +1,17 @@ #!/bin/bash -OPENWBBASEDIR=$(cd `dirname $0`/../../ && pwd) +OPENWBBASEDIR=$(cd "$(dirname "$0")/../../" && pwd) RAMDISKDIR="${OPENWBBASEDIR}/ramdisk" -MODULEDIR=$(cd `dirname $0` && pwd) #DMOD="EVU" DMOD="MAIN" -Debug=$debug - -#For development only -#Debug=1 if [ ${DMOD} == "MAIN" ]; then - MYLOGFILE="${RAMDISKDIR}/openWB.log" + MYLOGFILE="${RAMDISKDIR}/openWB.log" else - MYLOGFILE="${RAMDISKDIR}/evu.log" + MYLOGFILE="${RAMDISKDIR}/evu.log" fi -bash "$OPENWBBASEDIR/packages/legacy_run.sh" "modules.siemens.device" "counter" "${bezug1_ip}" >>${MYLOGFILE} 2>&1 +bash "$OPENWBBASEDIR/packages/legacy_run.sh" "modules.siemens.device" "counter" "${bezug1_ip}" >>"${MYLOGFILE}" 2>&1 ret=$? openwbDebugLog ${DMOD} 2 "EVU RET: ${ret}" -wattbezug=$(<${RAMDISKDIR}/wattbezug) -echo $wattbezug +cat "${RAMDISKDIR}/wattbezug" diff --git a/modules/bezug_smartfox/main.sh b/modules/bezug_smartfox/main.sh index faea04a0d..56ac84507 100755 --- a/modules/bezug_smartfox/main.sh +++ b/modules/bezug_smartfox/main.sh @@ -1,24 +1,18 @@ #!/bin/bash -OPENWBBASEDIR=$(cd `dirname $0`/../../ && pwd) +OPENWBBASEDIR=$(cd "$(dirname "$0")/../../" && pwd) RAMDISKDIR="$OPENWBBASEDIR/ramdisk" -MODULEDIR=$(cd `dirname $0` && pwd) #DMOD="EVU" DMOD="MAIN" -Debug=$debug - -#For development only -#Debug=1 if [ $DMOD == "MAIN" ]; then - MYLOGFILE="$RAMDISKDIR/openWB.log" + MYLOGFILE="$RAMDISKDIR/openWB.log" else - MYLOGFILE="$RAMDISKDIR/evu_json.log" + MYLOGFILE="$RAMDISKDIR/evu_json.log" fi -bash "$OPENWBBASEDIR/packages/legacy_run.sh" "bezug_smartfox.smartfox" "${bezug_smartfox_ip}" >>$MYLOGFILE 2>&1 +bash "$OPENWBBASEDIR/packages/legacy_run.sh" "bezug_smartfox.smartfox" "${bezug_smartfox_ip}" >>"$MYLOGFILE" 2>&1 ret=$? openwbDebugLog ${DMOD} 2 "RET: ${ret}" -wattbezug=$( W) wattbezug = (get_xml_text(root, "value", "id", var_wattbezug))[:-2] wattbezug1 = get_xml_text(root, "value", "id", var_wattbezug1) @@ -99,8 +99,9 @@ def update(bezug_smartfox_ip: str): ekwh = str(ekwh) # Weitere Zählerdaten für die Statusseite (PowerFaktor, Spannung und Strom) - # Powerfaktor ist nach dem Firmwareupgrade auf EM2 00.01.03.06 (04-2021) nicht mehr in der values.xml daher fix auf 1 - if newversion == False: + # Powerfaktor ist nach dem Firmwareupgrade auf EM2 00.01.03.06 (04-2021) + # nicht mehr in der values.xml daher fix auf 1 + if newversion is False: evupf1 = 1 evupf2 = 1 evupf3 = 1 @@ -116,8 +117,8 @@ def update(bezug_smartfox_ip: str): bezuga2 = get_xml_text(root, "value", "id", var_bezuga2) bezuga3 = get_xml_text(root, "value", "id", var_bezuga3) # Prüfen ob Werte gültig - regex = '^[-+]?[0-9]+\.?[0-9]*$' - if re.search(regex, wattbezug) == None: + regex = r'^[-+]?[0-9]+\.?[0-9]*$' + if re.search(regex, wattbezug) is None: with open("/var/www/html/openWB/ramdisk/wattbezug", "r") as f: wattbezug = int(f.read()) @@ -153,7 +154,6 @@ def update(bezug_smartfox_ip: str): with open("/var/www/html/openWB/ramdisk/bezuga3", "w") as f: f.write(str(bezuga3)) - log.debug('Watt: ' + str(wattbezug)) log.debug('Einspeisung: ' + str(ekwh)) log.debug('Bezug: ' + str(ikwh)) @@ -170,6 +170,6 @@ def update(bezug_smartfox_ip: str): log.debug('Strom L2: ' + str(bezuga2)) log.debug('Strom L3: ' + str(bezuga3)) + def main(argv: List[str]): run_using_positional_cli_args(update, argv) - diff --git a/modules/bezug_smartme/main.sh b/modules/bezug_smartme/main.sh index 87ac56ec6..7cff2231d 100755 --- a/modules/bezug_smartme/main.sh +++ b/modules/bezug_smartme/main.sh @@ -1,28 +1,22 @@ #!/bin/bash -OPENWBBASEDIR=$(cd `dirname $0`/../../ && pwd) +OPENWBBASEDIR=$(cd "$(dirname "$0")/../../" && pwd) RAMDISKDIR="$OPENWBBASEDIR/ramdisk" -MODULEDIR=$(cd `dirname $0` && pwd) #DMOD="EVU" DMOD="MAIN" -Debug=$debug - -#For development only -#Debug=1 if [ $DMOD == "MAIN" ]; then - MYLOGFILE="$RAMDISKDIR/openWB.log" + MYLOGFILE="$RAMDISKDIR/openWB.log" else - MYLOGFILE="$RAMDISKDIR/bezug_smartme.log" + MYLOGFILE="$RAMDISKDIR/bezug_smartme.log" fi openwbDebugLog ${DMOD} 2 "Bezug Smartme URL: ${bezug_smartme_url}" openwbDebugLog ${DMOD} 2 "Bezug Smartme User : ${bezug_smartme_user}" openwbDebugLog ${DMOD} 2 "Bezug Smartme Passwort: ${bezug_smartme_pass}" -bash "$OPENWBBASEDIR/packages/legacy_run.sh" "bezug_smartme.smartme" "${bezug_smartme_url}" "${bezug_smartme_user}" "${bezug_smartme_pass}" >>$MYLOGFILE 2>&1 +bash "$OPENWBBASEDIR/packages/legacy_run.sh" "bezug_smartme.smartme" "${bezug_smartme_url}" "${bezug_smartme_user}" "${bezug_smartme_pass}" >>"$MYLOGFILE" 2>&1 ret=$? openwbDebugLog ${DMOD} 2 "RET: ${ret}" -wattbezug=$(>$MYLOGFILE 2>&1 +bash "$OPENWBBASEDIR/packages/legacy_run.sh" "bezug_solarlog.solarlog" "${bezug_solarlog_ip}" "${bezug_solarlog_speicherv}" >>"$MYLOGFILE" 2>&1 ret=$? openwbDebugLog ${DMOD} 2 "RET: ${ret}" -wattbezug=$(>$MYLOGFILE 2>&1 +bash "$OPENWBBASEDIR/packages/legacy_run.sh" "bezug_solarworld.solarworld" "${solarworld_emanagerip}" >>"$MYLOGFILE" 2>&1 ret=$? openwbDebugLog ${DMOD} 2 "RET: ${ret}" -wattbezug=$(>${MYLOGFILE} 2>&1 +bash "$OPENWBBASEDIR/packages/legacy_run.sh" "modules.solax.device" "counter" "${solaxip}" "${pv1_ida}" >>"${MYLOGFILE}" 2>&1 ret=$? openwbDebugLog ${DMOD} 2 "EVU RET: ${ret}" -wattbezug=$(<${RAMDISKDIR}/wattbezug) -echo $wattbezug +cat "${RAMDISKDIR}/wattbezug" diff --git a/modules/bezug_sonneneco/main.sh b/modules/bezug_sonneneco/main.sh index e54538ad4..e3bf42ac4 100644 --- a/modules/bezug_sonneneco/main.sh +++ b/modules/bezug_sonneneco/main.sh @@ -1,19 +1,18 @@ #!/bin/bash -OPENWBBASEDIR=$(cd "$(dirname $0)/../../" && pwd) +OPENWBBASEDIR=$(cd "$(dirname "$0")/../../" && pwd) RAMDISKDIR="$OPENWBBASEDIR/ramdisk" #DMOD="EVU" DMOD="MAIN" if [ $DMOD == "MAIN" ]; then - MYLOGFILE="$RAMDISKDIR/openWB.log" + MYLOGFILE="$RAMDISKDIR/openWB.log" else - MYLOGFILE="$RAMDISKDIR/bezug_sonneneco.log" + MYLOGFILE="$RAMDISKDIR/bezug_sonneneco.log" fi -bash "$OPENWBBASEDIR/packages/legacy_run.sh" "modules.sonnenbatterie.device" "counter" "${sonnenecoip}" "${sonnenecoalternativ}" >>$MYLOGFILE 2>&1 +bash "$OPENWBBASEDIR/packages/legacy_run.sh" "modules.sonnenbatterie.device" "counter" "${sonnenecoip}" "${sonnenecoalternativ}" >>"$MYLOGFILE" 2>&1 ret=$? openwbDebugLog ${DMOD} 2 "RET: ${ret}" -wattbezug=$(<${RAMDISKDIR}/wattbezug) -echo $wattbezug +cat "${RAMDISKDIR}/wattbezug" diff --git a/modules/bezug_sungrow/main.sh b/modules/bezug_sungrow/main.sh index 881b01a9c..9c29ca8ea 100644 --- a/modules/bezug_sungrow/main.sh +++ b/modules/bezug_sungrow/main.sh @@ -1,13 +1,8 @@ #!/bin/bash -OPENWBBASEDIR=$(cd `dirname $0`/../../ && pwd) +OPENWBBASEDIR=$(cd "$(dirname "$0")/../../" && pwd) RAMDISKDIR="${OPENWBBASEDIR}/ramdisk" -MODULEDIR=$(cd `dirname $0` && pwd) #DMOD="EVU" DMOD="MAIN" -Debug=$debug - -#For development only -#Debug=1 if [ ${DMOD} == "MAIN" ]; then MYLOGFILE="${RAMDISKDIR}/openWB.log" @@ -15,10 +10,9 @@ else MYLOGFILE="${RAMDISKDIR}/evu.log" fi -bash "$OPENWBBASEDIR/packages/legacy_run.sh" "modules.sungrow.device" "counter" "${speicher1_ip}" "${sungrowsr}">>${MYLOGFILE} 2>&1 +bash "$OPENWBBASEDIR/packages/legacy_run.sh" "modules.sungrow.device" "counter" "${speicher1_ip}" "${sungrowsr}">>"${MYLOGFILE}" 2>&1 ret=$? openwbDebugLog ${DMOD} 2 "EVU RET: ${ret}" -wattbezug=$(<${RAMDISKDIR}/wattbezug) -echo $wattbezug +cat "${RAMDISKDIR}/wattbezug" diff --git a/modules/bezug_varta/varta.py b/modules/bezug_varta/varta.py index 9cfad3429..792a2642a 100644 --- a/modules/bezug_varta/varta.py +++ b/modules/bezug_varta/varta.py @@ -13,14 +13,17 @@ def update(ipaddress: str): with ModbusTcpClient(ipaddress, port=502) as client: - # gridleistung + # grid power resp = client.read_holding_registers(1078, 1, unit=1) value1 = resp.registers[0] + # ToDo: scale factor in register 2078 SInt16 + # power = reg(1078) * 10 ^ reg(2078) all = format(value1, '04x') final = int(struct.unpack('>h', codecs.decode(all, 'hex'))[0])*-1 log.debug("Result: %s", str(final)) with open('/var/www/html/openWB/ramdisk/wattbezug', 'w') as f: f.write(str(final)) + # ToDo: grid frequency in register 1082 as 0.01Hz UInt16 def main(argv: List[str]): diff --git a/modules/bezug_victrongx/main.sh b/modules/bezug_victrongx/main.sh index bb2b12d2f..07d385d2f 100755 --- a/modules/bezug_victrongx/main.sh +++ b/modules/bezug_victrongx/main.sh @@ -13,7 +13,7 @@ else MYLOGFILE="${RAMDISKDIR}/evu.log" fi -bash "$OPENWBBASEDIR/packages/legacy_run.sh" "modules.victron.device" "counter" "${bezug_victronip}" "${bezug_id}" "${victron_energy_meter}">>${MYLOGFILE} 2>&1 +bash "$OPENWBBASEDIR/packages/legacy_run.sh" "modules.victron.device" "counter" "${bezug_victronip}" "${bezug_id}" "${victron_energy_meter}">>"${MYLOGFILE}" 2>&1 ret=$? openwbDebugLog ${DMOD} 2 "EVU RET: ${ret}" diff --git a/packages/modules/janitza/counter.py b/packages/modules/janitza/counter.py index 4f504f167..af834af42 100644 --- a/packages/modules/janitza/counter.py +++ b/packages/modules/janitza/counter.py @@ -29,6 +29,11 @@ def __init__(self, device_id: int, component_config: dict, tcp_client: modbus.Mo def update(self): with self.__tcp_client: power = self.__tcp_client.read_holding_registers(19026, ModbusDataType.FLOAT_32, unit=1) + powers = self.__tcp_client.read_holding_registers(19020, [ModbusDataType.FLOAT_32] * 3, unit=1) + currents = self.__tcp_client.read_holding_registers(19012, [ModbusDataType.FLOAT_32] * 3, unit=1) + voltages = self.__tcp_client.read_holding_registers(19000, [ModbusDataType.FLOAT_32] * 3, unit=1) + power_factors = self.__tcp_client.read_holding_registers(19044, [ModbusDataType.FLOAT_32] * 3, unit=1) + frequency = self.__tcp_client.read_holding_registers(19050, ModbusDataType.FLOAT_32, unit=1) topic_str = "openWB/set/system/device/{}/component/{}/".format( self.__device_id, self.component_config["id"] @@ -43,6 +48,11 @@ def update(self): counter_state = CounterState( imported=imported, exported=exported, - power=power + power=power, + powers=powers, + currents=currents, + voltages=voltages, + frequency=frequency, + power_factors=power_factors ) self.__store.set(counter_state) diff --git a/packages/modules/json/counter.py b/packages/modules/json/counter.py index 29dde4b8f..82f6afab3 100644 --- a/packages/modules/json/counter.py +++ b/packages/modules/json/counter.py @@ -33,6 +33,7 @@ def update(self, response): config = self.component_config["configuration"] power = jq.compile(config["jq_power"]).input(response).first() + # ToDo: add current or power per phase if config["jq_imported"] == "" or config["jq_exported"] == "": topic_str = "openWB/set/system/device/{}/component/{}/".format( self.__device_id, self.component_config["id"]