Fork me on GitHub

iCasa GOGO commands

iCasa provides a set of functional gogo commands helping the manipulation of iCasa elements, such as devices, zones and persons.

Manipulating Devices

Create device

Creates a new simulated device.

Scope -> icasa

Name-> create-device

Parameters:

  • ${deviceId} The device Id of the new device.
  • ${deviceType} The device type of the new device.

Example:

> g! icasa:create-device iCasa.Thermometer therm-1

List of devices

Gets the list of devices in the iCasa execution platform, this command shows the devices identifiers, and their position.

Scope -> icasa

Name -> show-devices

Parameters -> NONE

Example:

> g! icasa:show-devices
Devices:
Device Id: Pres-B1255D-D - Position: (413:185)
Device Id: BiLi-C7496W-S - Position: (58:427)
Device Id: Pres-A1255D-D - Position: (504:374)
Device Id: Toogle-B1286X-Y - Position: (599:38)
Device Id: Toogle-D1286X-Y - Position: (219:349)
Device Id: Pres-D1255D-D - Position: (166:24)
Device Id: Pres-C1255D-D - Position: (240:399)
Device Id: BiLi-D7496W-S - Position: (202:59)
Device Id: Toogle-C1286X-Y - Position: (97:384)
Device Id: Toogle-A1286X-Y - Position: (509:451)
Device Id: BiLi-A7496W-S - Position: (492:440)
Device Id: BiLi-B7496W-S - Position: (505:270)

Activate device

Active a device.

Scope -> icasa

Name-> activate-device

Parameters->

  • ${deviceId} The device ID.

Example:

> g! icasa:activate-device Pres-B1255D-D

Deactive device

Deactive a device.

Scope -> icasa

Name-> deactivate-device

Parameters->

  • ${deviceId} The device ID.

Example:

> g! icasa:deactivate-device Pres-B1255D-D

List device properties

Shows the list of properties of a device.

Scope -> icasa

Name-> show-device

Parameters->

  • ${deviceId} The device ID.

Example:

> g! icasa:show-device Pres-B1255D-D
Properties: 
Property: presenceSensor.sensedPresence - Value: false
Property: state - Value: activated
Property: Location - Value: livingroom
Property: fault - Value: no

Simulate a fail in device

Simulate a fail in a device.

Scope -> icasa

Name-> fault-device

Parameters->

  • ${deviceId} the device ID.

Example:

> g! icasa:fault-device Pres-B1255D-D

Simulate a reparation in device

Repair a device.

Scope -> icasa

Name-> repair-device

Parameters->

  • ${deviceId} the device ID to repair.

Example:

> g! icasa:repair-device Pres-B1255D-D

Move device

Move a device into new X,Y coordinates

Scope -> icasa

Name-> move-device

Parameters-

  • ${deviceId} the device ID to move.
  • ${X} The new X-coordinate.
  • ${Y} The new Y-coordinate

Example:

> g! icasa:move-device Pres-B1255D-D 60 80

Move device into zone

Move a device into new X,Y coordinates

Scope -> icasa

Name-> move-device-zone

Parameters-

  • ${deviceId} the device ID to move.
  • ${zoneId} The new zone.

Example:

> g! icasa:move-device-zone Pres-B1255D-D kitchen

Set device property

Set a new device property

Scope -> icasa

Name-> set-device-property

Parameters-

  • ${deviceId} the device ID to modify.
  • ${property} The property name.
  • ${value} The property value.

Example:

> g! icasa:set-device-property Pres-B1255D-D newProp newValue

Remove a device

Remove a simulated device

Scope -> icasa

Name-> remove-device

Parameters-

  • ${deviceId} the device ID to remove.

Example:

> g! icasa:remove-device Pres-A1255D-D

Attach device to a person

Attach or deatach a device from a person

Scope -> icasa

Name-> attach-device-person

Parameters-

  • ${deviceId} the device ID.
  • ${personId} the person ID.
  • ${attach} true | false. True for attach, False to deatach.

