diff --git a/fhem/FHEM/10_MYSENSORS_DEVICE.pm b/fhem/FHEM/10_MYSENSORS_DEVICE.pm index 82ed8040f..825070f16 100755 --- a/fhem/FHEM/10_MYSENSORS_DEVICE.pm +++ b/fhem/FHEM/10_MYSENSORS_DEVICE.pm @@ -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; } diff --git a/fhem/FHEM/lib/AttrTemplate/mqtt2.template b/fhem/FHEM/lib/AttrTemplate/mqtt2.template index 6b26cbd66..ee0cf2b11 100644 --- a/fhem/FHEM/lib/AttrTemplate/mqtt2.template +++ b/fhem/FHEM/lib/AttrTemplate/mqtt2.template @@ -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
rgb value is encoded as HEX value
remove color_temp in setlist command on if default white is not desired
Tested with:
Livarno Home LED ceiling light
Mueller Light tint RGBW bulb +desc: Forum Thread
A dimmable rgbw light connected via zigbee2mqtt
rgb value is encoded as HEX value
remove color_temp in setlist command on if default white is not desired
Tested with:
Livarno Home LED ceiling light
Mueller Light tint RGBW bulb 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 on-command (numeric, 0-255, e.g. 120);undef -par:CTVALUE;default color temp (ct) value in on-command (numeric, 0-370, e.g. 320);undef -par:CTWARMVALUE;default ct value in warm-command (e.g. 320);undef -par:CTWHITEVALUE;default ct value in white-command (e.g. 250);undef +par:CTVALUE;ct (color temp) value in on-command (numeric, 0-370, e.g. 320);undef +par:CTWARMVALUE;ct value in warm-command (e.g. 320);undef +par:CTWHITEVALUE;ct value in white-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