FS20 Einbindung:
1.) Im File IPSWatering_Constants.ips.php einen zusätzlichen DeviceType FS20 anlegen.
PHP-Code:
define ("c_Type_Homematic", 'Homematic');
define ("c_Type_FS20", 'FS20');
2.) Im File IPSWatering_Control.ips.php die FS20 Ansteuerung implementieren.
a.) in der bestehenden Funktion "IPSWatering_ActivateWatering" den neuen DeviceType behandeln.
PHP-Code:
// ----------------------------------------------------------------------------------------------------------------------------
function IPSWatering_ActivateWatering($CycleId, $Value) {
$WaterConfig = get_WateringConfiguration();
$CircleName = IPS_GetName($CycleId);
$DeviceType = $WaterConfig[$CircleName][c_Property_Type];
$DevicePath = $WaterConfig[$CircleName][c_Property_Device];
switch($DeviceType) {
case c_Type_Homematic:
IPSWatering_ActivateWateringHomematic($DevicePath, $Value);
break;
case c_Type_FS20:
IPSWatering_ActivateWateringFS20($DevicePath, $Value);
break;
default:
IPSLogger_Err(__file__, "Unknown DeviceType '$DeviceType' for Watering of Circle '$CircleName'");
exit;
}
}
b.) die eingentliche Schaltfunktion "IPSWatering_ActivateWateringFS20" implementieren
PHP-Code:
// ----------------------------------------------------------------------------------------------------------------------------
function IPSWatering_ActivateWateringFS20($DevicePath, $Value) {
$DeviceId = get_ObjectIDByPath($DevicePath);
IPSLogger_Dbg(__file__, "Set '$DevicePath.Status'=".($Value?'true':'false'));
if ($DeviceId===false){
IPSLogger_Wrn(__file__, "Device $DevicePath could NOT be found to activate Watering");
return;
}
FS20_SwitchMode($DeviceId, $Value);
}
3.) Konfiguration anpassen
PHP-Code:
"Rasen Hinten" => array(
c_Property_Type => c_Type_FS20,
c_Property_Device => 'Hardware.FS20',
c_Property_Sensor => '',
),
Bitte um Rückmeldung, falls es wer praktisch verifizieren konnte, dann werd ich es in die Scripts einpflegen
lg
Andreas