Home

FCINT Smart Building Controller User Manual

image

Contents

1. a Logs for selection from 13 03 2013 to 13 03 2013 Get alarm logs m AD Device Service Triaoered by Status Date Hour Modifv State Schedule Lae A Active Alarms x 2 1002 A 3 Fal 1003 WiFI Name Device Trigger Actio Status Time Acknowledge 4 F 1004 Lig 1211004 Out of Service Lights OutOfService True Active Unack 3600 ack l ia m 1005 WIFir 6 m 1006 WIFI T fm aan aan anisnanmn a r a inen aman anen sa an rall Woe e Figure xxx The active alarms Visualizing alarms in the Alarms section The section for alarms in the web application allows e viewing all alarms e viewing the active alarms e enabling disabling an alarm by pressing the Activate Deactivate buttons in the right of each alarm The data displayed for an alarm are e the alarm id e the alarm name e the device or service to which the alarm is applied e the events triggering the alarm e the alarm status active inactive acknowledged or not ack unack the state of ack unack can be changed only from Alarms Configurator e the date and the hour of last change Attaching a schedule to an alarm When an alarm e g 1211991 Out of Service applied to AC1 an air conditioner from the below figure has no schedule attached to it its corresponding button in the Schedule column is labeled Create When an alarm e g Windows2 in the
2. Schedule specification and execution Schedules specify time based rules for the functionality of one or more devices controlled by a web service Schedules are object associated to one or more Services listed in the Services folder Devices in the current active environment Groups of devices listed in the groups folder Schedules are defined by An Effective period a calendar date interval for which the schedule applies Example feb 1 2010 April 14 2012 A regular Weekly Schedule defined for each day of the week Monday Sunday An Exception Schedule which applies to a set of particular dates Example on Christmas day December 25 all lights turn on at 22 00 PM or on New Year s Eve December 31 all lights should automatically turn off at 1 PM because the familiy is leaving for a vacation ASchedule_Default action that is executed every day at midnight One or more status flags out of which the most relevant flag is the OutOfService flag When set to true the schedule is disabled otherwise if it is false the schedule is enabled Schedules are specified in XML files and should be stored in the Schedules folder of the SBC which is checked for updates by the SBC every 2 seconds Once a new schedule is added it is automatically registered for execution by the SBC Once an existing schedule is modified it is automatically re loaded by the SBC Once an existing schedule is deleted it is
3. e attach a schedule to each policy by clicking Create button next to it e POLICIES Hide All Policies Current Policies ID Name Last modified State View Schedule 1 6 Policy01 12 03 2013 08 08 01 Disable Create Page 1 of 1 20 View 1 1 of 1 Display of current policies Once the button is pressed one can see the content of a policy e the name of the policy e the date of last change e the policy rules for example in the below figure we have only one rule for M001 policy with the following clauses Interval On If Then the Else clause being null The rules clauses are the Interval field indicates the duration in milliseconds between two successive evaluation of the condition stated in the rule the On field indicates whether the rule is activated by an event or not if the last situation applies the rule is continue the If field describes the condition to activate the rule e g for the rule in the figure below the condition is that all the windows should be closed the field Then describes what happens when the condition is true e g when all the windows are closed we check a new condition in conclusion the policies can contain nested verifications the new condition consists in checking the outside and the inside temperature the state of the air conditioning machine if the outside temperature is lower than 17 degrees and the insid
4. f the environmentID does not match either the currently selected EID nor any of its descendants the method will return lt error gt Invalid environment ID Please use the currently selected EID X or one of its descendants lt error gt where X is the currently selected EID in the environment so environment ID should match X or any of its descendants as returned in the GUI e f the devicelD does not match the id of any device in the environment environmentID the following error message is returned lt error gt Invalid device ID lt error gt If the connection to the local database service fails the SBC will issue an error of the form lt error gt Error connecting to the local database service lt error gt ListenForEvents Listens for incoming events from the services wrapper layer Start a separate Event thread before using this function Example below Event Thread while true string response ListenForEvents user123128adsasbasvd EF307 all 10 Waits for any event from the EF307 environment within a period of 10 seconds returns time out if no event occured within the 10 second window or lt events count 10 gt lt xml serialized event 1 gt lt event 10 gt lt events gt Parse events here if response time out ControlDevice Sends a high level command to a device NOTE THIS IS THE MOST IMPORTANT METHOD OF THE SBC Template string sessionID client D
5. if C4 then try P4 catch A4 else A4 The XML format for specifying rules is given in the example below E ComplexPolicy xml Notepad File Edit Format View Help lt xml version 1 0 gt lt policy name Policyl gt lt rule name EventRulel gt lt on gt SmokeOff lt on gt lt if gt message building EqualsC Building 1 lt if gt lt then gt L Air_condition_1 Stop_Ac C off lt then gt lt else gt lt else gt lt rule gt lt rule name EventRu leL gt lt on gt true lt on gt lt if gt 2 gt 1 lt if gt lt then gt LLAir_condition_1 Stop_Ac C off lt then gt lt else gt lt else gt lt rule gt lt policy gt Figure 15 Sample policy 1 using System 2 using System Net 3 using System Diagnostics 4 using System Net Sockets using System Xml 6 using System Xml Serialization using System IO 8 using System Text using System Activities using FCINT using VoiceRecoEvents using VSmokeDetectorEvents NO wo 4 namespace SmartBuildingController ts At L6 public class EventSink a gi L8 public void HandleSpeechReco VoiceRecoEvents SpeechReco message fo je 2 Console WriteLine Received SpeechReco 0 message F 23 public void HandleSmokeOn VSmokeDetectorEvents SmokeOn message 24 H 25 Console WriteLine Received SmokeOn 0 message 26 iF 8 public void HandleSmokeOff VSmoke
6. string ControlDeviceHL string sessionID int environmentID int deviceID int highLevelFunctionID string parameters OperationContract lt summary gt Gets the status of one or more devices in the environment lt summary gt lt param name sessionID gt A valid session ID identifying the caller lt param gt lt param name environmentID gt the ID of the environment being monitored lt param gt lt param name deviceID gt the ID of the device being monitored lt param gt lt returns gt lt error gt Error description lt error gt or the device s status as XML document matching the XSD schema for the Device object type at http www fcint ro portal xsd Device xsd lt param gt string GetDeviceStatus string sessionID int environmentID int deviceID string SaveSchedule string nume string continut bool ovewrite care sa intoarca lt ok gt daca s a salvat cu succes lt error gt eroare lt error gt in caz contrar Mai exact daca overwrite false atunci poate sa intoarca lt error gt Schedule already exists Please use overwrite true lt error gt Daca se apeleaza din nou cu overwrite true atunci schedule ul se suprascrie pe disc alta eroare in caz contrar OperationContract string SaveSchedule string nume string continut bool overwrite OperationContract string LoadSchedule long EID string numeSchedule intoarce continutul unui schedule conform XSD ului de schedule pent
7. GTE lt LTE gt GT lt LT EQ amp amp AND OR CurrentHour double Hour CurrentMinute double Minute CurrentSecond double Second E double int bool Type For the translation to be more visible below is the xml file that contains the policy M001 lt xml version 1 0 gt lt policy name M001 gt lt rule name Rule00 runEveryMs 30000 gt lt on gt lt CDATA true gt lt on gt lt if gt lt CDATA Windows Window01 bool false amp amp Windows Window02 bool false amp amp Windows Window03 bool false amp amp Windows Window04 bool false gt lt if gt lt then gt lt CDATA if WiFl_outside Temperature double lt 17 amp amp WIFlnode1 Temperature double lt 22 amp amp AC1 state double 0 AC1 SetMultipleDeviceState state mode temperature 1 3 30 gt lt then gt lt else gt lt CDATA gt lt else gt lt rule gt lt policy gt The translation from XML using the dictionary is made by SBC Therefore the Web application get a policy in natural language Attaching a schedule to a policy When a policy e g M001 is not attached to any running schedule its corresponding button in the column Schedule is labeled with Create as shown in the below figure When a policy e g SP1 has attached a running schedule its corresponding button in the column Schedule is labeled with Edit Al
8. IDandName 1224012 Schedule for policy M001 Validity from 12 03 2013 to 12 03 2013 Default action Applies To 4 Every Tuesday Start time Action Del selected ll Add Action Apply to other Date s gt Alldates Save schedule l Apply to j Creating a schedule for a policy After saving an action we can see all the actions that form a functioning program schedule For example M001 policy for which we have created a program respects the following rules of operation every Tuesday at 3 it is turned on and at 5 01 it is turned off Edit Action Select action for device Device Parameters elect desired parameter values and click SEND to set the device ACTIVATE l ACTIVATE DEACTIVATE Creating a schedule action for a policy Every Tuesday Start time Action 4 1 03 00 00 Policy State ACTIVATE 2 05 01 00 Policy State DEACTIVATE Viewing the content of a policy schedule Attaching a policy schedule can only applies to policies for which the current user has rights e g in the Configurator window the user Maria has rights to all policies except for one entitled PC_Natalia_ECO_Policy surrounded by red which is not visible in the Web application Moreover the policy SP1 has a schedule P SP1 both elements being visible to the user maria but if the user did not have rights for the policy he she would not have rights for the polic
9. If more than one argument is needed by the high level function the arguments are separated by commas Example AC1 SetMode lonization false Temperature 3 NOTE If more than two parameters are needed but they are not specified in the function call they are read and automatically filled in from the database SBC Behaviour to changes in the Schedules file system The Smart Building Controller will react to the following changes to the schedules folder The addition of a new schedule file The deletion of a schedule file The modification of a schedule file In each case the SBC will output a message specifying that a specific schedule has been added for execution deleted from memory since it has been erased from disk or re loaded from disk after a modification These features allow the continuous operation of the SBC while the user manages the working schedules SBC Behaviour at midnight At midnight for every schedule that is applicable to the current day if the schedule has a Schedule_Default action specified according to the SBC calling convention the SBC will execute that action at 00 00 00 or within the first minute of the day depending on the workload of the CPU there may be a slight delay after midnight if a large continuous policy must be checked or if a large number of schedules need to be executed Policy specification and execution A policy is a set of rules which specifies What rules should be con
10. a One subfolder for each installed service instance bearing the name of the service instance 11 b A lights service specified only by its WSDL file 11 c A Voice recognition service fully specified by a WCF MEX binary no WSDL file specified 11 d A reference to an external WCF service VirtualSmokeDetector specified only by the service s WCF MEX URL Event Handling in the Smart Building Controller Event handling is performed by using the following mechanism the Smart Building Controller listens on the TCP port 2000 for incoming events events are sent by services to the SBC in XML serialized form the SBC executes user defined policies for each type of event specified in the policy files Events are broadcasted to all listening SBC clients UI programs in XML serialized form A complete example on specifying event types is given below for the VoiceRecoEvents DLL assembly illustrated in figure 9 In this example a SpeechReco event is defined for a speech recognition WCF service which sends SpeechReco events to the SBC as the user speaks using System using System Collections Generic using System Net using System using System Net Sockets using System Xml Serialization using System Xml using System Text using System IO namespace VoiceRecoEvents Serializable public class SpeechReco public string speech public SpeechReco speech public SpeechReco string s this speech s publ
11. automatically removed from execution by the SBC NOTE As with the Service Calling convention the name of the service associated with the schedule is case sensitive Th associated service should exist in the Services folder NOTE All schedule objects must be formatted according to http fcint ro portal xsd Schedule XSD Figure 13 specifies a sample list of schedules registered into the SBC Figure 14 presents a sample schedule r gt Local Disk C Debug Schedules gt X 4 l Search Schedules p library Share with v Burn New folder v Hl Name Date mo dified Type Size Air_Condition_Lxml 30 05 2011 07 09 XML Document 8 KB Air Condition_2 xml 10 46 ent 4KB Air_condition_1_test xml 17 10 ent 5 KB Light07 xml 14 3 ent 2 KB None xml 325 ent 1KB Light04 xml 22 05 2011 09 33 ent 2 KB Light05 xml 22 05 2011 09 33 ent 2 KB Light06 xml 22 05 2011 09 33 nt gt KB Figure 13 Sample list of schedules in the Smart Building Controller kml version 1 0 encoding UTF 8 92 lt schedule xsi noNamespaceSchemaLocation Schedule xsd xmlns xsi http www w3 lt Object_Identifier gt 1 lt Object_Identifier gt lt Object_Name gt Test_Schedule 1 lt Object_Name gt lt Object_Type gt SCHEDULE lt Object_Type gt lt Present_Value gt Air_condition_2 Stop AC of lt Present_Value gt lt Description gt descriere_text optional lt Description gt lt Effective_Peri
12. error gt Error description lt error gt or the result of the call to the device or to the service itself as a string lt param gt string ControlDevice string sessionID string environmentName string command lt summary gt Controls a device directly lt summary gt lt param name sessionID gt A valid session ID identifying the caller lt param gt lt param name environmentID gt the ID of the environment in which the device exists lt param gt lt param name deviceID gt the ID of the device in the environment lt param gt lt param name highLevelFunctionID gt the id of the high level function that controls the device lt param gt lt param name DeviceDescriptionXML gt the description of the state of the device mainly including the high level parameters from the user interface The description must be an XML document matching the XSD schema for the Device object type at http www fcint ro portal xsd Device xsd lt param gt lt returns gt lt error gt Error description lt error gt or the result of the call to the device service as a string lt param gt OperationContract string ControlDeviceDirectly string sessionID int environmentID int deviceID int highLevelFunctionID string DeviceDescriptionXML OperationContract string ControlGroup string sessionID int environmentID string numeGrup int highLevelFunctionID string parameters OperationContract Used internally
13. lt name gt lt AID gt 1007 lt AID gt lt state gt Deactivate lt state gt lt conditions gt lt condition gt lt deviceName gt node9 lt deviceName gt lt DID gt 1211007 lt DID gt lt property gt OutOfService lt property gt lt operator gt lt CDATA gt lt operator gt lt value gt True lt value gt lt condition gt lt conditions gt lt status gt Inactive Unack lt status gt lt time gt 3600 lt time gt lt lastModified gt 28 02 2013 11 33 58 lt lastModified gt lt activeUser gt all lt activeUser gt lt schID gt 0 lt schID gt lt alarm gt After attaching a schedule to an alarm this is recorded in the plan of operation ie plan schedule It is stored in txt and xml files that are read by SBC and executed accordingly Below you can see what programs are running for alarms stored in the files used by SBC 04 03 2013 20 00 00 ACTION a ActivateAlarm 1020 APPLIED_TO 1020 DESCRIPTION Alarm State ACTIVE Schedule Alarm 1020 lt action gt lt date gt 04 03 2013 lt date gt lt hour gt 20 00 00 lt hour gt lt applies_to gt 1020 lt applies_to gt lt description gt AlarmState ACTIVE lt description gt lt powerConsumption gt 0 lt powerConsumption gt lt schedule_name gt Alarm 1020 lt schedule_name gt lt action gt Interpretation of the above lines is on 4 of March 2013 at 20 00 the schedule by which alarm with the id 1020 activate is executed XML shows also the energ
14. policies can be done in the Web application through the SBC and consists of attaching a schedule functioning program to a policy The steps to achieve this goal are e create a policy in the Policy Editor e view the policy in the web application by expanding the Policies section like below e pressing the Create button in the column Schedule button corresponding to the current policy e POLICIES Hide All Policies Current Policies D Name Last modified State View Schedule i s um Envie Craeg 2 2 C_Natalia ECO_Poli Enable ri k H Create 4 sP Enables cta Edit 4 5 PoliticaLocatieDo Enable t Hi Create H 5 olicy01 12 _ Disable Pi niet Create i 6 7 heckEneray_PC_Natali Enable J wiki Create i Page 1 off 20 laa View 1 6 of 6 Policies Section Viewing the policy in the Policies section The section of the web application dedicated to policies allows e view all policies e view current policies see figure below of the 7 policy defined in the above figure only one is running a current policy is a policy loaded into the current schedule which is activated by SBC at startup and updated at each change of the functioning program such a program change can occur when a policy is disabled e activation deactivation of a policy by clicking Enable Disable button of each policy e view a policy by pressing button beside each policy
15. the day NOTE No action in a given schedule will be executed twice in the same minute for the same service device or group b In the Exception_Schedule time is specified in various places An entry in the Exception_Schedule can be one or more of the following exception_day specifying a specific date when a certain action will occur Specifying an exception_day is done identically as the schedule_element entry where the user must specify the day and time according to the indications given above exception_interval a calendar dates interval in between which a specific action will be executed An exception interval is defined in the same way as the Effective_Period of the schedule itself see figure 14 for complete examples Specifying commands Commands in a schedule are specified In the Weekly schedule gt schedule_element tag in the Exception_schedule gt exception_day tag in the Exception_schedule gt exception_interval tag In all cases the action in each tag enumerated above is specified in the lt Present_Value gt child tag in one of the following forms in brief the SBC Extended Calling convention e Direct web service call The format is ServiceName MetodName arguments where e ServiceName is the name of a service registered in the Services folder of the SBC e MethodName is the name of the function specified in the WSDL document present in Services ServiceName S
16. two files in the logs folder o An activity log with the file name format DD MM YYYY_log txt This contains all the actions performed automatically by the controller as a result of policy enforcement or schedule execution For each action executed by the SBC a time stamped description is provided in the activity log o An event log DD MM YYYY _Eventlog txt This contains the description of each incoming event to the Smart Building Controller An event can be a command sent to the SBC from the User Interface or an event generated by a Device Wrapper Web Service For each incoming event a line with the event description and the time stamp is created in the event log NOTE After midnight new event log files are automatically created by the SBC on demand Gur gt Computer Local Disk C Debug logs P2 Organize f Open Prnt Bum Newfolder m e ERE A Name Date modified Type Size BH Desktop 255 2011 logbt Text Document 2KB p Th Downloads 25 5 2011 Eventlog tet Text Do 2KB 2 Recent Places 24 5 2011_Eventlog tt Text Document 1KB 245 2011 log bt Text Do 4KB a Libraries J 23 5 2011 Jog bt Text Document 14KB Documents B 5 2011 Eventlog bt Text Document 6 KB a Music _ 22 5 2011 Eventlog bt Text Document 3KB E Pictures Ld 22 5 2011_log tt 5 KB E videns 1150011 Fuentlan ht z f avn h gt 2 items selected Date modified 23 05 2011 18 24 Date created 23 05 2011 00 00
17. ARMS Hide Load alarms No active alarms Logs for selection from 12 03 2013 to 12 03 2013 E AID Device Service Alarm name Triggered by Status Date Hour Modify State Schedule 1 m 1001 AC1 1211001 Out of Service OutOfService True Inactive Unack 12 03 2013 09 44 40 Deactivate Create 2 E 1002 AC2 1211002 Out of Service OutOfService True Inactive Unack 12 03 2013 09 44 40 Deactivate Create 3 m 1003 WiFI_outside 1211003 Out of Service OutOfService True Inactive Unack 27 02 2013 16 47 14 Deactivate Create 4 1004 Lights 1211004 Out of Service OutOfService True Inactive Unack 12 03 2013 10 13 43 Deactivate Create 5 1005 WiFinode1 1211005 Out of Service OutOfService True Inactive Unack 27 02 2013 16 47 14 Deactivate Create 6 m 1006 WiFinode0 1211006 Out of Service OutOfService True Inactive Unack 27 02 2013 16 47 14 Deactivate Create 7 1007 node 1211007 Out of service OutOfService True Inactive Unack 28 02 2013 11 33 58 Activate Create R anna Windawe 12410N Niit af Service Auth FServiee Trie Active lInack 4222942 00 45 27 Neactivate Create Figure xx Alarms Section In the previous figure we don t have any active alarms the View Active Alarms button is deactivated and replaced with No active alarms label When the button is active like in the next figure one can see the alarms with the Active status e ALARMS Hide
18. Apply to Figure xxx Attaching a schedule to an alarm After opening the window for creating the schedule for alarm we need to create activities for that schedule This implies establishing a type of alarm action on off and the time at which the alarm is enabled disabled Edit Action Select action for device Device Parameters Select desired parameter values and click SEND to set the device state Alarm State ACTIVATE x DEACTIVATE Save selection Cancel Figure xxx Attaching an action to an alarm schedule After saving an action we can see all the actions that form a schedule for that alarm as shown in the above figure For example the alarm Windows3 is open with id 1020 for which we created a schedule respects the following rules of operation every Wednesday at 9 is activated and at 20 00 is disabled Taking into account the description of the alarm the event trigger is Windows3 window opening Because the Web application has to know which alarms have a schedule attached to them and therefore have a status button Edit in the column Schedule one uses the node schID in the xml file alarm xml which contains all the alarms defined in the system If the node value is 0 it means that the alarm has no schedule attached to it as below Otherwise schID will contain the id s of the attached schedule lt alarm gt lt name gt 1211007 Out of service
19. DetectorEvents SmokeOff message 29 Console WriteLine Received SmokeOff 0 message Vt Acteledeheleheheheheheteehehed Policy generated code RRR RRR RRR e e e e ing i 4 35 Jif message building Equals B F 38 els 39 r 10 public void Stop 1 F end of class 2 end of namespace Figure 16 code generated from event based policy rules Revised_xml_Devices xml E EvertSinkCode cs E ContinuousPolicy cs 1 using System IO 2 using System Windows Forms 3 using System Activities 4 namespace SmartBuildingController 5 public class ContinuousCode public void Execute if 2 gt 1 6 new AdvancedServiceCall false 7 InnerExecution null Air condition 1 Stop AC off Servicei Soapi2 8 F 9 else 10 foe Figure 17 sample continuous policy code generated from the continuous rule in figure 15 NOTE for new policies to be installed it is enough for a 3 party service running on the same machine as the SBC to write modify or delete policy XML files in the Policy folder Future versions of the SBC will include methods for enumerating deleting and installing policies either in the same WCF service interface or using a separate service endpoint new AdvancedServiceCall false InnerExecution null Air_ condition_i Stop AC off Servicei Soapi2 7 Policy scheduling Scheduling
20. FCINT Smart Building Controller User Manual Contents PU POSC aee aeaee E EN Kean ooue saan EE nemeuuned utucunensmenunntuluvare natereae pene meneaiees 3 Main use cases and overall architecture cece ccc eee eee ence eee ence eeseeeeeeeeeeeeeeeeeeeeneenes 4 Basic installation ANd SCtUP cece cece nce e eee e ctii t terriii nee ene eens RALEA AE iia 8 Event Handling in the Smart Building Controller cceeceeceec eee eee eee eee eee eee eee eeeeeeeeeeeeene 12 The SBC Service SNAPOINt scsusccsscwesicrecccesensan enn eucinsederasewsicendienesicenseesicneae read aE 14 SBC Service Interface cecsivcssiscaaiasiinssvscsseescde sens ERENER EEEE EEEE NEEESE EEEE 14 The SBC Service Calling Convention cccccccccceccccceseeeseeeeeeeeene sence seneneeeneeaeeeeeeeeesenes 21 Schedule specification and execution sessssssssoessssssoosessssesoosesssssooosssssssooosesesssoooseses 23 Policy specification and execution ss ssssrsrersrsssreririrsreri teritori ir rer RSK EPERE PEEKE EPERERA 27 Policy schedul iNo 05 cs c ccscdiesstvabtsetucaevecdertagsetucecdoeteelctestecsadectectaassteceatesthadccnsetecsanteel 30 Alarm scheduling acirrasisr irinin a E EAE AE EAEE EAEE A ne 39 Purpose This document describes the functionality and interfaces of the FCINT Smart Building Controller SBC to other FCINT system components This guide includes step by step tutorials on how to set up configure and use the Smart Buildi
21. ID 1 third argument Return value lt Device gt lt General_info gt lt Device_ID gt 1 lt Device_ID gt lt Name gt AC1 lt Name gt lt Picture gt lt Category gt lt TID gt 1 lt TID gt lt Name gt Lampa lt Name gt lt Picture gt lt Category gt lt Vendor gt lt Prod_ID gt lt Nam e gt lt Picture gt lt Vendor details gt lt Vendor gt lt Model gt lt General_info gt lt Graphical_interface_options gt lt Position X 10 Y 10 gt lt Color gt ff00ff lt Color gt lt Graphical_interface_options gt lt Parameters gt lt Parameter gt lt Par_ID gt 1 lt Par_ID gt lt Name gt AC State lt Name gt lt Data_Type gt string lt Data_Type gt lt Parameter_Type gt I lt Parameter_Type gt lt Default_valu e gt true lt Default_value gt lt PresentValue gt true lt PresentValue gt lt UI_Description gt lt Min_val gt lt Max_val gt lt Setter gt lt Visible gt lt Parameter gt lt Parameters gt lt HighLevelFunctions gt lt HighLevelFunctions gt lt Device gt Parameter_Values ompactSelfHost sdf X i Parameters Query mpactSelfHost sdf x Parameter Values ompactSeltHost sdf VallD ParlD DID Value ParlD SID Name Parameter_Type Data Type DefaultValue gt i 1 1 true gt q 1 AC State 1 string true A 2 2 2 5 2 2 Bulb Number 1 int 0 A 3 2 3 7 NUU NULL NULL NULL NULL NULL A NULL NULL NULL NULL AEAEE S S Devices Query C ompactSelfHost sdf X Parameters Query mpact
22. SelfHost sdf Parameter Value ole ompactSelfHost sdf DID ED Name BACNETComp XY Relation TID SID Enable Al Picture Color a Adon o ao NULL a ONUL NUL NULL 2 1 Becl no NULL NULL NULL 2 NULL NULL NULL 3 1 Bec2 no NULL NULL NULL 2 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL HilevelFunctions ompactSelfHost s df x Devices Query C ompactSelfHost sdf Parameters Query ompactSelfHost sdf HID SID Name Implementatio ReturnType Description MaplD ParlD HID Position b H 1 Start Start AC int Tums on AC f 1 1 1 2 2 Tur on Start_device nr string Turns on the lig 2 2 2 1 3 2 Turn off Stop_device nr string Turns off the li 3 2 3 1 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL Example local database content SCHEDULE MANAGEMENT SaveSchedule saves a schedule according to the Schedule XSD file Examples based on the test report public string SaveSchedule string nume string continut bool overwrite Where nume can be any name given to the Schedule A sample content for the continut parameter is lt schedule xmlns xsi http www w3 org 2001 XMLSchema instance xsi noNamespaceSchemaLocation Schedule xsd gt lt Object_Identifier gt 1 lt Object_Identifier gt lt Object_Name gt orarl lt Object_Name gt lt Object_Type gt SCHEDULE lt Object_Type gt lt Present_Value gt lt Effective_Period gt lt interval gt lt st
23. Size 18 8 KB J 23 5 2011 log bt Notepad File Edit Format View Help 23 5 2011 0 0 2 Servicecall osen off 23 5 2011 Servicecall Stop_ac off 23 5 2011 Servicecall Stop_ac off 23 5 2011 Servicecall Stop_acQ off 23 5 2011 Reloading schedule C n sched ales iacone wien as ym 23 5 2011 Servicecal stop_ac off 23 5 2011 Servicecall Set state Ae 1 20 2 0 0 23 5 2011 Servicecall Stop_ac 23 5 2011 Servicecall Stop_act 23 5 2011 ae padi schedule C Debu EAA Condition xm 23 5 2011 servicecall siop Act off 23 5 2011 Servicecall Stop_Ac off 23 5 2011 Servicecall Stop_ac off 23 5 2011 Reloading schedule C babug schedules air _Ccondition_1 xm 23 5 2011 servicecall Stop_ac off 23 5 2011 Servicecall stop_ac off 23 5 2011 Servicecall Stop_ac off 23 5 2011 Servicecall Set spare ACOlo 1 20 2 0 0 23 5 2011 2 Servicecal Stop_Ac 23 5 2011 24 Reloading senedin Cs lt babug schedies sr condition xm 23 5 2011 Servicecal Stor eS 23 5 2011 Servicecal Stopact orf 23 5 2011 Servicecal arn et off 23 5 2011 Servicecall ACC off 23 5 2011 Reloading schedule C oebug schetutes atr Condition xm 23 5 2011 servicecall PeT 23 5 2011 Servicecal Stop_act orf 23 5 2011 Servicecal l SORE off 23 5 2011 Servicecall Stop_ac off 23 5 2011 Reloading sehe feat Aee e PREOT ESANAK UR TE None 23 5 2011 Serviceca
24. ach event type must implement the following methods e public static void Init String Host int Port e public void Send The Init method is automatically called by the SBC for each class in each EventTypes assembly with the IP address of the SBC and with the event listening port default 2000 Each Event type class must connect to the SBC in the Init method and implement a public void Send method which serializes the event object and sends it to the SBC using the TCP connection established in the Init method In case of delivery failure a SBC reconnect resend attempt must be done this situation is illustrated in the Send method in the example above in the catch branch The SBC Service endpoint SBC Service Interface The SBC Service Endpoint is a Windows Communication Foundation endpoint with the following features Allows web clients to authenticate log in to the SBC Allows web clients to query and control the devices in an environment Allows web clients to listen for events from the Service Wrapper Layer The service can be discovered using the Metadata Exchange MEX service discovery protocol It uses WSDL HTTP and SOAP for composition and execution Data Source C WCF Service projects Client Runt imeS ync DBRunt imeS ync DBDataLogge PU inCompactSe lfHost sdf Service ready at http 141 85 37 155 56607 Press Enter to stop service Ti SmartBuildingControl Sax i schedule ondition_1i xml sc
25. ame 1224010 P Validity from 04 03 2013 to 04 03 2013 politica 04 03 2013 13 16 45 Connection between policies ids and their schedules ids After attaching a schedule to a policy this is recorded in the plan of operation which is called schedule plan in the context of FCINT system It is stored in txt and xml files that are read and executed by SBC Below you can see how these schedules are stored in the files used for SBC policies 04 03 2013 14 35 00 ACTION p ActivatePolicy SP1 APPLIED_TO 4 DESCRIPTION Policy State ACTIVATE Schedule P SP1 04 03 2013 15 40 00 ACTION p DeactivatePolicy SP1 APPLIED_TO 4 DESCRIPTION Policy State DEACTIVATE Schedule P SP1 lt xml version 1 0 gt lt schedule_plans gt lt action gt lt date gt 04 03 2013 lt date gt lt hour gt 14 35 00 lt hour gt lt applies_to gt 4 lt applies_to gt lt description gt PolicyState ACTIVATE lt description gt lt powerConsumption gt 0 lt powerConsumption gt lt schedule_name gt P SP1 lt schedule_name gt lt action gt lt action gt lt date gt 04 03 2013 lt date gt lt hour gt 15 40 00 lt hour gt lt applies_to gt 4 lt applies_to gt lt description gt PolicyState DEACTIVATE lt description gt lt powerConsumption gt 0 lt powerConsumption gt lt schedule_name gt P SP1 lt schedule_name gt lt action gt lt schedule_plans gt Interpretation of the above lines is on 4
26. anew policy is added it is automatically registered for execution by the SBC o Once an existing policy is modified it is automatically re loaded by the SBC o Once an existing policy is deleted it is automatically removed from execution by the SBC At each iteration scan of the Policies folder the SBC automatically generates executable code as follows o In the EventTypes folder the EventSinkCode cs file is generated as illustrated in figure 16 It contains policy enforcement code for all event based policy rules and specifies an event handler for each registered event type see section 4 and figure 9 o In the Policies folder the ContinuousPolicy cs file is generated as illustrated in figure 17 It contains policy enforcement code for all continous rules specified by all the policies in the Policy folder NOTE For policies related to the same event type or for continuous rules all the rules will be chained together Example Policy A on Event if C1 then P1 else A1 on true if C2 then P2 else A2 Policy B on Event if C3 then P3 else A3 on true if C4 then P4 else A4 Will result in the two policies being merged together as follows EventSinkCode cs The event handler for the Event is a block of the form if C1 then try P1 catch A1 else A1 if C3 then try P3 catch A3 else A3 ContinuousPolicy cs the continuos policy code will contain if C2 then try P2 catch A2 else A2
27. art_date gt 2011 12 04 lt start_date gt lt end_date gt 2011 12 04 lt end_date gt lt interval gt lt Effective_Period gt lt Weekly_Schedule gt lt Exception_Schedule gt lt Schedule_Default gt lt Out_of_Service gt false lt Out_of_Service gt lt Status_Flags gt true lt Status_Flags gt lt AppliesTo gt lt schedule gt Response lt ok gt file added successfully to the Schedules folder of the SBC Any non conformance of the second content parameter to the XSD file will return lt error gt Schedule description is not conformant to http fcint ro portal xsd Schedule xsd schema r nDetails description goes here r n lt error gt If the overwrite flag false and the file already exists the method will return lt error gt Schedule already exists Please use overwrite true lt error gt If called with the overwrite flag true the method will overwrite the file if it already exists and return lt ok gt which means the schedule has been successfully overwritten on the hard drive LoadSchedule Loads a schedule from disk and returns its contents Incarca un schedule si l intoarce utilizatorului ca string public string LoadSchedule long EID string numeSchedule EID parameter is ignored for the file system If a schedule does not exist the method will return lt error gt Schedule does not exist lt error gt otherwise it will return the body of the schedule
28. as specified in the previous example CALENDAR MANAGEMENT The SBC has functions for saving and loading calendars Calendars are useful for specifying custom defined dates to use in the schedule editor SaveCalendar public string SaveCalendar string calendarName string calendarBody bool overwrite Calendar body lt xml version 1 0 encoding UTF 8 gt lt xml version 1 0 encoding UTF 8 gt lt Calendar xmlns xsi http www w3 org 2001 XMLSchema instance xsiznoNamespaceSchemaLocation Calendar xsd gt lt UID gt 1 lt UID gt lt BaseCalendarUID gt 2 lt BaseCalendarUID gt lt WeekDays gt lt WeekDay gt lt DayType gt 1 lt DayType gt lt WeekDay gt lt WeekDays gt lt Calendar gt If the calendar does not conform to the Calendar XSD the method will return lt error gt Calendar description is not conformant to http fcint ro portal xsd Schedule xsd schema r nDetails The UID element has an invalid value according to its data type r n lt error gt If the calendar body is conformant to the Calendar XSD the method will return lt ok gt If the overwrite flag false and the file already exists the method will return lt error gt Calendar already exists Please use overwrite true lt error gt If called with the overwrite flag true the method will overwrite the file if it already exists and return lt ok gt which means the calendar has been successfully over
29. below figure has attached a schedule the corresponding button in the Schedule column is labeled Edit Also the schedule attached to an alarm is visible in the Schedules section similar to the policies schedules Schedules will be visible only if the user has the right to view them 18 1018 Windows Windows is open Window01 True Inactive Unack 13 03 2013 15 10 06 Deactivate Create 19 1019 Windows Windows2 is open Window02 True inactive Ack 13 03 2013 11 03 35 Activate Edit 20 1020 Windows Windows3 is open Window03 True inactive Ack 05 03 2013 20 00 27 Activate Edit Figure xxx The alarms with a schedule After clicking the Create button to create a schedule for an alarm a window similar to that in below fogure will open the same type of window that opens when we want to create a schedule for a device or for a policy which gives consistency to the web application SCHEDULE m Schedule outline Description needed Description IDandName 4224016 Alarm 1020 Validity from 28 02 2013 to 31 03 2013 Default action Applies To 1020 Every Wednesday E Start time Action 1 E 09 00 00 Alarm State INACTIVE 2 F 20 00 00 Alarm State ACTIVE Del selected Add Action Apply to other Date s Weekdays Monday Tuesday Wednesday Thursday Friday Saturday Sunday gt Alldates Save schedule
30. ct lt summary gt Listens for asynchronous events given a maximul polling delay lt summary gt lt param name sessionID gt A valid session ID lt param gt lt param name environmentName gt the environment being monitored lt param gt lt param name deviceOrServiceName gt the name of a device or service executing inside the SBC Can be all for any device or service lt param gt lt param name pollingDelay gt a maximum wait delay for events expressed in seconds lt param gt lt returns gt lt error gt Error description lt error gt in case an error occurs or an lt events count N gt tag with N child elements of various types each one is the XML serialization of an event lt returns gt string ListenForEvents string sessionID string environmentName string deviceOrServiceName int pollingDelay double lookbackMinutes listens for events OperationContract lt summary gt Sends a command to one or more devices in the environment by issuing a low level call to the underlying control web service lt summary gt lt param name sessionID gt A valid session ID identifying the caller lt param gt lt param name environmentName gt the environment being monitored lt param gt lt param name deviceID gt the name of the device or of the service lt param gt lt param name command gt the command to be sent to the service or to the device lt param gt lt returns gt lt
31. d when specifying the command parameter b When specifying an action service call in a Schedule see section 6 c When specifying an action service call in a Policy see section 7 The SBC Service Calling convention has some common elements for use cases a b and c as well as some minor differences NOTE the convention is not used in the case of the ControlDeviceDirectly method as it is used internally by the method transparent to the user This is the design purpose of the ControlDeviceDirectly method to abstract the calls to the ControlDevice in a manner transparent to the SCADA GUI side The common elements A command sent to the SBC via the ControlDevice method or service calls specified in schedules or policies has the following format Service MethodName parameters for a single service call Service1 MethodName1 parameters Service2 MethodName2 parameters for 2 or more service calls Each service call is specified between double square brackets For a ControlDevice and c policies the Service word in the convention specifies the name of a service listed in the Services folder All words in the Service calling convention are case sensitive For b the Service keyword is the name of a service endpoint and should be Service1 always EXTENDED SBC CALLING CONVENTION Device HighLevelFunctionName parameters This applies only to the SBC s ControlDevice command see Con
32. devices it owns and install them figure 3 WS Development tools Environment Policy editor Manager Smart Building Configurator Controller oo BACnet f v ws A ModBus S Figure 3 Discover and install services The user make the connections between devices and the related web services then devices are discovered and installed into the Smart Building Controller figure 4 WS Development tools Environment Policy editor E Manager Smart Building e Configurator Controller CELAA BACnet We eS ModBus Figure 4 Device discovery and installation in the FCINT Smart Building Controller The user defines a number of schedules for individual devices or for groups of devices The schedules are ready on the SBC for execution figure 5 vw fcint ro portal WS Development tools Environment Policy editor Ei Manager lt fee Smart Building Configurator Rai Controller BACnet T WSs A ae j P Figure 5 Create device schedules The user defines a number of policies for individual devices or for groups of devices The policies are ready on the SBC for execution figure 6 uw fcint ro portal WS Development tools Environment Policy editor Manager me S part Building Configurator Ptr r ja IF Then Figure 6 Create policies The user can supervise and control the system from the building s LAN or from th
33. e Web figure 7 Development tools a Envi t gt nvironmen _ MELET or from the Web rt Building Figure 7 Supervise and control Basic installation and setup The SBC installation package is available online at http www fcint ro portal Download aspx The installation package will install the Smart Building Controller in a folder with the following structure figure 8 A Name Date modified Type Size d EventTypes 01 04 2011 18 52 File folder J logs 25 05 2011 00 00 File folder Ji Policies 14 03 2011 17 07 File folder Schedules 22 05 2011 08 55 File folder i Services 01 04 2011 13 24 File folder S EventBase dll 14 03 2011 16 34 Application extens 5 KB Readme tet 23 03 2011 11 53 Text Document 6 KB n SmartBuildingController exe 15 04 2011 15 15 Application 86 KB H SmartBuildingController exe config 15 04 2011 15 14 XML Configuratio 3 KB Figure 8 Smart Building Controller directory listing The directory listing consists of The main program executable SmartBuildingController exe The Configuration file SmartBuildingController exe config EventBase DLL a DLL needed by the SBC Readme txt a brief how to on the specification of schedules policies and the use of the system logs folder this folder contains the activity and event logs of the Smart Building Controller as illustrated in figure 9 For each day the Smart Building Controller creates
34. e file name must be the same as the folder Service instance name and must end with a txt extension The service referred by the txt file must point to a valid MEX endpoint w Local Disk C Debug Services b Search Services Include in library Share with Burn New folder Local Disk Ci Debug Services Lights SA baa ibrary Share with Burn New folder J Air_Condition_1 Name Dateiviadified Type J Air_Condition_2 Bisco Reece L Lights MachineLeaming J VirtualSmokeDetector Ji Voice W a gt Local Disk C Debug Services Voice b Local Disk C gt Debug Services VirtualSmokeDetector 4 way Sharewith Bum _ New folder Print Burn New folder Name Date modifiec A l Dat d Tyr grammar be z z m VirtualSmokeDetector bt gt output config E schemas microsoft com 2003 10 Serialization cs 15 03 A schemas microsoft com 2003 10 Serializationxsd 15 03 8 tempuri orgxsd mE VirtualSmokeDetector txt Notepad File Edit Format View Help http localhost 5000 v5moke amp VoiceRecoEvents dll VoiceRecoEvents pdb E VoiceRecognition exe 01 04 2011 19 24 E VoiceRecognition exe config VoiceRecognition pdb VoiceRecognition vshost exe 2011 14 Applicatior E VoiceRecognitionvshost exe config 15 03 2011 12 21 ML Configuratio c a Figure 11 The structure of the Services folder in the Smart Building Controller 11
35. e temperature is lower than 22 degrees bu the AC is stopped then the AC is opened at 30 degrees Policy Contents x Policy Name M001 Last Modified 08 03 2013 13 26 19 a Rule name 01 Ruleoo Interval 30000 ms ON continuous IF Windows Window01EQfalse AND Windows Window02EQfalse AND Windows Window03EQfalse AND Windows Window04EQfalse if WiF _outside TemperatureLTE17 AND WiFinode1 TemperatureLT22 AND AC1 stateEQ0 THEN AC1 SetMultipleDeviceState state mode temperature 1 3 30 ELSE The content of a policy with one rule A policy with multiple rules is visible in the below figure Note that the first two rules are collapsed the last two expanded so each rule can be visualized in tree like manner Policy Contents Policy Name PC_Natalia_ECO_Policy Last Modified 08 03 2013 15 19 12 a Rule name 01 Weekend Rule name 02 Workingdays a Rule name 03 Fridays Interval 600000 ms ON continuous IF DayOfWeekEQS AND Hour GTE 16 THEN PC_Natalia state off ELSE a Rule name 04 Holidays Interval 600000 ms ON continuous IF CurrentMonthEQ3 AND DayOfMonthEQ8S THEN PC_Natalia state off ELSE The content of a policy with several rules For policy rules to be presented in a language closer to the natural one a translation dictionary is used with entries of the form lt initial_char_sequence gt blank gt lt char_sequence_in_natural_language gt Some dictionary examples are given below gt
36. erviceName wsdl e arguments is a list of arguments of the method Currently the following argument types are supported o string o boolean o integer 1 2 3 o double 1 0 2 0 3 1 etc Example Air_condition_1 Start_AC on Support for low level service calls is included e Device group control Format GroupName HighLevelFunctionName key value pairs as argument specifications separated by commas where e GroupName is the name of a group specified and existing in the groups folder with the name GroupName xml A group file specifies the devices belonging to the group For each device in the group a high level device control command will be executed see below e The name of the high level function in user friendly format e arguments of the form Key Value Example AirConditioners Start AC State on just an example you need to have the local DB configured properly High level Device control Format DeviceName HighLevelFunction arguments The parameters sent are according to the specifications of the high level function given in the local database in the same form as for the high level group commands Example if the AC1 device maps to the Air_Condition_1 service and the Air_condition_1 service has a high level function named Start that takes one parameter AC State as a string controlling the AC1 device is done by sending the AC1 Start AC State on command
37. groups Device groups are saved in the Groups folder of the SBC in a folder corresponding to the Environment ID for which they are defined In this folder group X is saved as X xml A group example is given below lt group name grup0 ID 0 gt 1 2 3 lt group gt SaveGroup public string SaveGrup long EID string numeGrup string device_id_uri bool overwrite The method must be called with EID 1 for example numeGrup group name grup0 for example and device_id_uri 1 2 3 that specify each device ID in a group separated by a comma Observations related to the overwrite flag apply in the same manner as with Calendars and Schedules ListGroups Lists all the device groups defined for a given environment EID public string ListGroups long EID If no groups are defined the method will return lt groups count gt else it will return lt groups count 1 gt n r lt group name grupe ID 0 gt 1 2 3 lt group gt r n n r lt groups gt The SBC Service Calling Convention The SBC Service Calling convention is a notation convention for the Smart Building Controller Its main purpose is to specify a format for the execution of one or more service calls The convention is used in the following scenarios a When the ControlDevice method in the SBC service interface is called to control a device using the low level service call The SBC Service Calling convention is use
38. hedule Light 4 xml schedule Light 5 xml schedule Light 6 xml schedule Light xml schedule Schedule xml schedule test xml schedule testSchedule xml policy NewPolicy xml in authenticated i to machine learning service failed A I functions will he disabled sembly VoiceRecoEvents dll sembly USmokeDetectorEvents dll Event type sembly WindowEvents dll Event sink compile OK Started tcp event sink server on port 2000 OK SBC Service endpoint started Endpoints are Binding BasicHttpBinding address http 141 85 37 155 5621 S8BC Binding WebHttpBinding address http 141 85 37 155 5 21 7 Binding WSHttpBinding address http 141 85 37 155 5621 SBC mex Started anticipative event queue SBC running Default parameters host localhost port 5021 service name SBC Endpoints are illustrated in the figure above ServiceContract public interface ISBC OperationContract lt summary gt Performs a log in to the Smart Building Controller A necessary step for any lt summary gt lt param name userName gt User name registered in the Smart Building Controller s local database lt param gt lt param name password gt password for the user lt param gt lt returns gt lt error gt Error description lt error gt in case an error occurs or the sessionID otherwise lt returns gt string DoLogin string userName string password performs a local log in operation OperationContra
39. ic override string ToString if this speech null return this speech return public static TcpClient tepClient null public static string host public static int port public static void Init string Host int Port host Host port Port try tcpClient new TcpClient host port catch Exception e Console WriteLine e Message public void SendQ here I put the XML serializer and write the code to send it to the TCP Server try XmiSerializer eventSerializer new XmlSerializer this GetTypeQ StringWriter wr new StringWriterQ XmlTextWriter xmlWriter new XmlTextWriter wr eventSerializer Serialize wr this if tepClient null return NetworkStream io tepClient GetStream byte bytesArray Encoding ASCII GetBytes wr ToString 10 Write bytesArray 0 bytesArray Length catch Exception e Console WriteLine e Message try tcpClient new TcpClient host port try re sending XmilSerializer eventSerializer new XmlSerializer this GetTypeQ StringWriter wr new StringWriterQ XmlTextWriter xmlWriter new XmlTextWriter wr eventSerializer Serialize wr this if tepClient null return NetworkStream io tepClient GetStream byte bytesArray Encoding ASCII GetBytes wr ToString io Write bytesArray 0 bytesArray Length catch Exception exc Console WriteLine exc Message As it can be seen in the example above e
40. ition_1 1 aAir_condition_l stop_acc off 56 Air_condition1 stop_acc off 26 Air_condition_1 Stop_acc off 3 3 55 Air_condition_1 stop_acc off 43 Air_condition_2 stop_ac off im Figure 9 Activity and event logs EventTypes folder figures 8 and 10 This folder includes the complete list of device dependent event types that can be intercepted by the Smart Building Controller Event types are packaged together in NET event type assemblies Each event type stored in the event type assemblies must be a public and XML serializable class At initialization the Smart Building Controller automatically registers all even types defined in the EventTypes folder figure 11 gt Local Disk C Debug EventTypes ibrary v Share with v Burn New folder Name Date modified Events dll 01 04 2011 15 36 c EventSinkCode cs 20 05 2011 13 25 VoiceRecoEvents dll VSmokeDetectorEvents dll Type Application extens Visual C Source f Application extens Application extens 5 KB 2 KB 5 KB 7 KB Figure 10 Event types registered in the Smart Building Controller B CADebug SmartBuildingController exe l schedule Air_Condition_1 xml schedule Air_condition_l_test xml oading schedule Air_Condition_2 xml Loading schedule Light 4 xml 7 Loading schedule Light S xml oading schedule Light 6 xml Loading schedule Light 7 xml Loading schedule None xml oading p
41. ll BENE 23 5 2011 Servicecal StOp_Ac it 23 5 2011 Eventlog bt Notepad File Edit Format View Help Bea a 23 5 2011 23 5 2011 23 5 2011 23 5 2011 23 5 2011 23 5 2011 f 23 5 2011 23 5 2011 23 5 2011 23 5 2011 23 5 2011 23 5 2011 23 5 2011 23 5 2011 23 5 2011 23 5 2011 23 5 2011 23 5 2011 23 5 2011 23 5 2011 23 5 2011 23 5 2011 23 5 2011 23 5 2011 23 5 2011 23 5 2011 23 5 2011 23 5 2011 23 5 2011 23 5 2011 23 5 2011 23 5 2011 0 2 Air_condition_2 stop_Aac off 2 Air_condition_2 Stop_acc off 3 Air_condition_1 stop_acc off 3 Air_condition_1 stop_acc off 6 Air_condition_1 stop_acc off 6 Air_condition_1 Set_ State_Ac 232032 05103 7 Air_condition21 Air_condition1 Air_condition_1 Air_condition_1 stop_acc of Air_condition_1 Stop_acc off 2 Air_condition_1 stop_ac off 252 Air_condition_1 stop_acc off 353 Air_condition_1 stop_acC off 1 Air_condition_1 set state Ac A 20 2 0 0 2 Aair_condition_l stop_acc off 37 Air_condition_1 stop_acC off 37 Air_condition_l stop_acc off 38 Air_condition_1 Stop_acC off 138 Air_condition1 stop_acc off Fag 2 2 Q 0 A ie 5 5 0 0 0 0 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 ah SODAS 8 9 253 Air_condition1 stop_acc off 54 Air_condition1 3 254 Air_condition_1 255 Air_condition_1 219 Air_condition_1 319 Air_condition1 20 Air_cond
42. ng Controller in the following scenarios Basic installation and setup Event type registration and the event subsystem SBC Service interface Schedule specification and execution Policy specification and enforcement Main use cases and overall architecture The FCINT Smart Building Controller SBC is the orchestration component of the FCINT project The overall deployment diagram of the FCINT system is outline in figure 1 Simulation console Environment Manager Portal Simulation report Service Management System generation service Simulation engine Client Configurator Policy editor Environment Manager cladire Smart Building Controller SBC Device control web services Lights Windows ModBus Simulation Bridge Service Verification and template profiling tool AirCondition other services Operating system drivers Hardware layer KNX BACnet ModBus custom hardware protocols Figure 1 Overall FCINT architecture The main use case of the FCINT project can be summarized as follows figures 2 7 A user downloads the Smart Building Controller from the FCINT portal and installs it inside his her smart home or building Figure 2 vw fcint ro portal WS Development tools z Environment Policy editor Manager Smart Building Configurator Controller Figure 2 Download and install the FCINT client software The user discovers on the FCINT portal the services for the
43. oLogin test test string raspuns client ControlDevice sessionID 3 NumeDevice HighLevelFunction parametri Usage examples client ControlDevice sessionID AC2 Start AC State on client ControlDevice sessionID AC1 Start ControlGroup Sends a high level command to a group of devices Usage examples client ControlGroup 123123 eid grupe 1 AC State on the parameters are as follows sessionID right now can be anything environment ID group name High Level Function ID parameters Parameters as in the case of ControlDevice is a string of the form Name value name value Device and group control in Schedules We have an extended SBC Service Calling convention that can be used in schedules Now you can more easily define schedule commands using the high level function notation Examples are as follows lt what gt AC1 Start tempValue 3 lt what gt for device Control lt what gt grup Turn off lt what gt for group control here e device name identify the name of a device listed in the Devices table of the local database service SQLCompactSelfHost GetDeviceStatus retrieves the status of a device from the database The response is according to the Device XSD available at http www fcint ro portal xsd Device xsd Example client GetDeviceStatus 123 1 1 Given the local database structure given below the method returns for eid 1 Second argument and D
44. od gt lt interval gt lt start_date gt 2011 08 24 lt start_date gt lt end_date gt 2011 08 25 lt end_date gt lt interval gt lt Effective_Period gt lt Weekly_Schedule gt lt scheduleelement gt lt day schedule gt 1 lt day schedule gt lt time gt 10 00 00 lt time gt lt Present_Value gt Air_condition_2 Start_AC on lt Present_Value gt lt scheduleelement gt lt scheduleelement gt lt day schedule gt Friday lt day schedule gt lt time gt 14 00 00 lt time gt lt Present_Value gt Air_condition_2 Start_AC on lt Present_Value gt lt scheduleelement gt lt Weekly Schedule gt lt Exception_Schedule gt lt exception day gt lt day schedule gt Monday lt day schedule gt lt time gt 14 00 00 lt time gt lt Present_Value gt Air_condition_2 Stop_AC off lt Present_Value gt lt exception day gt lt exception day gt lt day schedule gt 5 lt day schedule gt lt time gt 14 20 00 lt time gt lt Present_Value gt Air_condition_2 Stop AC off lt Present_Value gt lt exception day gt lt exception interval gt lt interval gt lt start_date gt 2010 08 13 lt start_date gt lt end_date gt 2010 08 16 lt end_ date gt lt interval gt lt time gt 11 00 00 lt time gt lt Present_Value gt Air_condition_2 Stop AC off lt Present_Value gt lt exception interval gt lt exception interval gt lt interval gt lt start_date gt 2010 08 19 lt start_date gt lt end_da
45. of March 2013 at 14 35 the schedule by which policy lt SP1 is activates is executed on 4 of March 2013 at 15 40 the schedule by which policy SP1 is deactivated is executed by SBC In addition to the information from the txt files the xml files brings information about the energy consumed by the created schedule Scheduling policies is visible in the Web application but it is made by the SBC as shown in the below figure policies can be created read updated deleted CRUD operations only by political editor Creating schedules for policies is made only by SBC via the Web Charging the schedules in the operation plan and subsequently their execution are also made by SBC Z cig FCINT Policy editor SCHEDULE amp CRUD SCHEDULE_ID POLICY_ D al CRUD E R aiy FCINT EXECUTA Eeue AA Environment POLITICA Manager CRUD EXECUTA APLICATIE WEB amp PLAN DE FUNCTIONARE The workflow for creating a policy schedule Alarm scheduling Planning for alarms can be achieved in Web application through the SBC and consists of attaching a schedule to an alarm The steps to achieve this goal are e creating an alarm from the Alarms Configurator e viewing the alarms from the Web application by expanding the Alarms section e pressing the Create button in the Schedule column corresponding to the current alarm e AL
46. olicy ComplexPolicy xml Logging in authenticated allocated event predictor Event types assembly Events dll VoiceRecoEvents dll VSmokeDetectorEvents dll Event sin Started tcp event sink server on port 2000 OK SBC Service endpoint started Endpoints are Bingina Sect N AOAN EAEE S0C Binding LiSHttpBinding address http 7 141 85 37 144 5021 mex Figure 11 Smart Building Controller initialization NOTE For more information on Event Handling in the Smart Building Controller see section 4 Policies folder This includes all user defined policies See section 7 as XML files Schedules folder This includes all user defined schedules see section 6 as XML files Services folder This is the main folder of the Smart Building Controller The Services folder contains all the services currently installed which can be called by the SBC The Services folder contains a subfolder for each service with the name of the service instance figure 12 a Services can be added to the SBC in three different modes as follows e Mode 1 figure 12 b The service folder contains a WSDL file with the service interface It must support SOAP over HTTP e Mode 2 figure 12 c No WSDL file is specified but a complete self hosted WCF service executable is provided WCF services should provide a MEX endpoint for discovery and composition e Mode 3 figure 12 d Only a reference to a WCF service is provided in a text file Th
47. ru un anumit environment OperationContract string ListCalendars OperationContract string SaveCalendar string numeCalendar string corpCalendar bool overwrite salveazza un calendar in folderul Calendars OperationContract string LoadCalendar string numeCalendar incarca un calendar de pe disc OperationContract string SaveGrup long EID string numeGrup string device_id_uri bool overwrite OperationContract string ListGroups long EID MAIN FUNCTIONS TO USE WITH USAGE EXAMPLES 99 e DoLogin user password any combination of user and password works for now no security yet returns user123128adsasbasvd sessionID e ControlDeviceDirectly deprecated use ControlDevice instead This function controls a specific device directly and transparently to the GUI without the need to compose a specific low level function call and use the deprecated ControlDevice method Parameters sessionlD string obtained after DoLogin environmentID the environment ID devicelD the ID of the device in the local database int highLevelFunctionID the command ID string deviceDescriptionXML the current state of the device as retrieved from the GUI if it s called from an Ul or from the database if called from a policy according to the XSD at http www fcint ro portal xsd Device xsd Return values the result of the service call or lt error gt error description lt error gt otherwise e
48. so the running schedule attached to a policy is visible in the Schedules section as well e SCHEDULES Delete selected All Schedules Current Schedules New Schedule for Create Start Date End Date Name Applied to Modify State 1224010 04 03 2013 04 03 2013 PSP 1224017 27 02 2013 02 03 2013 Alarm 1019 Alarma 1224016 28 02 2013 31 03 2013 Alarm 1020 Alarma 1224018 28 02 2013 31 03 2013 Alarm 1021 Alarma 1224008 30 01 2013 07 02 2013 ACinext AC ja lt a page lot3 gt mS e e POLICIES All Policies Current Policies Last modified 08 03 2013 13 26 19 08 03 2013 15 19 12 04 03 2013 13 16 45 06 03 2013 12 46 54 6 Policy01 12 03 2013 08 08 01 Enable c create 4 lt 4 Page 1 of2 gt mi 5 Relationship between a policy and its schedule After clicking the Create button to build a schedule to a policy a window similar to that in the below figure will open it is the same type of window that opens when we want to create a schedule for a device fact that gives consistency to the web application After opening the window for creating policy schedules we need to create activities for that schedule This implies establishing a type of action activation deactivation for that policy and the time at which that policy activates deactivates itself SCHEDULE Schedule outline Description needed Description
49. te gt 2010 09 13 lt end_ date gt lt interval gt lt time gt 04 20 00 lt time gt lt Present_Value gt Air_condition_2 Stop_AC off lt Present_Value gt lt exception interval gt lt Exception_Schedule gt lt Schedule_Default gt Air_condition_2 Stop AC off lt Schedule_Default gt lt Out_of_Service gt false lt Out_of Service gt lt Status_Flags gt true lt Status_Flags gt lt AppliesTo gt lt device_group gt Ac_group002 lt device_group gt lt device gt Air_condition_2 lt device gt lt device gt Air_condition_1 lt device gt lt AppliesTo gt lt schedule gt Figure 14 Sample schedule XML file Specifying time in the schedule There are several places where specifying time is needed a In the Weekly_Schedule For each schedule_element entry org 2001 XMLSchema instance gt o The day_schedule tag must be specified as one of the following Numeral between 1 and 7 specifying the day of the week Monday Sunday string specifying the day of week Calendar day in the same format as the Effective_Period start date and end date o the time has to be specified as HH MM SS or MM SS meaning at every hour at minute MM and second SS an action will happend HH SS meaning at hour HH at every SS seconds of each minute an action will occur _HH MM or any combination of HH MM SS and the wildcard not listed above Note will execute an action every minute of
50. tinuously enforced in an environment How should the Smart Building Controller react to certain types of events produced by the services in the Driver Wrapper Services Layer figure 5 Each rule in a policy is specified by the PSML P notation on E if C then P else A where on specifies the trigger of the rule or when the rule is activated Can be o true for continuous rules OR o the name of a registered event type in the SBC see section 4 and figure 9 A Registered event type is a public XML serializable event type See section 4 included in an assembly placed in the EventTypes folder of the SBC Examples on true or on SmokeOn where SmokeOn is an event type included in the VSmokeDetectorEvents DLL located in the EventTypes folder figure 9 of the SBC C specifies a condition which must be evaluated as a boolean true false P is a property which the system must hold P holds one or more service calls as specified in section 5 2 P is a block of code which is executed if the condition C is evaluated to true A is a block of code which follows the same convention as P A is executed if C is evaluated to false or if an exception occurs in the evaluation of C Expressions C P and A are specified using C and the SBC Service Calling convention specified in section 5 2 Policy files are specified as XML files stored in the Policies folder of the SBC As with schedules the SBC checks for policy updates every 2 seconds o Once
51. trolDevice above Example string response client ControlDevice sessionID AC1 Start AC State on The parameter of the call inside the third argument in this case AC State on follows the template e key value for single parameter function calls e key value key value for multiple parameters The following extension applies to groups of devices groupName HighLevelFunctionName arguments when controlling groups of devices within the schedule In a nutshell the SBC calling conventions extensions are summarized as follows Device HighLevelFunctionName parameters added for the ControlDevice method Device HighLevelFunctionName parameters and Group HighLevelFunctionName parameters without square brackets added for schedule execution see examples at the end of the Schedule execution section We include here for completeness examples of calling the service directly deprecated backward compatibility preserved e ControlDevice a and Policy c use scenarios Air_Condition_1 Start_AC on will work because there exists an Air_Condition_1 service in the Services folder See figure 11 a Air_CONDITION_1 Start_AC on will not work because the case doesn t match AIRCONDITION1 Start_AC on will not work because there is no service called AIRCONDITION1 and because the expression ends only with a single square bracket and not with two intentionally left typing error
52. wit I password 0 6 08 0 Enable A sessionID T 7 12 nable Wr lastLognTime LE at a cristina B 12 Enable mma A Page lof password 94s izuzuzozswuucl ivuvocauus 1074 OvjeGw 121 avo Vuei izzsuus sessionID WZWBOLXPWRAKQKEZFNHMOKFOCHME CanView True CanView False lastLogin Time 12 3 2013 14 41 57 CanControl True CanEdit False 5 Dan CanDelete True CanDelete False userlD 1226050 PC_Aex B P SP1 password a775e856898F 19c 184b68c79936a579e ObjectID 1211909 ObjectID 1224010 session D ULXHMVGXJDPLHIRKRVWNJMUARJGHN CanView True CanView True lastLogin Time 13 12 2012 17 23 56 CanContro True CanEdit True i hi s CanDelete True CanDelete True m r Default rights forthe selected user V View F Edt V Delete Display of policies taking into account the user s rights In order to know in the web application that some policies have a schedule attached to them so they have the Edit button the Schedule column an additional file POLICIES txt is used which stores the policy id and the policy schedule id in the format lt id_schedule gt lt id_policy gt One should mention that the policies ids start at 1 and the schedules ids start at 1224000 the correspondence between IDs can be found below AMMANN ADD DD LADNER DAD LEO Rite WANED ARE mt SCHEDULE Schedule outline Description needed Description Id schedule IDand N
53. written on the hard drive LoadCalendar Loads a calendar from disk and returns its contents public string LoadCalendar string calendarName If a calendar does not exist the method will return lt error gt Calendar does not exist lt error gt otherwise it will return the body of the calendar as specified in the previous example ListCalendars lists all the calendars defined on the SBC public string ListCalendars If no calendars exist on disk in the Calendars folder next to the SBC then the method will return lt calendars count 0 gt Otherwise it will return results each calendar in a Calendar tag such as given below for the case of one calendar on disk testCalendar xml lt calendars count 1 gt n r lt xml version 1 0 encoding UTF 8 gt lt Calendar xmins xsi http www w3 org 2001 XMLSchema instance xsi noNamespaceSchemaLocation Calendar xsd gt lt Name gt testCalendar lt Name gt lt UID gt 1 lt UID gt n r lt BaseCalendarUID gt 2 lt BaseCalendarUID gt n r lt WeekDays gt lt WeekDay gt lt DayType gt 1 lt DayType gt lt 1 stands for Monday 2 for exception 2 for Tuesday etc gt lt WeekDay gt lt WeekDays gt lt Calendar gt r n n r lt calendars gt GROUP MANAGEMENT Devices can be grouped into groups even for devices that are not controlled by the same web service The SBC has functions for saving and listing all the user defined device
54. y schedule either EIFOINT Configurator and maintenance tool SBC Devices amp Services Device groups Locations SBC ini configuration Users amp rights SEC execution testbed Console SBC REGISTERED USERS SYSTEM DEVICES SCHEDULES POLICIES To edit or delete user data right click on the user name To change access rights right click on device selNode To change access rights right click on schedulle selNode To change access rights right click on policy selNode SBC Users CanControl True CanEdt False maria alarmSystem CanDelete True CanDelete False userlD alamSystem S PC_Damian E Maria Dascalu password 098f6bcd4621d373cade4e832627b4f6 ObjectID 1211904 Object D 1224006 session D UIFX77 TWNSNR7RYWFZAI T IA7AGT IN CanView Tre mn astlognTme POLICIES Hide Gandy eet 2 e password 9 LAllPolicies Current Policies session D F D Name Last modified State View Schedule lastLoginTime nDelek i 1 moo 08 0 Enable Create SP1 userlD 1221 2 4 po cyo0 12 0 Enable create ir acetieDol password 2 7 Gr Policy01 sessionID L 2 Set 04 9 Enable Ep CheckEnergy_PC_Natalia lastLoginTime 4 5 PoliticaLocatieDo 06 0 Enable H New_Policy00 test j SYA Policy 13 useriD 12 gt Enable
55. y consumed through the created schedule

Download Pdf Manuals

image

Related Search

Related Contents

Model: 750-CTUS • INSTALLATION • OPERATION - Alto  計測データワイヤレス通信システム U-WAVE-R 改版4  User Manual - TRS RenTelco    Feline Infectious Peritonitis Virus RT-PCR Detection Kit    Fluoroskan Ascent FL User Manual  KIT VIDÉO COULEUR  QT-BK  Guia do Usuário Luxímetro Registrador de Dados com  

Copyright © All rights reserved.
Failed to retrieve file