diff --git a/fhem/FHEM/30_LIGHTIFY.pm b/fhem/FHEM/30_LIGHTIFY.pm index 1411f4e31..715a7e55a 100644 --- a/fhem/FHEM/30_LIGHTIFY.pm +++ b/fhem/FHEM/30_LIGHTIFY.pm @@ -403,16 +403,6 @@ Log 3, "$alias: $id:$short, type: $type (w:$has_w, rgb:$has_rgb), onoff: $onoff, $cmdret= CommandAttr(undef,"$devname room LIGHTIFY"); $cmdret= CommandAttr(undef,"$devname IODev $name"); - my $subtype = 'extcolordimmer'; - if( $has_w && $has_rgb ) { - $subtype = 'extcolordimmer'; - } elsif( $has_rgb ) { - $subtype = 'colordimmer'; - } elsif( $has_w ) { - $subtype = 'ctdimmer'; - } - $cmdret= CommandAttr(undef,"$devname subType $subtype"); - $autocreated++; } } @@ -426,6 +416,14 @@ Log 3, "$alias: $id:$short, type: $type (w:$has_w, rgb:$has_rgb), onoff: $onoff, } }; + if( $has_rgb && $has_w ) { + $json->{type} = 'Extended color light'; + } elsif( $has_rgb ) { + $json->{type} = 'Color light'; + } elsif( $has_w ) { + $json->{type} = 'Color Temperature Light'; + } + if( !$has_rgb ) { $json->{state}->{colormode} = 'ct'; diff --git a/fhem/FHEM/31_HUEDevice.pm b/fhem/FHEM/31_HUEDevice.pm index f97dda92c..78030a605 100644 --- a/fhem/FHEM/31_HUEDevice.pm +++ b/fhem/FHEM/31_HUEDevice.pm @@ -838,8 +838,8 @@ HUEDevice_Parse($$) $attr{$name}{model} = $result->{modelid} if( !defined($attr{$name}{model}) && $result->{modelid} ); - if( defined($attr{$name}{model}) ) { - if( !defined($attr{$name}{subType}) ) { + if( !defined($attr{$name}{subType}) ) { + if( defined($attr{$name}{model}) ) { if( defined($hueModels{$attr{$name}{model}}{subType}) ) { $attr{$name}{subType} = $hueModels{$attr{$name}{model}}{subType}; @@ -852,29 +852,30 @@ HUEDevice_Parse($$) } elsif( $attr{$name}{model} =~ m/RGBW$/ ) { $attr{$name}{subType} = 'extcolordimmer'; - } elsif( $hash->{type} ) { - if( $hash->{type} eq "Extended color light" ) { - $attr{$name}{subType} = 'extcolordimmer'; + } - } elsif( $hash->{type} eq "Color light" ) { - $attr{$name}{subType} = 'colordimmer'; + } elsif( $hash->{type} ) { + if( $hash->{type} eq "Extended color light" ) { + $attr{$name}{subType} = 'extcolordimmer'; - } elsif( $hash->{type} eq "Color Temperature Light" ) { - $attr{$name}{subType} = 'ctdimmer'; + } elsif( $hash->{type} eq "Color light" ) { + $attr{$name}{subType} = 'colordimmer'; - } elsif( $hash->{type} eq "Dimmable light" ) { - $attr{$name}{subType} = 'dimmer'; + } elsif( $hash->{type} eq "Color Temperature Light" ) { + $attr{$name}{subType} = 'ctdimmer'; - } elsif( $hash->{type} eq "Dimmable plug-in unit" ) { - $attr{$name}{subType} = 'dimmer'; + } elsif( $hash->{type} eq "Dimmable light" ) { + $attr{$name}{subType} = 'dimmer'; - } + } elsif( $hash->{type} eq "Dimmable plug-in unit" ) { + $attr{$name}{subType} = 'dimmer'; } - } elsif( $attr{$name}{subType} eq "colordimmer" ) { - $attr{$name}{subType} = $hueModels{$attr{$name}{model}}{subType} if( defined($hueModels{$attr{$name}{model}}{subType}) ); } + + } elsif( $attr{$name}{subType} eq "colordimmer" ) { + $attr{$name}{subType} = $hueModels{$attr{$name}{model}}{subType} if( defined($hueModels{$attr{$name}{model}}{subType}) ); }