diff --git a/fhem/FHEM/50_HP1000.pm b/fhem/FHEM/50_HP1000.pm index f0cdf8f9a..1bb1953c3 100755 --- a/fhem/FHEM/50_HP1000.pm +++ b/fhem/FHEM/50_HP1000.pm @@ -88,7 +88,7 @@ sub HP1000_Initialize($) { 'UV' => { rtype => 'uvi', }, 'UVR' => { rtype => 'uwpscm', }, 'UVcondition' => { rtype => 'condition_uvi', }, - 'UVcondition_rgb' => { rtype => 'rgb', }, + 'UVcondition_rgb' => { rtype => 'rgbhex', }, 'condition' => { rtype => 'condition_weather', }, 'daylight' => { rtype => 'yesno', }, 'dewpoint' => { rtype => 'c', formula_symbol => 'Td', }, diff --git a/fhem/FHEM/Unit.pm b/fhem/FHEM/Unit.pm index 80cfef8c1..66e5e2167 100644 --- a/fhem/FHEM/Unit.pm +++ b/fhem/FHEM/Unit.pm @@ -1328,13 +1328,23 @@ my $rtypes = { }, # color + rgbhex => { + ref_base => 900, + rtype_description => { + de => 'RGB Farbwert in Hex Notation', + en => 'RGB color value in Hex notation', + }, + scope => '^#?(([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2}))$', + }, + rgb => { ref_base => 900, rtype_description => { - de => 'RGB Farbwert', - en => 'RGB color value', + de => 'RGB Farbwert in Dezimal Notation', + en => 'RGB color value in decimal notation', }, - scope => '^#?(([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2}))$', + scope => +'^[\s\t\n ]*(?:rgb|RGB)?[\s\t\n ]*\(?[\s\t\n ]*((?:([0-9]{1,2}|1[0-9]{1,2}|2[0-4][0-9]|25[0-5])[\s\t\n ]*,?[\s\t\n ]*)(?:([0-9]{1,2}|1[0-9]{1,2}|2[0-4][0-9]|25[0-5])[\s\t\n ]*,?[\s\t\n ]*)(?:([0-9]{1,2}|1[0-9]{1,2}|2[0-4][0-9]|25[0-5])))[\s\t\n ]*\)?[\s\t\n ]*$', }, # logical operators