Compare commits
	
		
			1 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 38f4f510f1 | 
@@ -421,7 +421,7 @@ sub Set($$@) {
 | 
				
			|||||||
#return 'CometBlueBTLE: desired-temp supports temperatures from 6.0 - 28.0 degrees' if($args[0]<8.0 or $args[0]>28.0 or $args[0] ne 'on' or $args[0] ne 'off');
 | 
					#return 'CometBlueBTLE: desired-temp supports temperatures from 6.0 - 28.0 degrees' if($args[0]<8.0 or $args[0]>28.0 or $args[0] ne 'on' or $args[0] ne 'off');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $handle = $gatttChar{ AttrVal( $name, 'model', '' ) }{'payload'};
 | 
					        $handle = $gatttChar{ AttrVal( $name, 'model', '' ) }{'payload'};
 | 
				
			||||||
        $value = join( " ", @args );
 | 
					        $value = join( ' ', @args );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    elsif ( $cmd eq 'tempEco' ) {
 | 
					    elsif ( $cmd eq 'tempEco' ) {
 | 
				
			||||||
@@ -433,7 +433,7 @@ sub Set($$@) {
 | 
				
			|||||||
          if ( $args[0] < 12.0 or $args[0] > 23.0 );
 | 
					          if ( $args[0] < 12.0 or $args[0] > 23.0 );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $handle = $gatttChar{ AttrVal( $name, 'model', '' ) }{'payload'};
 | 
					        $handle = $gatttChar{ AttrVal( $name, 'model', '' ) }{'payload'};
 | 
				
			||||||
        $value = join( " ", @args );
 | 
					        $value = join( ' ', @args );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    elsif ( $cmd eq 'tempComfort' ) {
 | 
					    elsif ( $cmd eq 'tempComfort' ) {
 | 
				
			||||||
@@ -445,7 +445,7 @@ sub Set($$@) {
 | 
				
			|||||||
          if ( $args[0] < 12.0 or $args[0] > 23.0 );
 | 
					          if ( $args[0] < 12.0 or $args[0] > 23.0 );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $handle = $gatttChar{ AttrVal( $name, 'model', '' ) }{'payload'};
 | 
					        $handle = $gatttChar{ AttrVal( $name, 'model', '' ) }{'payload'};
 | 
				
			||||||
        $value = join( " ", @args );
 | 
					        $value = join( ' ', @args );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    elsif ( $cmd eq 'tempOffset' ) {
 | 
					    elsif ( $cmd eq 'tempOffset' ) {
 | 
				
			||||||
@@ -455,7 +455,7 @@ sub Set($$@) {
 | 
				
			|||||||
          if ( $args[0] < -5.0 or $args[0] > 5.0 );
 | 
					          if ( $args[0] < -5.0 or $args[0] > 5.0 );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $handle = $gatttChar{ AttrVal( $name, 'model', '' ) }{'payload'};
 | 
					        $handle = $gatttChar{ AttrVal( $name, 'model', '' ) }{'payload'};
 | 
				
			||||||
        $value = join( " ", @args );
 | 
					        $value = join( ' ', @args );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    elsif ( $cmd eq 'winOpnSensitivity' ) {
 | 
					    elsif ( $cmd eq 'winOpnSensitivity' ) {
 | 
				
			||||||
@@ -464,7 +464,7 @@ sub Set($$@) {
 | 
				
			|||||||
          if ( @args != 1 );
 | 
					          if ( @args != 1 );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $handle = $gatttChar{ AttrVal( $name, 'model', '' ) }{'payload'};
 | 
					        $handle = $gatttChar{ AttrVal( $name, 'model', '' ) }{'payload'};
 | 
				
			||||||
        $value = join( " ", @args );
 | 
					        $value = join( ' ', @args );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    elsif ( $cmd eq 'winOpnPeriod' ) {
 | 
					    elsif ( $cmd eq 'winOpnPeriod' ) {
 | 
				
			||||||
@@ -473,7 +473,7 @@ sub Set($$@) {
 | 
				
			|||||||
          if ( @args != 1 );
 | 
					          if ( @args != 1 );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $handle = $gatttChar{ AttrVal( $name, 'model', '' ) }{'payload'};
 | 
					        $handle = $gatttChar{ AttrVal( $name, 'model', '' ) }{'payload'};
 | 
				
			||||||
        $value = join( " ", @args );
 | 
					        $value = join( ' ', @args );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    elsif ( $cmd eq 'resetBatteryTimestamp' ) {
 | 
					    elsif ( $cmd eq 'resetBatteryTimestamp' ) {
 | 
				
			||||||
@@ -482,6 +482,14 @@ sub Set($$@) {
 | 
				
			|||||||
        $hash->{helper}{updateTimeCallBattery} = 0;
 | 
					        $hash->{helper}{updateTimeCallBattery} = 0;
 | 
				
			||||||
        return;
 | 
					        return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    elsif ( $cmd eq 'mode' ) {
 | 
				
			||||||
 | 
					        return "usage: mode value" if ( @args != 1 );
 | 
				
			||||||
 | 
					        Log3 $name, 2,
 | 
				
			||||||
 | 
					      'CometBlueBTLE ($name) - set mit Value: ' . join( ' ', @args );
 | 
				
			||||||
 | 
					        readingsSingleUpdate($hash,'mode',join( ' ', @args ),0);
 | 
				
			||||||
 | 
					        return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    else {
 | 
					    else {
 | 
				
			||||||
        my $list =
 | 
					        my $list =
 | 
				
			||||||
@@ -493,7 +501,7 @@ sub Set($$@) {
 | 
				
			|||||||
        $list .=
 | 
					        $list .=
 | 
				
			||||||
" tempComfort:12.0,12.5,13.0,13.5,14.0,14.5,15.0,15.5,16.0,16.5,17.0,17.5,18.0,18.5,19.0,19.5,20.0,20.5,21.0,21.5,22.0,22.5,23.0";
 | 
					" tempComfort:12.0,12.5,13.0,13.5,14.0,14.5,15.0,15.5,16.0,16.5,17.0,17.5,18.0,18.5,19.0,19.5,20.0,20.5,21.0,21.5,22.0,22.5,23.0";
 | 
				
			||||||
        $list .=
 | 
					        $list .=
 | 
				
			||||||
" tempOffset:-5,-4.5,-4,-3.5,-3,-2.5,-2,-1.5,-1,-0.5,0,0.5,1,1.5,2,2.5,3,3.5,4,4.5,5 winOpnSensitivity:high,medium,low winOpnPeriod:slider,5,5,30 resetBatteryTimestamp:noArg";
 | 
					" tempOffset:-5,-4.5,-4,-3.5,-3,-2.5,-2,-1.5,-1,-0.5,0,0.5,1,1.5,2,2.5,3,3.5,4,4.5,5 mode:manual,auto winOpnSensitivity:high,medium,low winOpnPeriod:slider,5,5,30 resetBatteryTimestamp:noArg";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return "Unknown argument $cmd, choose one of $list";
 | 
					        return "Unknown argument $cmd, choose one of $list";
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -1019,7 +1027,7 @@ sub HandlePayload($$) {
 | 
				
			|||||||
#     04 = Fenster offen Detektor
 | 
					#     04 = Fenster offen Detektor
 | 
				
			||||||
#     0a= Zeit Fenster offen in Minuten
 | 
					#     0a= Zeit Fenster offen in Minuten
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    $readings{'measured-temp'} = hex( "0x" . $payload[0] ) / 2;
 | 
					    $readings{'measured-temp'} = sprintf( "%.1f",hex( "0x" . $payload[0] ) / 2);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if ( hex( "0x" . $payload[1] ) / 2 == 7.5 ) {
 | 
					    if ( hex( "0x" . $payload[1] ) / 2 == 7.5 ) {
 | 
				
			||||||
        $readings{'desired-temp'} = 'off';
 | 
					        $readings{'desired-temp'} = 'off';
 | 
				
			||||||
@@ -1028,17 +1036,17 @@ sub HandlePayload($$) {
 | 
				
			|||||||
        $readings{'desired-temp'} = 'on';
 | 
					        $readings{'desired-temp'} = 'on';
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    else {
 | 
					    else {
 | 
				
			||||||
        $readings{'desired-temp'} = hex( "0x" . $payload[1] ) / 2;
 | 
					        $readings{'desired-temp'} = sprintf( "%.1f",hex( "0x" . $payload[1] ) / 2);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    $readings{'tempEco'}     = hex( "0x" . $payload[2] ) / 2;
 | 
					    $readings{'tempEco'}     = sprintf( "%.1f",hex( "0x" . $payload[2] ) / 2);
 | 
				
			||||||
    $readings{'tempComfort'} = hex( "0x" . $payload[3] ) / 2;
 | 
					    $readings{'tempComfort'} = sprintf( "%.1f",hex( "0x" . $payload[3] ) / 2);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if ( $payload[4] =~ /^f/ ) {
 | 
					    if ( $payload[4] =~ /^f/ ) {
 | 
				
			||||||
        $readings{'tempOffset'} = ( hex( "0x" . $payload[4] ) / 2 ) - 128;
 | 
					        $readings{'tempOffset'} = ( sprintf( "%.1f",hex( "0x" . $payload[4] ) / 2) ) - 128;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    else {
 | 
					    else {
 | 
				
			||||||
        $readings{'tempOffset'} = hex( "0x" . $payload[4] ) / 2;
 | 
					        $readings{'tempOffset'} = sprintf( "%.1f",hex( "0x" . $payload[4] ) / 2);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    $readings{'winOpnSensitivity'} =
 | 
					    $readings{'winOpnSensitivity'} =
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user