Example:

> g! icasa:attach-device-person Pres-A1255D-D Philippe true
> g! icasa:attach-device-person Pres-A1255D-D Philippe false

Manipulating Zones

Create zone

Creates a new zone.

Scope -> icasa

Name-> create-zone

Parameters-

  • ${zoneId} the new zone ID.
  • ${leftX} The topX value.
  • ${topY} The topY value.
  • ${X-Length} The X-Length of the new zone.
  • ${Y-Length} The Y-Length of the new zone.

Example:

> g! icasa:create-zone kitchen  50 50 100 100

List zones

Show the existant zones.

Scope -> icasa

Name-> show-zones

Parameters-

  • NONE

Example:

> g! icasa:show-zones
Zones:
Zone livingroom : Zone: livingroom X: 410 Y: 20 Z: 0 X-Length: 245 Y-Length: 350 Z-Length: 100 Parent:Unset Use Parent: false
Zone kitchen : Zone: kitchen X: 410 Y: 370 Z: 0 X-Length: 245 Y-Length: 210 Z-Length: 100 Parent:Unset Use Parent: false
Zone bathroom : Zone: bathroom X: 55 Y: 20 Z: 0 X-Length: 260 Y-Length: 350 Z-Length: 100 Parent:Unset Use Parent: false
Zone bedroom : Zone: bedroom X: 55 Y: 370 Z: 0 X-Length: 259 Y-Length: 210 Z-Length: 100 Parent:Unset Use Parent: false

Move zone

Move a zone to a new position

Scope -> icasa

Name-> move-zone

Parameters-

  • ${zoneId} the new zone ID.
  • ${leftX} The topX value.
  • ${topY} The topY value.

Example:

> g! icasa:move-zone livingroom 410 25

Resize zone

Resize a zone

Scope -> icasa

Name-> resize-zone

Parameters-

  • ${zoneId} the new zone ID.
  • ${X-Length} The new X-Length value.
  • ${Y-Length} The new Y-Length value.

Example:

> g! icasa:resize-zone livingroom 245 300

Add parent

Add a parent to a zone.

Scope -> icasa

Name-> set-zone-parent

Parameters-

  • ${zoneId} the child zone ID.
  • ${parentId} The parent zone ID.
  • ${useParentVariables} true if zone will use the parent variables, false if not.

Throws-> Exception when zone does not fit in the parent.

Example:

> g! icasa:set-zone-parent livingroom chair true

Add variable

Add a variable to a zone.

Scope -> icasa

Name-> add-zone-variable

Parameters-

  • ${zoneId} the zone ID.
  • ${variableName} The variable name.

Example:

> g! icasa:add-zone-variable livingroom comfortable

Modify variable

Modifies a variable in a given zone.

Scope -> icasa

Name-> modify-zone-variable

Parameters-

  • ${zoneId} the zone ID.
  • ${variableName} The variable name.
  • ${variableValue} The numeric value.

Example:

> g! icasa:modify-zone-variable livingroom comfortable 100

Attach a zone to a device

Attach a zone to a device .

Scope -> icasa

Name-> attach-zone-device

Parameters-

  • ${deviceId} the zone ID.
  • ${zoneId} The variable name.
  • ${attach} True to attach, false to deatach.

Example:

> g! icasa:attach-zone-device Pres-A1255D-D chair true
> g! icasa:attach-zone-device Pres-A1255D-D chair false

Show zone

Shows the information of a zone.

Scope -> icasa

Name-> show-zone

Parameters->

  • ${zoneId} The zone ID.

Example:

> g! icasa:show-zone livingroom
Variables: 
Variable: Volume - Value: 10.0
Variable: Illuminance - Value: 5.0
Variable: Temperature - Value: 295.15

Manipulating Persons

Create persons

Creates a new simulated person.

Scope -> icasa

Name-> create-person

Parameters:

  • ${personId} The new person Id.
  • ${personType} The person type.

Example:

