mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-02-25 09:55:38 +00:00
MYSENSORS_DEVICE: support better RSSI output for RFM nodes, #129990
git-svn-id: https://svn.fhem.de/fhem/trunk@26669 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
4dc3252c70
commit
2adf6426ec
@ -1054,44 +1054,41 @@ sub onInternalMessage {
|
||||
|
||||
if ($type == I_SIGNAL_REPORT_RESPONSE) {
|
||||
return if $msg->{ack};
|
||||
|
||||
my %rnames = ( 1 => 'R_RSSI_to_Parent',2 => 'R_RSSI_from_Parent',3 => 'R_SNR_to_Parent',4 => 'R_SNR_from_Parent',5 => 'R_TX_Powerlevel_Pct',6 => 'R_TX_Powerlevel_dBm',7 => 'R_Uplink_Quality');
|
||||
if ($msg->{payload} != -256) {
|
||||
my $subSet = $hash->{I_RSSI};
|
||||
my %rnames = ( "1" => "R_RSSI_to_Parent","2" => "R_RSSI_from_Parent","3" => "R_SNR_to_Parent","4" => "R_SNR_from_Parent","5" => "R_TX_Powerlevel_Pct","6" => "R_TX_Powerlevel_dBm","7" => "R_Uplink_Quality");
|
||||
my %payloads = ( "1" => "R!","2" => "S","3" => "S!","4" => "P","5" => "T","6" => "U");
|
||||
readingsSingleUpdate($hash, $rnames{$subSet}, $msg->{payload}, 1);
|
||||
if ($subSet < 7) {
|
||||
$hash->{I_RSSI}++;
|
||||
my %payloads = ( 1 => 'R!',2 => 'S',3 => 'S!',4 => 'P',5 => 'T',6 => 'U');
|
||||
sendClientMessage($hash,
|
||||
cmd => C_INTERNAL,
|
||||
ack => 0,
|
||||
subType => I_SIGNAL_REPORT_REQUEST,
|
||||
payload => $payloads{$subSet}
|
||||
);
|
||||
} else {
|
||||
delete $hash->{I_RSSI};
|
||||
if( $hash->{asyncGet} && $hash->{asyncGet}{reading} eq "RSSI" ) {
|
||||
RemoveInternalTimer($hash->{asyncGet});
|
||||
my $uq = $msg->{payload};
|
||||
my $topar = ReadingsVal($hash->{NAME},'R_RSSI_to_Parent','unknown');
|
||||
my $frompar = ReadingsVal($hash->{NAME},'R_RSSI_from_Parent','unknown');
|
||||
my $snr2par = ReadingsVal($hash->{NAME},'R_SNR_to_Parent','unknown');
|
||||
my $snrfpar = ReadingsVal($hash->{NAME},'R_RSSI_from_Parent','unknown');
|
||||
my $powpct = ReadingsVal($hash->{NAME},'R_TX_Powerlevel_Pct','unknown');
|
||||
my $powdbm = ReadingsVal($hash->{NAME},'R_TX_Powerlevel_dBm','unknown');
|
||||
asyncOutput($hash->{asyncGet}{CL}, "RSSI info:\n----------------------------\nto parent: $topar\nfrom parent: $frompar\nSNR to parent: $snr2par\nSNR from parent: $snrfpar\nPower level %: $powpct\nPower level dBm: powdbm\nUplink Quality: $uq");
|
||||
delete($hash->{asyncGet});
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
return;
|
||||
} elsif( $hash->{asyncGet} && $hash->{asyncGet}{reading} eq "RSSI" ) {
|
||||
}
|
||||
if( $hash->{asyncGet} && $hash->{asyncGet}{reading} eq 'RSSI' ) {
|
||||
RemoveInternalTimer($hash->{asyncGet});
|
||||
asyncOutput($hash->{asyncGet}{CL}, "Your transport type seems to be RS485, so asking for RSSI values is not possible");
|
||||
if ($msg->{payload} == -256 && (!$hash->{I_RSSI} || $hash->{I_RSSI} == 1)) {
|
||||
asyncOutput($hash->{asyncGet}{CL}, 'Your transport type seems not to support asking RSSI values');
|
||||
} else {
|
||||
RemoveInternalTimer($hash->{asyncGet});
|
||||
my $txt = 'RSSI info:\n----------------------------\n';
|
||||
my %txts = ( 1 => 'to parent: ',2 => '\nfrom parent:',3 => '\nSNR to parent: ',4 => '\nSNR from parent:',5 => '\nPower level %: ',6 => '\nPower level dBm:',7 => '\nUplink Quality:');
|
||||
for my $i (1..$hash->{I_RSSI}) {
|
||||
my $rv = ReadingsVal($hash->{NAME},$rnames{$i},'unknown');
|
||||
next if $rv eq 'unknown';
|
||||
$txt .= "$txts{$i} $rv";
|
||||
}
|
||||
asyncOutput($hash->{asyncGet}{CL}, $txt);
|
||||
}
|
||||
delete($hash->{asyncGet});
|
||||
delete $hash->{I_RSSI};
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -372,14 +372,14 @@ setreading DEVICE attrTemplateVersion 20220913
|
||||
name:zigbee2mqtt_light_rgbcct_rgb
|
||||
filter:TYPE=MQTT2_DEVICE:FILTER=CID~zigbee.*
|
||||
order:L_02e1
|
||||
desc: A dimmable rgbw light connected via zigbee2mqtt<br>rgb value is encoded as HEX value<br>remove color_temp in setlist command <b>on</b> if default white is not desired<br>Tested with:<br><a href="https://www.zigbee2mqtt.io/devices/HG08008.html" target="_blank">Livarno Home LED ceiling light</a><br><a href="https://www.zigbee2mqtt.io/devices/404000_404005_404012_404019.html#m%25C3%25BCller%2520licht-404000%252F404005%252F404012%252F404019" target="_blank">Mueller Light tint RGBW bulb</a>
|
||||
desc: <a href="https://forum.fhem.de/index.php/topic,97303.msg905935.html#msg905935" target="_blank">Forum Thread</a><br>A dimmable rgbw light connected via zigbee2mqtt<br>rgb value is encoded as HEX value<br>remove color_temp in setlist command <b>on</b> if default white is not desired<br>Tested with:<br><a href="https://www.zigbee2mqtt.io/devices/HG08008.html" target="_blank">Livarno Home LED ceiling light</a><br><a href="https://www.zigbee2mqtt.io/devices/404000_404005_404012_404019.html#m%25C3%25BCller%2520licht-404000%252F404005%252F404012%252F404019" target="_blank">Mueller Light tint RGBW bulb</a>
|
||||
farewell:specified values can be adjusted at any time in the setList attribute
|
||||
par:BASE_TOPIC;base topic set in configuration.yaml of the zigbee2mqtt bridge;{ AttrVal('DEVICE','devicetopic',AttrVal('DEVICE','readingList','')) =~ m,[\b]?([^/:]+)[/].+, ? $1 : undef }
|
||||
par:DEV_ID;name of the device in the zigbee2mqtt bridge;{ AttrVal('DEVICE','devicetopic',AttrVal('DEVICE','readingList','')) =~ m,[^/]+[/]([^/:]+).*, ? $1 : undef }
|
||||
par:BRIGHTNESS;default brightness in <b>on</b>-command (numeric, 0-255, e.g. 120);undef
|
||||
par:CTVALUE;default color temp (ct) value in <b>on</b>-command (numeric, 0-370, e.g. 320);undef
|
||||
par:CTWARMVALUE;default ct value in <b>warm</b>-command (e.g. 320);undef
|
||||
par:CTWHITEVALUE;default ct value in <b>white</b>-command (e.g. 250);undef
|
||||
par:CTVALUE;ct (color temp) value in <b>on</b>-command (numeric, 0-370, e.g. 320);undef
|
||||
par:CTWARMVALUE;ct value in <b>warm</b>-command (e.g. 320);undef
|
||||
par:CTWHITEVALUE;ct value in <b>white</b>-command (e.g. 250);undef
|
||||
par:ICON;ICON as set, defaults to hue_filled_white_and_color_e27_b22;{ AttrVal('DEVICE','icon','hue_filled_white_and_color_e27_b22') }
|
||||
attr DEVICE icon ICON
|
||||
attr DEVICE devStateIcon {zigbee2mqtt_devStateIcon255($name)}
|
||||
@ -399,7 +399,7 @@ attr DEVICE userReadings rgb:color_y.* {Color::xyY2hex(ReadingsVal($name,'color_
|
||||
attr DEVICE comment The specified ct and brightness values in on and warm etc. commands can be adjusted at any time via the setList attribute
|
||||
set DEVICE attrTemplate speechcontrol_type_light_255
|
||||
attr DEVICE model zigbee2mqtt_light_rgbcct_rgb
|
||||
setreading DEVICE attrTemplateVersion 20221106
|
||||
setreading DEVICE attrTemplateVersion 20221106_2
|
||||
|
||||
# zigbee2mqtt 2 channel dimmer device
|
||||
name:zigbee2mqtt_2channel_dimmer_split
|
||||
|
Loading…
x
Reference in New Issue
Block a user