Folks,
I have a private android application called Hal that it similar to the Google Search widget (i.e. you press a button and make a request). The voice stream is sent to my windows server where it is parsed and sends commands to my Vera2.
At this time the grammar is hard coded for my devices. In order to release this as a general application to the Vera community it needs to be driven by the specific Vera configuration. I would like to solicit some input from the community. My current strategy is to first handle a limited set of device types, then to increase the scope. In the first step I believe I can hard code the type of actions and have a grammar as described below using a form of extended BNF syntax.
First I need to define some spoken symbols:
<RoomName> := Roon Name Options defined in Vera;
<SectionName> := Section Names defined in Vera;
<SceneName> := Scene Names defined in Vera;
<BinaryLightDeviceName> := Device Names defined in Vera of type "urn:schemas-upnp-org:device:BinaryLight:1";
<DimmableLightDeviceName> := Device Names defined in Vera of type "urn:schemas-upnp-org:device:DimmableLight:1";
<LockDeviceName> := Device Names defined in Vera of type "urn:schemas-micasaverde-com:device:DoorLock:1";
<SensorDeviceName> := Device Names defined in Vera of type "urn:schemas-micasaverde-com:device:*Sensor:1"
<ThermostateDeviceName> := Device Names defined in Vera of type "urn:schemas-upnp-org:device:HVAC_ZoneThermostat:1";
<SceneName> : Scene Names defined in Vera;
Then a spoken command is of the form:
<top-level> := <command-prefix> <command> <command-suffix>;
<command-prefix> := Please|Hal|Computer;
<command-suffix> := Please|Thanks|Thank You|Over|OK|Hal|Computer;
<command> := <specific-command> [In|On <RoomName>] [Section <SectionName>];
Where The room clauses and section clauses will be enforced when specified, and required if device or scene names are ambiguous;
<specific-command> := <BinaryLightCommand> | <DimmableLightCommand> | <DoorLockCommand> | <ThermostatCommand> <SceneCommand> <StatusCommand>;
<BinaryLightCommand> := {Turn {On |Off} [the] <BinaryLightDeviceName> } |
{Turn [the] <BinaryLightDeviceName> {On |Off} };
<DimmableLightCommand> := {Turn <On|Off> [the] <DimmableLightDeviceName>} |
{Turn [the] <DimmableLightDeviceName> <On|Off> } |
{Set [the] <DimmableLightDeviceName> <SliderDeviceValue>} | ;
<SliderDeviceValue> := <SliderDeviceValueWithNumber> | High | Medium | Low | {Last [value]};
<SliderDeviceValueWithNumber> := {To | At | {Increase [to]}| {Lower [to]}} <Digits> [percent];
<Digits> := <Digit> | <Digit> < Digit>;
<Digit> := One | Two | Three | Four | Five | Six | Seven | Eight | Nine | Zero;
<DoorLockCommand> := {Lock | Unlock} [the] <LockDeviceName> [lock];
<StatusCommand>:= {What is [the] <StatusDevices> Status} |
{What is [the] Status of [the] <StatusDevices>} ;
<ThermostatCommand> := <ThermostatModeCommand> | <ThermostatFanModeCommand> | <ThermostatTemperature>;
<ThermostatModeCommand> := Set the <ThermostatDeviceName> [Mode] to {Off |Heat | Cool | Auto};
<ThermostatFanModeCommand> := Set the <ThermostatDeviceName> FanMode to {On | Auto};
<ThermostatTemperature> := Set the <ThermostatDeviceName> [Temperature] to <Digits>;
<SceneCommand> := [Run | Activate] [the] <SceneName> [Scene];
<StatusDevices> := <BinaryLightDeviceName> | <DimmableLightDeviceName> | <LockDeviceName> | <SensorDeviceName> | <ThermostatDeviceName>;
Assuming a configuration that included the following devices:
BinaryLightName: {Hallway Light} DimmableLightName: {Great Room Light} | {Office Fan} LockName: {Front Door} ThermostatName: {Great Room Thermostat} SceneName: {Secure the House} | {All Lights On}
Spoken examples would look like:
Hal turn on the Great Room Light OK Please turn of the Great Room Light Hal Please Lock the Front Door thanks Computer unlock the Front Door lock thanks Hal what is the status of the Front Door over Please set the Office Fan to medium thanks Computer set the Great Room Light to two four percent thanks Computer set the Great Room Light lower two five percent thanks Computer set the Great Room Light lower two five percent thanks Hal set the Great Room Light to last value please Hal Set the Great Room Thermostat Mode to auto thanks Hal Secure The House Please Computer Activate All Lights On Thanks
My questions include:
[ul][li]Is it OK to assume a set of operations based on a devices device_type ?[/li]
[li]I will need some help on syntax for other device_types, the above is the limit of devices I own.[/li]
[li]Any suggestions for a more robust way to get actions and define a spoken grammar for a device ?[/li][/ul]
A few more comments on my Android App:
[ul][li]Has a help option that displays a textual representation of the specific spoken grammar[/li]
[li]Has the ability to save the last command as a gesture[/li]
[li]Has a region to issue a gesture command, not just a verbal command[/li]
[li]Plan to add an option to make a screen widget for the last command.[/li][/ul]
A few more comments on my Windows Server App:
[ul][li]Written in C#[/li]
[li]Status are returned to the android application as text messages[/li]
[li]Uses Windows System.Speech Libraries for recognition[/li]
[li]Has a windows installer[/li]
[li]Plan to add Speech Plugins … i.e. Grammar + actions[/li]
[li]Has a Windows Control Panel for Configuration[/li]
[li]Acts as a Windows Service[/li][/ul]