> g! icasa:create-person Pierre Boy

Get persons in zone

Get the zones where a given person is located.

Scope -> icasa

Name-> show-person-zones

Parameters:

  • ${personId} The person Id.

Example:

> g! icasa:show-person-zones Pierre 
Zones: 
Zone : Zone: bedroom X: 55 Y: 370 -- Width: 259 Height: 210 - Parent: Unset - Use parent: false

List persons

Shows the list of persons.

Scope -> icasa

Name-> show-persons

Parameters->

  • ${personId} The person ID.

Example:

> g! icasa:show-persons
Persons: 
Person Person: Pierre - Position: (215:444) - Type: Boy

Move person

Move a person to new positions

Scope -> icasa

Name-> move-person

Parameters->

  • ${personId} The person ID.

Example:

> g! icasa:move-person Pierre 100 100

Move person to a zone

Move a person to a zone.

Scope -> icasa

Name-> move-person-zone

Parameters->

  • ${personId} The person ID.
  • ${zoneId} The zone ID.

Example:

> g! icasa:move-person-zone Pierre kitchen

Attach person to a zone

Attach/detach a person to/from a zone.

Scope -> icasa

Name-> attach-person-zone

Parameters->

  • ${personId} The person ID.
  • ${zoneId} The zone ID.
  • ${attach} True to attach, false to deatach.

Example:

> g! icasa:attach-person-zone Pierre chair true
> g! icasa:attach-person-zone Pierre chair false

Manipulating Simulation

Reset context

Clear the simulation context, it will remove all zones, simulated devices and persons.

Scope -> icasa

Name-> reset-context

Parameters->

  • NONE

Example:

> g! icasa:reset-context

Show scripts

Shows the list of available scripts

Scope -> icasa

Name-> show-scripts

Parameters->

  • NONE

Example:

> g! icasa:show-scripts
Scripts: 
SetupHouse.bhv
SetupHouseWithLights.bhv

Execute script

Execute a script. The scripts must be already loaded (available in the script directory)

Scope -> icasa

Name-> execute-script

Parameters->

  • ${scriptName} script name to execute.

Example:

> g! icasa:execute-script SetupHouseWithLights.bhv

Configuration Commands

Set a global configuration property

Scope -> icasa

Name-> set-global-property

Parameters->

  • ${name} the property name.
  • ${value} the property value.
  • ${type} the property type. The type must be one of this [String, Boolean, Integer, Long, Float] (Optional Parameter- Default Value is String)

Example:

> g! icasa:set-global-property period 80.0 Float

Set a user configuration property

Scope -> icasa

Name-> set-user-property

Parameters->

  • ${user} the user name.
  • ${name} the property name.
  • ${value} the property value.
  • ${type} the property type. The type must be one of this [String, Boolean, Integer, Long, Float] (Optional Parameter- Default Value is String)

Example:

> g! icasa:set-user-property john period 80.0 Float

Set a application configuration property

Scope -> icasa

Name-> set-app-property

Parameters->

  • ${app} the application id.
  • ${name} the property name.
  • ${value} the property value.
  • ${type} the property type. The type must be one of this [String, Boolean, Integer, Long, Float] (Optional Parameter- Default Value is String)

Example:

> g! icasa:set-app-property LightFollowMe period 80.0 Float

Get a global configuration property value

Scope -> icasa

Name-> get-global-property

Parameters->

  • ${name} the property name.

Example:

> g! icasa:get-global-property period
  Property: period - Value: 80.0
  80

Get a user configuration property value

Scope -> icasa

Name-> get-user-property

Parameters->

  • ${user} the user name.
  • ${name} the property name.

Example:

> g! icasa:get-user-property jhon period
  Property: period - Value: 80.0
  80

Get a application configuration property value

Scope -> icasa

Name-> get-app-property

Parameters->

  • ${app} the application id.
  • ${name} the property name.

Example:

> g! icasa:get-app-property LightFollowMe period
  Property: period - Value: 80.0
  80