mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-16 16:56:04 +00:00
10_ZWave.pm: add batteryState and batteryPercent (Forum #59943)
git-svn-id: https://svn.fhem.de/fhem/trunk@16796 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
86ffdd7af0
commit
8b52f5fdd9
@ -467,7 +467,7 @@ my %zwave_class = (
|
||||
REMOTE_ASSOCIATION => { id => '7d' },
|
||||
BATTERY => { id => '80',
|
||||
get => { battery => "02" },
|
||||
parse => { "0.8003(..)"=> '"battery:".($1 eq "ff" ? "low":hex($1)." %")'} },
|
||||
parse => { "0.8003(..)"=> 'ZWave_battery($1)'} } ,
|
||||
CLOCK => { id => '81',
|
||||
get => { clock => "05" },
|
||||
set => { clock => 'ZWave_clockSet()' },
|
||||
@ -3172,6 +3172,18 @@ ZWave_protectionParse($$)
|
||||
return "protection:$lpt $rpt";
|
||||
}
|
||||
|
||||
sub
|
||||
ZWave_battery($) # Forum #87575
|
||||
{
|
||||
my ($val) = @_;
|
||||
my @ret;
|
||||
|
||||
push @ret, "battery:".($val eq "ff" ? "low":hex($val)." %");
|
||||
push @ret, "batteryState:".($val eq "ff" ? "low":"ok");
|
||||
push @ret, "batteryPercent:".hex($val) if($val ne "ff");
|
||||
return @ret;
|
||||
}
|
||||
|
||||
sub
|
||||
ZWave_configParse($$$$)
|
||||
{
|
||||
@ -5841,7 +5853,7 @@ s2Hex($)
|
||||
|
||||
<br><br><b>Class BATTERY</b>
|
||||
<li>battery<br>
|
||||
return the charge of the battery in %, as battery:value % or battery:low
|
||||
return the state and charge of the battery, see below the events
|
||||
</li>
|
||||
|
||||
<br><br><b>CLASS DOOR_LOCK_LOGGING, V1 (deprecated)</b>
|
||||
@ -6371,7 +6383,9 @@ s2Hex($)
|
||||
<li>covering:[open|close|stop]</li>
|
||||
|
||||
<br><br><b>Class BATTERY</b>
|
||||
<li>battery:chargelevel %</li>
|
||||
<li>battery:{low|chargelevel %}</li>
|
||||
<li>batteryState:{ok|low}</li>
|
||||
<li>batteryPercent:<value></li>
|
||||
|
||||
<br><br><b>Class CENTRAL_SCENE</b>
|
||||
<li>cSceneSet:X</li>
|
||||
|
Loading…
x
Reference in New Issue
Block a user