2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-07 19:04:20 +00:00

46_TeslaPowerwall2AC: Powerwall overview

git-svn-id: https://svn.fhem.de/fhem/trunk@15976 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
LeonGaultier 2018-01-24 04:58:51 +00:00
parent 3ad04b57c9
commit affbcf1f4d
3 changed files with 13 additions and 5 deletions

View File

@ -1,5 +1,7 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it.
- bugfix: 74_XiaomiBTLESens: fix error messages
- feature: 46_TeslaPowerwall2AC: Powerwalls overwiev
- feature: 73_PRESENCE: new set commands overrideInterval and clearOverride
to temporary override the check interval.
new attributes retryCount and retryInterval

View File

@ -66,7 +66,7 @@ use HttpUtils;
eval "use JSON;1" or $missingModul .= "JSON ";
my $version = "0.2.3";
my $version = "0.4.0";
@ -231,6 +231,7 @@ sub TeslaPowerwall2AC_Notify($$) {
TeslaPowerwall2AC_Timer_GetData($hash) if( grep /^INITIALIZED$/,@{$events}
or grep /^DELETEATTR.$name.disable$/,@{$events}
or grep /^DELETEATTR.$name.interval$/,@{$events}
or (grep /^DEFINED.$name$/,@{$events} and $init_done) );
return;
}
@ -489,15 +490,20 @@ sub TeslaPowerwall2AC_ReadingsProcessing_Powerwalls($$) {
if( ref($decode_json->{powerwalls}) eq "ARRAY" and scalar(@{$decode_json->{powerwalls}}) > 0 ) {
my $i = 0;
foreach my $powerwall (@{$decode_json->{powerwalls}}) {
if( ref($powerwall) eq "HASH" ) {
while( my ($r,$v) = each %{$powerwall} ) {
$readings{$r} = $v;
$readings{'wall_'.$i.'_'.$r} = $v;
}
$i++;
}
}
$readings{'numberOfWalls'} = $i;
} else {
$readings{'error'} = 'aggregates response is not a Array';

View File

@ -300,8 +300,8 @@ sub XiaomiBTLESens_stateRequest($) {
if( XiaomiBTLESens_CallBattery_IsUpdateTimeAgeToOld($hash,$CallBatteryAge{AttrVal($name,'BatteryFirmwareAge','24h')}) );
if( $hash->{helper}{CallSensDataCounter} < 1 ) {
XiaomiBTLESens_CreateParamGatttool($hash,'write',$XiaomiModels{AttrVal($name,'model','')}{wdata},$XiaomiModels{AttrVal($name,'model','')}{wdataValue});
$hash->{helper}{CallSensDataCounter} = $hash->{helper}{CallSensDataCounter} + 1;
XiaomiBTLESens_CreateParamGatttool($hash,'write',$XiaomiModels{AttrVal($name,'model','')}{wdata},$XiaomiModels{AttrVal($name,'model','')}{wdataValue});
$hash->{helper}{CallSensDataCounter} = $hash->{helper}{CallSensDataCounter} + 1;
} else {
$readings{'lastGattError'} = 'charWrite faild';