Hi zusammen,
wollte nur kurz verkünden, dass mein KM200 installiert ist und einwandfrei läuft
Danke nochmal! Auslesen der Werte klappt, Schreiben ebenso.
Lediglich einen kleinen kosmetischen Fehler habe ich noch:
Ich nutze das Auslese-Skript von Slash, das alle Services rekursiv durchgeht:
<?
include_once( "47441.ips.php" ); // KM200 Gateway
$RootCategoryID = 0;
$km200_REST_URLs = array(
'/gateway',
'/system',
'/heatingCircuits',
'/solarCircuits',
'/heatSources',
);
function CreateCategory( $Name, $Ident = '', $ParentID = 0 )
{
global $RootCategoryID;
echo "CreateCategory: ( $Name, $Ident, $ParentID )
";
if ( '' != $Ident )
{
$CatID = @IPS_GetObjectIDByIdent( $Ident, $ParentID );
if ( false !== $CatID )
{
$Obj = IPS_GetObject( $CatID );
if ( 0 == $Obj['ObjectType'] ) // is category?
return $CatID;
}
}
$CatID = IPS_CreateCategory();
IPS_SetName( $CatID, $Name );
IPS_SetIdent( $CatID, $Ident );
if ( 0 == $ParentID )
if ( IPS_ObjectExists( $RootCategoryID ) )
$ParentID = $RootCategoryID;
IPS_SetParent( $CatID, $ParentID );
return $CatID;
}
function SetVariable( $VarID, $Type, $Value )
{
switch( $Type )
{
case 0: // boolean
SetValueBoolean( $VarID, $Value );
break;
case 1: // integer
SetValueInteger( $VarID, $Value );
break;
case 2: // float
SetValueFloat( $VarID, $Value );
break;
case 3: // string
SetValueString( $VarID, $Value );
break;
}
}
function CreateVariable( $Name, $Type, $Value, $Ident = '', $ParentID = 0 )
{
echo "CreateVariable: ( $Name, $Type, $Value, $Ident, $ParentID )
";
if ( '' != $Ident )
{
$VarID = @IPS_GetObjectIDByIdent( $Ident, $ParentID );
if ( false !== $VarID )
{
SetVariable( $VarID, $Type, $Value );
return;
}
}
$VarID = @IPS_GetObjectIDByName( $Name, $ParentID );
if ( false !== $VarID ) // exists?
{
$Obj = IPS_GetObject( $VarID );
if ( 2 == $Obj['ObjectType'] ) // is variable?
{
$Var = IPS_GetVariable( $VarID );
if ( $Type == $Var['VariableValue']['ValueType'] )
{
SetVariable( $VarID, $Type, $Value );
return;
}
}
}
$VarID = IPS_CreateVariable( $Type );
IPS_SetParent( $VarID, $ParentID );
IPS_SetName( $VarID, $Name );
if ( '' != $Ident )
IPS_SetIdent( $VarID, $Ident );
SetVariable( $VarID, $Type, $Value );
}
function Traverse_REST_URL( $REST_Service, $ParentID = 0 )
{
$Name = $REST_Service;
$REST_Obj = km200_GetData( $REST_Service );
if( NULL == $REST_Obj )
{
echo "Service $REST_Service returned NULL
";
return;
}
$Ident = str_replace( '/', '0', $REST_Obj->id );
if ( property_exists( $REST_Obj, 'writeable' ) )
if( 0 !== $REST_Obj->writeable )
$Name .= " (writeable)";
if ( property_exists( $REST_Obj, 'recordable' ) )
if( 0 !== $REST_Obj->writeable )
$Name .= " (recordable)";
switch( $REST_Obj->type )
{
case 'refEnum':
// create category
$CatID = CreateCategory( $Name, $Ident, $ParentID );
// loop through enum array
foreach( $REST_Obj->references as $SubService )
Traverse_REST_URL( $SubService->id, $CatID ); // recurse
break;
case 'moduleList':
// create category
$CatID = CreateCategory( $Name, $Ident, $ParentID );
// loop through values array
foreach( $REST_Obj->values as $Modules )
CreateVariable( $Modules->Name, 3, $Modules->Version, $Ident . "0" . $Modules->Token, $CatID );
break;
case 'floatValue':
CreateVariable( $Name, 2, $REST_Obj->value, $Ident, $ParentID );
break;
case 'stringValue':
CreateVariable( $Name, 3, $REST_Obj->value, $Ident, $ParentID );
break;
case 'switchProgram':
CreateVariable( $Name, 3, "switchProgram, toDo!", $Ident, $ParentID );
break;
default:
echo "$Name ist Typ $REST_Obj->type !
";
CreateVariable( $Name + $REST_Obj->type, 3, (string) $REST_Obj->value, $Ident, $ParentID );
break;
}
}
foreach( $km200_REST_URLs as $REST_Service )
Traverse_REST_URL( $REST_Service, $RootCategoryID )
?>
Dieses Skript wird mir beim Ausführen immer als „fehlerhaft“ markiert. Ich sehe in der Skriptausgabe aber nicht, warum bzw. wo da ein Fehler ist?
CreateCategory: ( /gateway, 0gateway, 36519 )
CreateVariable: ( /gateway/uuid, 3, zensiert, 0gateway0uuid, 53994 )
Service /gateway/firmware returned NULL
Service /gateway/userpassword returned NULL
CreateVariable: ( /gateway/instAccess (writeable) (recordable), 3, off, 0gateway0instAccess, 53994 )
Service /gateway/instPassword returned NULL
CreateVariable: ( /gateway/instWriteAccess (writeable) (recordable), 3, off, 0gateway0instWriteAccess, 53994 )
CreateVariable: ( /gateway/versionFirmware, 3, 01.09.04, 0gateway0versionFirmware, 53994 )
CreateVariable: ( /gateway/versionHardware, 3, iCom_Low_v1, 0gateway0versionHardware, 53994 )
CreateVariable: ( /gateway/DateTime (writeable) (recordable), 3, 2014-10-27T10:49:32, 0gateway0DateTime, 53994 )
CreateCategory: ( /system, 0system, 36519 )
CreateVariable: ( /system/brand, 3, Buderus, 0system0brand, 17818 )
CreateVariable: ( /system/bus, 3, EMS1_0, 0system0bus, 17818 )
CreateVariable: ( /system/systemType, 3, CoreIcomGw, 0system0systemType, 17818 )
CreateCategory: ( /system/sensors, 0system0sensors, 17818 )
CreateCategory: ( /system/sensors/temperatures, 0system0sensors0temperatures, 10373 )
CreateVariable: ( /system/sensors/temperatures/outdoor_t1, 2, 13.8, 0system0sensors0temperatures0outdoor_t1, 11820 )
CreateVariable: ( /system/sensors/temperatures/supply_t1_setpoint, 2, 40, 0system0sensors0temperatures0supply_t1_setpoint, 11820 )
CreateVariable: ( /system/sensors/temperatures/supply_t1, 2, 46.6, 0system0sensors0temperatures0supply_t1, 11820 )
CreateVariable: ( /system/sensors/temperatures/hotWater_t1, 2, -3200, 0system0sensors0temperatures0hotWater_t1, 11820 )
CreateVariable: ( /system/sensors/temperatures/hotWater_t2, 2, 3200, 0system0sensors0temperatures0hotWater_t2, 11820 )
CreateVariable: ( /system/sensors/temperatures/return, 2, -3276.8, 0system0sensors0temperatures0return, 11820 )
CreateVariable: ( /system/sensors/temperatures/switch, 2, 0, 0system0sensors0temperatures0switch, 11820 )
CreateVariable: ( /system/sensors/temperatures/chimney, 2, -3200, 0system0sensors0temperatures0chimney, 11820 )
CreateVariable: ( /system/healthStatus, 3, ok, 0system0healthStatus, 17818 )
CreateCategory: ( /system/appliance, 0system0appliance, 17818 )
CreateVariable: ( /system/appliance/type, 3, OilBoiler, 0system0appliance0type, 56828 )
CreateVariable: ( /system/appliance/powerSetpoint, 2, 100, 0system0appliance0powerSetpoint, 56828 )
CreateVariable: ( /system/appliance/actualPower, 2, 0, 0system0appliance0actualPower, 56828 )
CreateVariable: ( /system/appliance/CHpumpModulation, 2, 100, 0system0appliance0CHpumpModulation, 56828 )
CreateVariable: ( /system/appliance/numberOfStarts, 2, 49626, 0system0appliance0numberOfStarts, 56828 )
CreateVariable: ( /system/appliance/gasAirPressure, 2, -0.1, 0system0appliance0gasAirPressure, 56828 )
CreateVariable: ( /system/appliance/systemPressure, 2, 25.5, 0system0appliance0systemPressure, 56828 )
Service /system/appliance/flameCurrent returned NULL
CreateVariable: ( /system/appliance/fanSpeed_setpoint, 2, 0, 0system0appliance0fanSpeed_setpoint, 56828 )
CreateVariable: ( /system/appliance/fanSpeed, 2, 0, 0system0appliance0fanSpeed, 56828 )
CreateCategory: ( /system/appliance/workingTime, 0system0appliance0workingTime, 56828 )
CreateVariable: ( /system/appliance/workingTime/totalSystem, 2, 303560, 0system0appliance0workingTime0totalSystem, 45863 )
CreateVariable: ( /system/appliance/workingTime/secondBurner, 2, 0, 0system0appliance0workingTime0secondBurner, 45863 )
CreateVariable: ( /system/appliance/workingTime/centralHeating, 2, 225941, 0system0appliance0workingTime0centralHeating, 45863 )
CreateVariable: ( /system/appliance/nominalBurnerLoad, 2, 0, 0system0appliance0nominalBurnerLoad, 56828 )
CreateCategory: ( /heatingCircuits, 0heatingCircuits, 36519 )
CreateCategory: ( /heatingCircuits/hc1, 0heatingCircuits0hc1, 32204 )
CreateVariable: ( /heatingCircuits/hc1/operationMode (writeable) (recordable), 3, day, 0heatingCircuits0hc10operationMode, 34719 )
CreateVariable: ( /heatingCircuits/hc1/temperatureRoomSetpoint (writeable) (recordable), 2, 21, 0heatingCircuits0hc10temperatureRoomSetpoint, 34719 )
CreateVariable: ( /heatingCircuits/hc1/roomtemperature, 2, 3200, 0heatingCircuits0hc10roomtemperature, 34719 )
Service /heatingCircuits/hc1/designTemp returned NULL
Service /heatingCircuits/hc1/designTemp returned NULL
Service /heatingCircuits/hc1/currentOpModeInfo returned NULL
Service /heatingCircuits/hc1/heatCurveMax returned NULL
Service /heatingCircuits/hc1/heatCurveMax returned NULL
Service /heatingCircuits/hc1/controlType returned NULL
Service /heatingCircuits/hc1/roomInfluence returned NULL
Service /heatingCircuits/hc1/roomTempOffset returned NULL
Service /heatingCircuits/hc1/setpointOptimization returned NULL
Service /heatingCircuits/hc1/suWiThreshold returned NULL
CreateVariable: ( /heatingCircuits/hc1/activeSwitchProgram (writeable) (recordable), 3, Single, 0heatingCircuits0hc10activeSwitchProgram, 34719 )
CreateCategory: ( /heatingCircuits/hc1/switchPrograms, 0heatingCircuits0hc10switchPrograms, 34719 )
CreateVariable: ( /heatingCircuits/hc1/switchPrograms/Eigen1 (writeable), 3, switchProgram, toDo!, 0heatingCircuits0hc10switchPrograms0Eigen1, 50799 )
CreateVariable: ( /heatingCircuits/hc1/switchPrograms/Familie, 3, switchProgram, toDo!, 0heatingCircuits0hc10switchPrograms0Familie, 50799 )
CreateVariable: ( /heatingCircuits/hc1/switchPrograms/Morgen, 3, switchProgram, toDo!, 0heatingCircuits0hc10switchPrograms0Morgen, 50799 )
CreateVariable: ( /heatingCircuits/hc1/switchPrograms/Abend, 3, switchProgram, toDo!, 0heatingCircuits0hc10switchPrograms0Abend, 50799 )
CreateVariable: ( /heatingCircuits/hc1/switchPrograms/Vormittag, 3, switchProgram, toDo!, 0heatingCircuits0hc10switchPrograms0Vormittag, 50799 )
CreateVariable: ( /heatingCircuits/hc1/switchPrograms/Nachmittag, 3, switchProgram, toDo!, 0heatingCircuits0hc10switchPrograms0Nachmittag, 50799 )
CreateVariable: ( /heatingCircuits/hc1/switchPrograms/Mittag, 3, switchProgram, toDo!, 0heatingCircuits0hc10switchPrograms0Mittag, 50799 )
CreateVariable: ( /heatingCircuits/hc1/switchPrograms/Single, 3, switchProgram, toDo!, 0heatingCircuits0hc10switchPrograms0Single, 50799 )
CreateVariable: ( /heatingCircuits/hc1/switchPrograms/Senioren, 3, switchProgram, toDo!, 0heatingCircuits0hc10switchPrograms0Senioren, 50799 )
CreateCategory: ( /heatingCircuits/hc1/temperatureLevels, 0heatingCircuits0hc10temperatureLevels, 34719 )
CreateVariable: ( /heatingCircuits/hc1/temperatureLevels/night (writeable) (recordable), 2, 14.5, 0heatingCircuits0hc10temperatureLevels0night, 55850 )
CreateVariable: ( /heatingCircuits/hc1/temperatureLevels/day (writeable) (recordable), 2, 21, 0heatingCircuits0hc10temperatureLevels0day, 55850 )
CreateVariable: ( /heatingCircuits/hc1/status, 3, ACTIVE, 0heatingCircuits0hc10status, 34719 )
CreateCategory: ( /heatingCircuits/hc2, 0heatingCircuits0hc2, 32204 )
CreateVariable: ( /heatingCircuits/hc2/operationMode (writeable) (recordable), 3, auto, 0heatingCircuits0hc20operationMode, 16526 )
CreateVariable: ( /heatingCircuits/hc2/temperatureRoomSetpoint (writeable) (recordable), 2, 0, 0heatingCircuits0hc20temperatureRoomSetpoint, 16526 )
CreateVariable: ( /heatingCircuits/hc2/roomtemperature, 2, 0, 0heatingCircuits0hc20roomtemperature, 16526 )
Service /heatingCircuits/hc2/currentOpModeInfo returned NULL
Service /heatingCircuits/hc2/controlType returned NULL
Service /heatingCircuits/hc2/roomInfluence returned NULL
Service /heatingCircuits/hc2/roomTempOffset returned NULL
Service /heatingCircuits/hc2/setpointOptimization returned NULL
Service /heatingCircuits/hc2/suWiThreshold returned NULL
CreateVariable: ( /heatingCircuits/hc2/pumpModulation, 2, 0, 0heatingCircuits0hc20pumpModulation, 16526 )
CreateVariable: ( /heatingCircuits/hc2/activeSwitchProgram (writeable) (recordable), 3, Familie, 0heatingCircuits0hc20activeSwitchProgram, 16526 )
CreateCategory: ( /heatingCircuits/hc2/switchPrograms, 0heatingCircuits0hc20switchPrograms, 16526 )
CreateVariable: ( /heatingCircuits/hc2/switchPrograms/Eigen1 (writeable), 3, switchProgram, toDo!, 0heatingCircuits0hc20switchPrograms0Eigen1, 58053 )
CreateVariable: ( /heatingCircuits/hc2/switchPrograms/Familie, 3, switchProgram, toDo!, 0heatingCircuits0hc20switchPrograms0Familie, 58053 )
CreateVariable: ( /heatingCircuits/hc2/switchPrograms/Morgen, 3, switchProgram, toDo!, 0heatingCircuits0hc20switchPrograms0Morgen, 58053 )
CreateVariable: ( /heatingCircuits/hc2/switchPrograms/Abend, 3, switchProgram, toDo!, 0heatingCircuits0hc20switchPrograms0Abend, 58053 )
CreateVariable: ( /heatingCircuits/hc2/switchPrograms/Vormittag, 3, switchProgram, toDo!, 0heatingCircuits0hc20switchPrograms0Vormittag, 58053 )
CreateVariable: ( /heatingCircuits/hc2/switchPrograms/Nachmittag, 3, switchProgram, toDo!, 0heatingCircuits0hc20switchPrograms0Nachmittag, 58053 )
CreateVariable: ( /heatingCircuits/hc2/switchPrograms/Mittag, 3, switchProgram, toDo!, 0heatingCircuits0hc20switchPrograms0Mittag, 58053 )
CreateVariable: ( /heatingCircuits/hc2/switchPrograms/Single, 3, switchProgram, toDo!, 0heatingCircuits0hc20switchPrograms0Single, 58053 )
CreateVariable: ( /heatingCircuits/hc2/switchPrograms/Senioren, 3, switchProgram, toDo!, 0heatingCircuits0hc20switchPrograms0Senioren, 58053 )
CreateCategory: ( /heatingCircuits/hc2/temperatureLevels, 0heatingCircuits0hc20temperatureLevels, 16526 )
CreateVariable: ( /heatingCircuits/hc2/temperatureLevels/night (writeable) (recordable), 2, 17, 0heatingCircuits0hc20temperatureLevels0night, 33512 )
CreateVariable: ( /heatingCircuits/hc2/temperatureLevels/day (writeable) (recordable), 2, 21, 0heatingCircuits0hc20temperatureLevels0day, 33512 )
CreateVariable: ( /heatingCircuits/hc2/status, 3, INACTIVE, 0heatingCircuits0hc20status, 16526 )
CreateCategory: ( /heatingCircuits/hc3, 0heatingCircuits0hc3, 32204 )
Service /heatingCircuits/hc3/operationMode returned NULL