2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 09:16:53 +00:00

36_ShellyMonitor: relay_0 replaced by state

git-svn-id: https://svn.fhem.de/fhem/trunk@27968 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
gvzdus 2023-09-15 10:04:02 +00:00
parent 107ace1c00
commit 24979cc9e0
2 changed files with 12 additions and 3 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: 36_ShellyMonitor: Change written reading from relay_0 to state
for non-relais devices
- bugfix: 36_ShellyMonitor: Correct handling of Shelly 3EM
- bugfix: 72_FRITZBOX: Handling Pipe | Zeichen in FB Daten korrigiert
wakeUpCall Leerzeichen im Namen durch %20 repräsentiert

View File

@ -729,10 +729,17 @@ sub ShellyMonitor_DoRead
readingsBulkUpdateIfChanged($device, $rtype . $subs,
$defarr->{"unit"} eq "Wmin" ? int($svalue/6)/10 : $svalue);
} elsif ($rtype eq "output") {
my $subs = ($shelly_models{$model}[0] ==1) ? "" : "_".$rno;
my $state = ( $svalue == 0 ? "off" : ( $svalue == 1 ? "on" : undef ));
if ($state) {
readingsBulkUpdateIfChanged($device, "relay" . $subs, $state);
my $no_relais = $shelly_models{$model}[0];
if ($no_relais == 0) {
readingsBulkUpdateIfChanged($device, "state", $state);
} else {
if ($no_relais == 1) {
readingsBulkUpdateIfChanged($device, "relay", $state);
} else {
my $sname = "relay_" . $rno;
readingsBulkUpdateIfChanged($device, $sname, $state);
}
}
} elsif ($rtype eq "brightness") {
my $subs = ($shelly_models{$model}[3] ==1) ? "" : "_".$rno;