From 15349395165b521eb0f554be55473e96216962f3 Mon Sep 17 00:00:00 2001 From: Matthias Sandmann Date: Wed, 16 Mar 2022 22:41:50 +0100 Subject: [PATCH] removed wrong docu. Fixed call to missing function --- 98_EaseeWallbox.pm | 311 ++++++++++----------------------------------- 1 file changed, 67 insertions(+), 244 deletions(-) diff --git a/98_EaseeWallbox.pm b/98_EaseeWallbox.pm index 56e7e86..2599ae6 100644 --- a/98_EaseeWallbox.pm +++ b/98_EaseeWallbox.pm @@ -252,8 +252,6 @@ sub EaseeWallbox_Define($$) { EaseeWallbox_UpdateBaseData($hash); EaseeWallbox_RefreshData($hash); - InternalTimer(gettimeofday()+15, "EaseeWallbox_GetZones", $hash) if (defined $hash); - Log3 $name, 1, sprintf("EaseeWallbox_Define %s: Starting timer with interval %s", $name, InternalVal($name,'INTERVAL', undef)); InternalTimer(gettimeofday()+ InternalVal($name,'INTERVAL', undef), "EaseeWallbox_UpdateDueToTimer", $hash) if (defined $hash); return undef; @@ -348,10 +346,12 @@ sub EaseeWallbox_Set($@) { } sub EaseeWallbox_RefreshData($){ - my $hash = shift; + my $hash = shift; + my $name = $hash->{NAME}; EaseeWallbox_GetChargerSite($hash); EaseeWallbox_RequestChargerState($hash); EaseeWallbox_RequestCurrentSession($hash); + readingsSingleUpdate( $hash, "state", sprintf('%s (%.2f)
Current Session: %.2f kWH (%.2f€)', ReadingsVal($name,"operationMode","N/A"), ReadingsVal($name,"power","0"), ReadingsVal($name,"kWhInSession","0"), ReadingsVal($name,"session_chargingCost","0")), 1 ); } sub EaseeWallbox_UpdateBaseData($){ @@ -686,10 +686,8 @@ sub EaseeWallbox_GetChargers($) { my $chargerId = $charger->{id}; readingsBulkUpdate( $hash, "charger_id", $chargerId ); readingsBulkUpdate( $hash, "charger_name", $charger->{name} ); - readingsBulkUpdate( $hash, "charger_isTemporary", - $charger->{isTemporary} ); - readingsBulkUpdate( $hash, "charger_createdOn", - $charger->{createdOn} ); + #readingsBulkUpdate( $hash, "charger_isTemporary", $charger->{isTemporary} ); + #readingsBulkUpdate( $hash, "charger_createdOn", $charger->{createdOn} ); readingsEndUpdate( $hash, 1 ); $readTemplate = $url{"getChargerDetails"}; @@ -706,9 +704,9 @@ sub EaseeWallbox_GetChargers($) { } else { readingsBeginUpdate($hash); - readingsBulkUpdate( $hash, "charger_product", $d->{product} ); - readingsBulkUpdate( $hash, "charger_pincode", $d->{pinCode} ); - readingsBulkUpdate( $hash, "charger_unitType", $d->{unitType} ); + readingsBulkUpdate( $hash, "product", $d->{product} ); + readingsBulkUpdate( $hash, "pincode", $d->{pinCode} ); + readingsBulkUpdate( $hash, "unitType", $d->{unitType} ); readingsEndUpdate( $hash, 1 ); } @@ -747,69 +745,69 @@ sub EaseeWallbox_GetChargerConfig($) { readingsBulkUpdate( $hash, "charger_isEnabled", $d->{isEnabled} ); readingsBulkUpdate( $hash, - "charger_lockCablePermanently", + "lockCablePermanently", $d->{lockCablePermanently} ); readingsBulkUpdate( $hash, - "charger_authorizationRequired", + "authorizationRequired", $d->{authorizationRequired} ); - readingsBulkUpdate( $hash, "charger_remoteStartRequired", + readingsBulkUpdate( $hash, "remoteStartRequired", $d->{remoteStartRequired} ); - readingsBulkUpdate( $hash, "charger_smartButtonEnabled", + readingsBulkUpdate( $hash, "smartButtonEnabled", $d->{smartButtonEnabled} ); - readingsBulkUpdate( $hash, "charger_wiFiSSID", $d->{wiFiSSID} ); - readingsBulkUpdate( $hash, "charger_offlineChargingMode", - $d->{offlineChargingMode} ); - readingsBulkUpdate( $hash, "charger_circuitMaxCurrentP1", - $d->{circuitMaxCurrentP1} ); - readingsBulkUpdate( $hash, "charger_circuitMaxCurrentP2", - $d->{circuitMaxCurrentP2} ); - readingsBulkUpdate( $hash, "charger_circuitMaxCurrentP3", - $d->{circuitMaxCurrentP3} ); - readingsBulkUpdate( $hash, "charger_enableIdleCurrent", - $d->{enableIdleCurrent} ); - readingsBulkUpdate( - $hash, - "charger_limitToSinglePhaseCharging", - $d->{limitToSinglePhaseCharging} - ); + readingsBulkUpdate( $hash, "wiFiSSID", $d->{wiFiSSID} ); + #readingsBulkUpdate( $hash, "charger_offlineChargingMode", + # $d->{offlineChargingMode} ); + #readingsBulkUpdate( $hash, "charger_circuitMaxCurrentP1", + # $d->{circuitMaxCurrentP1} ); + #readingsBulkUpdate( $hash, "charger_circuitMaxCurrentP2", + # $d->{circuitMaxCurrentP2} ); + #readingsBulkUpdate( $hash, "charger_circuitMaxCurrentP3", + # $d->{circuitMaxCurrentP3} ); + #readingsBulkUpdate( $hash, "charger_enableIdleCurrent", + # $d->{enableIdleCurrent} ); + #readingsBulkUpdate( + # $hash, + # "charger_limitToSinglePhaseCharging", + # $d->{limitToSinglePhaseCharging} + #); readingsBulkUpdate( $hash, "charger_phaseModeId", $d->{phaseMode} ); readingsBulkUpdate( $hash, "charger_phaseMode", $phaseMode{ $d->{phaseMode} } ); - readingsBulkUpdate( $hash, "charger_localNodeType", - $d->{localNodeType} ); + #readingsBulkUpdate( $hash, "charger_localNodeType", + # $d->{localNodeType} ); readingsBulkUpdate( $hash, - "charger_localAuthorizationRequired", + "localAuthorizationRequired", $d->{localAuthorizationRequired} ); - readingsBulkUpdate( $hash, "charger_localRadioChannel", - $d->{localRadioChannel} ); - readingsBulkUpdate( $hash, "charger_localShortAddress", - $d->{localShortAddress} ); - readingsBulkUpdate( - $hash, - "charger_localParentAddrOrNumOfNodes", - $d->{localParentAddrOrNumOfNodes} - ); - readingsBulkUpdate( - $hash, - "charger_localPreAuthorizeEnabled", - $d->{localPreAuthorizeEnabled} - ); - readingsBulkUpdate( - $hash, - "charger_allowOfflineTxForUnknownId", - $d->{allowOfflineTxForUnknownId} - ); - readingsBulkUpdate( $hash, "charger_maxChargerCurrent", + #readingsBulkUpdate( $hash, "charger_localRadioChannel", + # $d->{localRadioChannel} ); + #readingsBulkUpdate( $hash, "charger_localShortAddress", + # $d->{localShortAddress} ); + #readingsBulkUpdate( + # $hash, + # "charger_localParentAddrOrNumOfNodes", + # $d->{localParentAddrOrNumOfNodes} + #); + #readingsBulkUpdate( + # $hash, + # "charger_localPreAuthorizeEnabled", + # $d->{localPreAuthorizeEnabled} + #); + #readingsBulkUpdate( + # $hash, + # "charger_allowOfflineTxForUnknownId", + # $d->{allowOfflineTxForUnknownId} + #); + readingsBulkUpdate( $hash, "maxChargerCurrent", $d->{maxChargerCurrent} ); - readingsBulkUpdate( $hash, "charger_ledStripBrightness", + readingsBulkUpdate( $hash, "ledStripBrightness", $d->{ledStripBrightness} ); - readingsBulkUpdate( $hash, "charger_chargingSchedule", - $d->{chargingSchedule} ); + #readingsBulkUpdate( $hash, "chargingSchedule", + # $d->{chargingSchedule} ); readingsEndUpdate( $hash, 1 ); @@ -845,7 +843,6 @@ sub EaseeWallbox_GetChargerSite($) { } else { - readingsBeginUpdate($hash); readingsBulkUpdate( $hash, "site_key", $d->{siteKey} ); readingsBulkUpdate( $hash, "site_id", $d->{id} ); @@ -854,9 +851,9 @@ sub EaseeWallbox_GetChargerSite($) { $d->{costPerKwhExcludeVat} ); readingsBulkUpdate( $hash, "cost_vat", $d->{vat} ); readingsBulkUpdate( $hash, "cost_currency", $d->{currencyId} ); - readingsBulkUpdate( $hash, "site_ratedCurrent", $d->{ratedCurrent} ); - readingsBulkUpdate( $hash, "site_createdOn", $d->{createdOn} ); - readingsBulkUpdate( $hash, "site_updatedOn", $d->{updatedOn} ); + #readingsBulkUpdate( $hash, "site_ratedCurrent", $d->{ratedCurrent} ); + #readingsBulkUpdate( $hash, "site_createdOn", $d->{createdOn} ); + #readingsBulkUpdate( $hash, "site_updatedOn", $d->{updatedOn} ); readingsEndUpdate( $hash, 1 ); return undef; } @@ -954,26 +951,26 @@ sub EaseeWallbox_RequestChargerStateCallback($) { Log3 $name, 5, 'Decoded: ' . Dumper($d); readingsBeginUpdate($hash); - readingsBulkUpdate( $hash, "actual_operationModeCode", + readingsBulkUpdate( $hash, "operationModeCode", $d->{chargerOpMode} ); - readingsBulkUpdate( $hash, "actual_operationMode", + readingsBulkUpdate( $hash, "operationMode", $operationMode{ $d->{chargerOpMode} } ); - readingsBulkUpdate( $hash, "actual_power", $d->{totalPower} ); - readingsBulkUpdate( $hash, "actual_kWhInSession", + readingsBulkUpdate( $hash, "power", $d->{totalPower} ); + readingsBulkUpdate( $hash, "kWhInSession", $d->{sessionEnergy} ); - readingsBulkUpdate( $hash, "actual_phase", $d->{outputPhase} ); - readingsBulkUpdate( $hash, "actual_latestPulse", $d->{latestPulse} ); - readingsBulkUpdate( $hash, "actual_current", $d->{outputCurrent} ); - readingsBulkUpdate( $hash, "actual_dynamicCurrent", + readingsBulkUpdate( $hash, "phase", $d->{outputPhase} ); + readingsBulkUpdate( $hash, "latestPulse", $d->{latestPulse} ); + readingsBulkUpdate( $hash, "current", $d->{outputCurrent} ); + readingsBulkUpdate( $hash, "dynamicCurrent", $d->{dynamicChargerCurrent} ); readingsBulkUpdate( $hash, - "actual_reasonCodeForNoCurrent", + "reasonCodeForNoCurrent", $d->{reasonForNoCurrent} ); - readingsBulkUpdate( $hash, "actual_reasonForNoCurrent", + readingsBulkUpdate( $hash, "reasonForNoCurrent", $reasonForNoCurrent{ $d->{reasonForNoCurrent} } ); readingsBulkUpdate( $hash, "errorCode", $d->{errorCode} ); @@ -986,7 +983,6 @@ sub EaseeWallbox_RequestChargerStateCallback($) { readingsBulkUpdate( $hash, "wifi_apEnabled", $d->{wiFiAPEnabled} ); readingsBulkUpdate( $hash, "cell_rssi", $d->{cellRSSI} ); readingsEndUpdate( $hash, 1 ); - return undef; } or do { Log3 $name, 5, 'Failure decoding: ' . $@; @@ -1148,179 +1144,6 @@ sub EaseeWallbox_decrypt($) { =pod =begin html - -

EaseeWallbox

- =end html