Is it possible to add support for more door commands than lock and unlock, so that it is exposed as a button in Smart Client?
Yes, whatever commands you would like have. Look in the FetchConfig method in the ConfigurationManager class. You can add new ACCommandTypes into the configuration.
Yes, I tried that but didn’t get it to show up. From the sample code:
private ACConfiguration BuildConfiguration(DoorControllerDescriptor[] doorControllers, DoorDescriptor[] doors, EventDescriptor[] eventDescriptors)
{
/* ... */
// Add command types
List<ACElement> commandList = new List<ACElement>();
commandList.AddRange(CommandTypes.DoorCommands);
commandList.Add(new ACCommandType(
"DC_Access",
"Access",
null,
null,
new[] { ACBuiltInCommandTypeCategories.GrantAccess, ACBuiltInCommandTypeCategories.AccessRequest },
0));
elements.AddRange(commandList);
Do I need to add some more to the configuration? I don’t find any way to associate the command to the doors.
BTW, it actually shows up here, but not for doors in Smart Client.
That bit of code only adds the possible commands to the configuration. Somewhere else in that method you add various ACUnitTypes to the configuration, one of which is for your doors. One of the parameters for the ACUnitType is a list of Commands that are applicable to that type.
Thanks, now I figured it out ![]()
Hi Anders,
As mentioned on previous comments, you need to declare the command and use it on a ACUnitType door.
Following the example that is published on GitHub you can find:
I managed to create a new command “TestCommand” - line 5 on the snippet below - and see it on the notification pop up in Smart Client:
internal static class CommandTypes
{
public static ACCommandType DoorUnlock = new ACCommandType(DoorCommandId.Unlock, "Unlock", null, null, new[] { ACBuiltInCommandTypeCategories.GrantAccess, ACBuiltInCommandTypeCategories.AccessRequest }, 0);
public static ACCommandType DoorLock = new ACCommandType(DoorCommandId.Lock, "Lock", null, null, new[] { ACBuiltInCommandTypeCategories.AccessRequest }, 0);
public static ACCommandType TestCommand = new ACCommandType("TestCommand", "TestCommand", null, null, new[] { ACBuiltInCommandTypeCategories.AccessRequest }, 0);
public static ACCommandType[] DoorCommands = new[] { DoorLock, DoorUnlock, TestCommand };
}
Hope it works for you!
Fer

