Luup UPNP Files

From MiOS
(Difference between revisions)
Jump to: navigation, search
(New page: The documentation (see: [http://www.blindshademotors.com/documents/accessories-special-applications/rs232-to-rts-compatability.pdf]) explains that you talk to the controller using RS232 96...)
 
Line 1: Line 1:
The documentation (see: [http://www.blindshademotors.com/documents/accessories-special-applications/rs232-to-rts-compatability.pdf]) explains that you talk to the controller using RS232 9600 Baud, 8 Data Bits, 1 Stop Bit, No Parity.  The interface supports up to 16 blinds.  The communication is one-way only; there are no response codes or incoming data from the blinds when they change manually.  Here is the relevant section from the manual.
+
The following is the contents of the file "Constant.h" which defines the strings used for file device types, services, actions, variables, etc.
  
RS232 Operation
+
/*
  1. Set RS232 communication settings to: 9600 Baud, 8 Data Bits, 1 Stop Bit, No Parity
+
    Copyright (C) 2008 Mi Casa Verde, Inc., a Nevada Corporation
  2. Use the ASCII protocol command string syntax: <!> <2 digit channel number> <Directional Command>
+
 
  3. The directional commands must be capital letters and are as follows:
+
All rights reserved. This software may not be used or distributed without express consent
  U: UP
+
 
  D: DOWN
+
*/
  S: STOP
+
 
  4. Examples: Motor 2 Up: !02U
+
#ifndef Constants_h
  Motor 5 Down: !05D
+
#define Constants_h
  Motor 1 Stop: !01S
+
 
 +
// Device Types
 +
#define DEVICETYPE_BINARY_LIGHT "urn:schemas-upnp-org:device:BinaryLight:1"
 +
#define DEVICETYPE_DIMMABLE_LIGHT "urn:schemas-upnp-org:device:DimmableLight:1"
 +
#define DEVICETYPE_THERMOSTAT "urn:schemas-upnp-org:device:HVAC_ZoneThermostat:1"
 +
#define DEVICETYPE_HUMIDITY_SENSOR "urn:schemas-micasaverde-com:device:HumiditySensor:1"
 +
#define DEVICETYPE_MULTI_IO "urn:schemas-micasaverde-com:device:MultiIO:1"
 +
#define DEVICETYPE_DOOR_LOCK "urn:schemas-micasaverde-com:device:DoorLock:1"
 +
#define DEVICETYPE_DOOR_SENSOR "urn:schemas-micasaverde-com:device:DoorSensor:1"
 +
#define DEVICETYPE_ZWAVE_NETWORK "urn:schemas-micasaverde-com:device:ZWaveNetwork:1"
 +
#define DEVICETYPE_TEMPERATURE_SENSOR "urn:schemas-micasaverde-com:device:TemperatureSensor:1"
 +
#define DEVICETYPE_MOTION_SENSOR "urn:schemas-micasaverde-com:device:MotionSensor:1"
 +
#define DEVICETYPE_LIGHT_SENSOR "urn:schemas-micasaverde-com:device:LightSensor:1"
 +
#define DEVICETYPE_IR_TRANSMITTER "urn:schemas-micasaverde-com:device:IrTransmitter:1"
 +
#define DEVICETYPE_WINDOW_COVERING "urn:schemas-micasaverde-com:device:WindowCovering:1"
 +
#define DEVICETYPE_GENERIC_IO "urn:schemas-micasaverde-com:device:GenericIO:1"
 +
#define DEVICETYPE_REMOTE_CONTROL "urn:schemas-micasaverde-com:device:RemoteControl:1"
 +
#define DEVICETYPE_COMBO_DEVICE "urn:schemas-micasaverde-com:device:ComboDevice:1"
 +
#define DEVICETYPE_CAMERA "urn:schemas-upnp-org:device:DigitalSecurityCamera:1"
 +
#define DEVICETYPE_SERIALPORT "urn:micasaverde-org:device:SerialPort:1"
 +
#define DEVICETYPE_SCENE_CONTROLLER "urn:schemas-micasaverde-com:device:SceneController:1"
 +
 
 +
// Device Files
 +
#define DEVICEFILE_BINARY_LIGHT "D_BinaryLight1.xml"
 +
#define DEVICEFILE_DIMMABLE_LIGHT "D_DimmableLight1.xml"
 +
#define DEVICEFILE_THERMOSTAT "D_HVAC_ZoneThermostat1.xml"
 +
#define DEVICEFILE_HUMIDITY_SENSOR "D_HumiditySensor1.xml"
 +
#define DEVICEFILE_MULTI_IO "D_GC100.xml"
 +
#define DEVICEFILE_DOOR_LOCK "D_DoorLock1.xml"
 +
#define DEVICEFILE_DOOR_SENSOR "D_MotionSensor1.xml"
 +
#define DEVICEFILE_ZWAVE_NETWORK "D_ZWaveNetwork.xml"
 +
#define DEVICEFILE_TEMPERATURE_SENSOR "D_TemperatureSensor1.xml"
 +
#define DEVICEFILE_MOTION_SENSOR "D_MotionSensor1.xml"
 +
#define DEVICEFILE_LIGHT_SENSOR "D_LightSensor1.xml"
 +
#define DEVICEFILE_IR_TRANSMITTER "D_IrTransmitter1.xml"
 +
#define DEVICEFILE_WINDOW_COVERING "D_DimmableLight1.xml"
 +
#define DEVICEFILE_GENERIC_IO "D_BinaryLight1.xml"
 +
#define DEVICEFILE_REMOTE_CONTROL "D_BinaryLight1.xml"
 +
#define DEVICEFILE_COMBO_DEVICE "D_BinaryLight1.xml"
 +
#define DEVICEFILE_CAMERA "D_DigitalSecurityCamera1.xml"
 +
#define DEVICEFILE_SCENE_CONTROLLER "D_DoorLock1.xml"
 +
 
 +
// Device Categories
 +
#define DEVICE_CATEGORY_INTERFACE 1
 +
#define DEVICE_CATEGORY_DIMMABLE_LIGHT 2
 +
#define DEVICE_CATEGORY_SWITCH 3
 +
#define DEVICE_CATEGORY_SECURITY_SENSOR 4
 +
#define DEVICE_CATEGORY_HVAC 5
 +
#define DEVICE_CATEGORY_CAMERA 6
 +
#define DEVICE_CATEGORY_DOOR_LOCK 7
 +
#define DEVICE_CATEGORY_WINDOW_COV 8
 +
#define DEVICE_CATEGORY_REMOTE_CONTROL 9
 +
#define DEVICE_CATEGORY_IR_TX 10
 +
#define DEVICE_CATEGORY_GENERIC_IO 11
 +
#define DEVICE_CATEGORY_GENERIC_SENSOR 12
 +
 
 +
// Cast the second one between int and char * so we can use a simple
 +
// array that's fast to iterate and not use an stl map
 +
extern const char *g_DeviceCategories[];
 +
extern const char *g_DeviceDescriptions[];  // Default descriptions
 +
 
 +
// These are stored in the json file for the device itself and not part of the UPNP variables:
 +
 
 +
/*
 +
Device_Num
 +
FK_DevType
 +
Device_Num_Parent
 +
FK_Device_Category
 +
Room_Num
 +
 
 +
Description
 +
InternalID // DEVICEDATA_PortChannel_Number_CONST
 +
Manufacturer // DEVICEDATA_Manufacturer_Desc_CONST
 +
Model // DEVICEDATA_Model_Desc_CONST
 +
IPAddress
 +
MacAddress
 +
UPnPDeviceFile  // DEVICEDATA_UPnP_Dev_File_CONST
 +
*/
 +
 
 +
// ============  HaGateway  ============
 +
// Basic functionality for the gateway itself
 +
 
 +
#define HAGEVICE_FILE "S_HomeAutomationGateway1.xml"
 +
#define HAGEVICE_SID "urn:micasaverde-com:serviceId:HomeAutomationGateway1"
 +
#define HAGEVICE_STYPE "urn:schemas-micasaverde-org:service:HomeAutomationGateway:1"
 +
 
 +
// Variables
 +
 
 +
// Actions
 +
#define HAG_GET_USER_DATA "GetUserData"  
 +
#define HAG_MODIFY_USER_DATA "ModifyUserData"
 +
#define HAG_MODIFY_GET_VARIABLE "GetVariable"
 +
#define HAG_MODIFY_SET_VARIABLE "SetVariable"
 +
#define HAG_MODIFY_GET_STATUS "GetStatus"
 +
#define HAG_MODIFY_GET_ACTIONS "GetActions"
 +
#define HAG_MODIFY_CREATE_DEVICE "CreateDevice"
 +
#define HAG_PROCESS_CHILD "ProcessChildDevices"
 +
#define HAG_RELOAD "Reload"
 +
#define HAG_RUN_SCENE "RunScene"
 +
#define HAG_RUN_LUA "RunLua"
 +
 
 +
 
 +
// ============  HaDevice  ============
 +
// Basic functionality for all home automation devices
 +
 
 +
#define HADEVICE_FILE "S_HaDevice1.xml"
 +
#define HADEVICE_SID "urn:micasaverde-com:serviceId:HaDevice1"
 +
#define HADEVICE_STYPE "urn:schemas-micasaverde-com:service:HaDevice:1"
 +
 
 +
// Variables
 +
#define HAD_ENERGY_LOG "EnergyLog" // DEVICEDATA_Energy_Log_CONST
 +
#define HAD_WATTS "Watts" // DEVICEDATA_Wattage_CONST
 +
#define HAD_IOPORT_DEVICE "IODevice" // The device number to connect to for IO (this is on the master device)
 +
#define HAD_IOPORT_PORT "IOPort" // The port to receive connections on from HAD_IOPORT_DEVICE (this is on the serial port)
 +
#define HAD_IGNORE_ROOM "IgnoreRoom"
 +
#define HAD_COMM_FAILURE "CommFailure"
 +
#define HAD_POLLING_ENABLED "PollingEnabled"
 +
#define HAD_POLL_MIN_DELAY "PollMinDelay"
 +
#define HAD_CONFIGURED "Configured"
 +
#define HAD_JOBID "JobID"
 +
 
 +
#define HAD_RECONFIGURE "Reconfigure"
 +
#define HAD_REMOVE "Remove"
 +
#define HAD_POLL "Poll"
 +
#define HAD_SET_POLL_FREQUENCY "SetPollFrequency"
 +
 
 +
// ============  ZWaveNetwork  ============
 +
// Basic functionality for all ZWave devices
 +
 
 +
#define ZWN_FILE "S_ZWaveNetwork1.xml"
 +
#define ZWN_SID "urn:micasaverde-com:serviceId:ZWaveNetwork1"
 +
#define ZWN_STYPE "urn:schemas-micasaverde-org:service:ZWaveNetwork:1"
 +
 
 +
#define ZWN_RESET_NETWORK "ResetNetwork"
 +
#define ZWN_REMOVE_NODES "RemoveNodes"
 +
#define ZWN_ADD_NODES "AddNodes"
 +
#define ZWN_DOWNLOAD "DownloadNetwork"
 +
#define ZWN_HEAL_NETWORK "HealNetwork"
 +
#define ZWN_SET_POLLING "SetPolling"
 +
#define ZWN_SEND_DATA "SendData"
 +
#define ZWN_POLL_ALL_NODES "PollAllNodes"
 +
 
 +
// Variables
 +
#define ZWN_LAST_UPDATE "LastUpdate"  // DEVICEDATA_LastUpdate_CONST
 +
#define ZWN_AUTO_CONFIGURE "AutoConfigure"  // DEVICEDATA_Auto_Configure_CONST
 +
#define ZWN_NET_STATUS_ID "NetStatusID" 
 +
#define ZWN_NET_STATUS_TEXT "NetStatusText" 
 +
#define ZWN_COM_PORT "ComPort"  // DEVICEDATA_COM_Port_on_PC_CONST
 +
#define ZWN_NODE_ID "NodeID"  // The dongle's id
 +
#define ZWN_VERSION_INFO "VersionInfo"
 +
#define ZWN_HOME_ID "HomeID"
 +
#define ZWN_ROLE "Role"
 +
#define ZWN_RESET_MODE "ResetMode"
 +
#define ZWN_INCLUSION_MODE "InclusionMode"
 +
#define ZWN_NODETYPE "NodeType"
 +
#define ZWN_TIMEOUT "Timeout"
 +
#define ZWN_MULTIPLE "Multiple"
 +
#define ZWN_SIMULATE_INCOMING "SimulateIncomingData"
 +
#define ZWN_POLL_ENABLED "PollingEnabled"
 +
#define ZWN_POLL_DELAY_INITIAL "PollDelayInitial"
 +
#define ZWN_POLL_DELAY_DEADTIME "PollDelayDeadTime"
 +
#define ZWN_POLL_MINDELAY "PollMinDelay"
 +
#define ZWN_POLL_FREQUENCY "PollFrequency"
 +
#define ZWN_LAST_ERROR "LastError"
 +
 
 +
// ============  ZWaveDevice  ============
 +
// Basic functionality for all ZWave devices
 +
 
 +
#define ZWDEVICE_FILE "S_ZWaveDevice1.xml"
 +
#define ZWDEVICE_SID "urn:micasaverde-com:serviceId:ZWaveDevice1"
 +
#define ZWDEVICE_STYPE "urn:schemas-micasaverde-com:service:ZWaveDevice:1"
 +
 
 +
// Variables
 +
#define ZWD_LAST_UPDATE "LastUpdate"  // DEVICEDATA_LastUpdate_CONST
 +
#define ZWD_AUTO_CONFIGURE "AutoConfigure"  // DEVICEDATA_Auto_Configure_CONST
 +
#define ZWD_POLL_SETTINGS "PollSettings"  // DEVICEDATA_Polling_Settings_CONST
 +
#define ZWD_REVERSE "ReverseOnOff"  // DEVICEDATA_Reverse_CONST
 +
#define ZWD_MULTCH_ENDPOINT "MultiChEndpoint"  // DEVICEDATA_Multi_Channel_End_Point_CONST
 +
#define ZWD_MULTCH_CAPABIL "MultiChCapabilities"  // DEVICEDATA_Multi_Channel_Capabilities_CONST
 +
 
 +
// ZWD_MULTCH_ENDPOINT string m_sMultiChannelList, // If m_cProtocolVersion>=2 (multi channel), then If this has embedded devices, Format: [number of end points] , [0/1 end points are dynamic], [0/1 end points are identical]
 +
    // If m_cProtocolVersion<2 (multi instance), then the total number of instances
 +
// ZWD_MULTCH_CAPABIL m_sMultiChannelCapability;  // m_cProtocolVersion>=2, if this has devices, Format: [end point #], Generic device class, Specific device class, command class 1, command class 2.... \n repeat next end point
 +
// If m_cProtocolVersion<2, command class, # of instances \n repeat command class
 +
 
 +
#define ZWD_NEIGHBORS "Neighbors" // DEVICEDATA_Neighbors_to_Call_CONST
 +
#define ZWD_CAPABILITIES "Capabilities"  // DEVICEDATA_Capabilities_CONST
 +
#define ZWD_CONFIG "Configuration"  // DEVICEDATA_Configuration_CONST
 +
#define ZWD_LAST_RESET "LastReset"  // DEVICEDATA_Last_Reset_CONST
 +
#define ZWD_SCENES_AS_EVENTS "ScenesAsEvents"  // DEVICEDATA_Scenes_As_Events_CONST
 +
#define ZWD_SCENES "Scenes"  // DEVICEDATA_Scenes_CONST
 +
#define ZWD_WAKEUP_INTERVAL "WakeupInterval"  // DEVICEDATA_Wakeup_Interval_CONST
 +
#define ZWD_PIN_CODES "PinCodes"  // DEVICEDATA_PIN_Codes_CONST
 +
#define ZWD_BATTERY_LEVEL "BatteryLevel"  // DEVICEDATA_Battery_Level_CONST
 +
#define ZWD_LAST_WAKEUP "LastWakeup"  // DEVICEDATA_Last_Wakeup_CONST
 +
#define ZWD_LAST_ROUTE_UPD "LastRouteUpdate"  // DEVICEDATA_Last_Route_Update_CONST
 +
#define ZWD_VARIABLES_GET "VariablesGet"  // DEVICEDATA_Variables_Get_CONST
 +
#define ZWD_VARIABLES_SET "VariablesSet"  // DEVICEDATA_Variables_Set_CONST
 +
#define ZWD_ASSOCIATION_GET "AssociationGet"  // DEVICEDATA_Association_Get_CONST
 +
#define ZWD_ASSOCIATION_SET "AssociationSet"  // DEVICEDATA_Association_Set_CONST
 +
#define ZWD_MANUF_INFO "ManufacturerInfo"  // DEVICEDATA_Model_CONST
 +
#define ZWD_VERSION_INFO "VersionInfo"  // DEVICEDATA_Configuration_CONST
 +
#define ZWD_UPDATED_NAME "UpdatedName"  // DEVICEDATA_Update_Name_CONST
 +
 
 +
// ============  Camera  ============
 +
// Basic functionality for all Cameras
 +
 
 +
#define CAMDEVICE_FILE "S_Camera1.xml"
 +
#define CAMDEVICE_SID "urn:micasaverde-com:serviceId:Camera1"
 +
#define CAMDEVICE_STYPE "urn:schemas-micasaverde-com:service:Camera:1"
 +
 
 +
// Variables
 +
#define CAM_USERNAME "Username"  // DEVICEDATA_AuthUser_CONST
 +
#define CAM_PASSWORD "Password"  // DEVICEDATA_AuthPassword_CONST
 +
#define CAM_ARCHIVE_SETTINGS "ArchiveSettings"  // DEVICEDATA_Video_settings_CONST
 +
#define CAM_RELATED_DEVICES "RelatedDevices"  // DEVICEDATA_sDevice_Num_Relations_For_Creat_CONST
 +
#define CAM_URL "URL"  // DEVICEDATA_Path_CONST
 +
 
 +
// ============  PanTiltZoom  ============
 +
// For Cameras
 +
 
 +
#define PTZ_FILE "S_PanTiltZoom1.xml"
 +
#define PTZ_SID "urn:micasaverde-com:serviceId:PanTiltZoom1"
 +
#define PTZ_STYPE "urn:schemas-micasaverde-com:service:PanTiltZoom:1"
 +
 
 +
// Actions
 +
#define PTZ_LEFT "MoveLeft"
 +
#define PTZ_RIGHT "MoveRight"
 +
#define PTZ_UP "MoveUp"
 +
#define PTZ_DOWN "MoveDown"
 +
#define PTZ_IN "ZoomIn"
 +
#define PTZ_OUT "ZoomOut"
 +
 
 +
// ============ SwitchPower1  ============
 +
#define SWP_SID "urn:upnp-org:serviceId:SwitchPower1"
 +
 
 +
// Actions
 +
#define SWP_SET_TARGET "SetTarget"
 +
 
 +
// Variables
 +
#define SWP_STATUS "Status"
 +
#define SWP_TARGET "Target"
 +
 
 +
// ============  Dimming1  ============
 +
#define SWD_SID "urn:upnp-org:serviceId:Dimming1"
 +
 
 +
// Actions
 +
#define SWD_SET_LOAD_LEVEL "SetLoadLevelTarget"
 +
 
 +
// Variables
 +
#define SWD_LOAD_LEVEL_STATUS "LoadLevelStatus"
 +
#define SWD_LOAD_LEVEL_TARGET "LoadLevelTarget"
 +
 
 +
// ============  DoorLock1  ============
 +
#define DL_SID "urn:micasaverde-com:serviceId:DoorLock1"
 +
 
 +
// Actions
 +
#define DL_SET_TARGET "SetTarget"
 +
#define DL_SET_PIN "SetPin"
 +
#define DL_CLEAR_PIN "ClearPin"
 +
 
 +
// Variables
 +
#define DL_STATUS "Status"
 +
#define DL_TARGET "Target"
 +
#define DL_SL_USER_CODE "sl_UserCode"
 +
#define DL_SL_PIN_FAILED "sl_PinFailed"
 +
 
 +
// ============  HVAC_UserOperatingMode1  ============
 +
#define HVACO_SID "urn:upnp-org:serviceId:HVAC_UserOperatingMode1"
 +
 
 +
// Actions
 +
#define HVACO_SET_MODE "SetModeTarget" 
 +
 
 +
// Variables
 +
#define HVACO_STATUS "ModeStatus" 
 +
 
 +
// ============  HVAC_FanOperatingMode1  ============
 +
#define HVACF_SID "urn:upnp-org:serviceId:HVAC_FanOperatingMode1"
 +
 
 +
// Actions
 +
#define HVACF_SET_MODE "SetMode" 
 +
 
 +
// Variables
 +
#define HVACF_STATUS "ModeStatus" 
 +
 
 +
 
 +
// ============  TemperatureSetpoint1_Heat/Cool  ============
 +
#define HVACHEAT_SID "urn:upnp-org:serviceId:TemperatureSetpoint1_Heat"
 +
#define HVACCOOL_SID "urn:upnp-org:serviceId:TemperatureSetpoint1_Cool"
 +
 
 +
// Variables
 +
#define HVACHC_SETPOINT "SetCurrentSetpoint" 
 +
 
 +
// Variables
 +
#define HVACHC_CURRENTSP "CurrentSetpoint" 
 +
 
 +
// ============  TemperatureSensor1  ============
 +
#define TEMP_SID "urn:upnp-org:serviceId:TemperatureSensor1"
 +
 
 +
// Variables
 +
#define TEMP_CURRENT "CurrentTemperature"
 +
 
 +
// ============  LightSensor1  ============
 +
#define LIGHT_SID "urn:micasaverde-com:serviceId:LightSensor1"
 +
 
 +
// Variables
 +
#define LIGHT_CURRENT "CurrentLevel"
 +
 
 +
// ============  HumiditySensor1  ============
 +
#define HUM_SID "urn:micasaverde-com:serviceId:HumiditySensor1"
 +
 
 +
// Variables
 +
#define HUM_CURRENT "CurrentLevel"
 +
 
 +
// ============  MotionSensor1  ============
 +
#define MOT_SID "urn:micasaverde-com:serviceId:MotionSensor1"
 +
 
 +
// Variables
 +
#define MOT_ARMED "Armed"
 +
#define MOT_TRIPPED "Tripped"
 +
 
 +
// ============  EnergyMetering1  ============
 +
#define ENE_SID "urn:micasaverde-com:serviceId:EnergyMetering1"
 +
 
 +
// Variables
 +
#define ENE_KWH "KWH"
 +
#define ENE_WATT "Watt"
 +
#define ENE_ACTUAL "ActualUsage"
 +
#define ENE_USER_SUPPLIED "UserSuppliedWattage"
 +
 
 +
// ============  IrTransmitter1  ============
 +
#define IRT_SID "urn:micasaverde-com:serviceId:IrTransmitter1"
 +
 
 +
// Variables
 +
#define IRT_SENDPRONTO "SendProntoCode"
 +
 
 +
 
 +
// ============  SerialPort1  ============
 +
#define SPT_SID "urn:micasaverde-org:serviceId:SerialPort1"
 +
 
 +
// Variables
 +
#define SPT_BAUD "baud"
 +
 
 +
// ============  SceneController1  ============
 +
#define SCR_SID "urn:micasaverde-com:serviceId:SceneController1"
 +
 
 +
// Variables
 +
#define SCR_SL_BUTTON_PRESSED "sl_SceneButtonPressed"
 +
 
 +
#endif

Revision as of 23:53, 28 June 2009

The following is the contents of the file "Constant.h" which defines the strings used for file device types, services, actions, variables, etc.

/*

    Copyright (C) 2008 Mi Casa Verde, Inc., a Nevada Corporation

All rights reserved. This software may not be used or distributed without express consent

  • /
  1. ifndef Constants_h
  2. define Constants_h

// Device Types

  1. define DEVICETYPE_BINARY_LIGHT "urn:schemas-upnp-org:device:BinaryLight:1"
  2. define DEVICETYPE_DIMMABLE_LIGHT "urn:schemas-upnp-org:device:DimmableLight:1"
  3. define DEVICETYPE_THERMOSTAT "urn:schemas-upnp-org:device:HVAC_ZoneThermostat:1"
  4. define DEVICETYPE_HUMIDITY_SENSOR "urn:schemas-micasaverde-com:device:HumiditySensor:1"
  5. define DEVICETYPE_MULTI_IO "urn:schemas-micasaverde-com:device:MultiIO:1"
  6. define DEVICETYPE_DOOR_LOCK "urn:schemas-micasaverde-com:device:DoorLock:1"
  7. define DEVICETYPE_DOOR_SENSOR "urn:schemas-micasaverde-com:device:DoorSensor:1"
  8. define DEVICETYPE_ZWAVE_NETWORK "urn:schemas-micasaverde-com:device:ZWaveNetwork:1"
  9. define DEVICETYPE_TEMPERATURE_SENSOR "urn:schemas-micasaverde-com:device:TemperatureSensor:1"
  10. define DEVICETYPE_MOTION_SENSOR "urn:schemas-micasaverde-com:device:MotionSensor:1"
  11. define DEVICETYPE_LIGHT_SENSOR "urn:schemas-micasaverde-com:device:LightSensor:1"
  12. define DEVICETYPE_IR_TRANSMITTER "urn:schemas-micasaverde-com:device:IrTransmitter:1"
  13. define DEVICETYPE_WINDOW_COVERING "urn:schemas-micasaverde-com:device:WindowCovering:1"
  14. define DEVICETYPE_GENERIC_IO "urn:schemas-micasaverde-com:device:GenericIO:1"
  15. define DEVICETYPE_REMOTE_CONTROL "urn:schemas-micasaverde-com:device:RemoteControl:1"
  16. define DEVICETYPE_COMBO_DEVICE "urn:schemas-micasaverde-com:device:ComboDevice:1"
  17. define DEVICETYPE_CAMERA "urn:schemas-upnp-org:device:DigitalSecurityCamera:1"
  18. define DEVICETYPE_SERIALPORT "urn:micasaverde-org:device:SerialPort:1"
  19. define DEVICETYPE_SCENE_CONTROLLER "urn:schemas-micasaverde-com:device:SceneController:1"

// Device Files

  1. define DEVICEFILE_BINARY_LIGHT "D_BinaryLight1.xml"
  2. define DEVICEFILE_DIMMABLE_LIGHT "D_DimmableLight1.xml"
  3. define DEVICEFILE_THERMOSTAT "D_HVAC_ZoneThermostat1.xml"
  4. define DEVICEFILE_HUMIDITY_SENSOR "D_HumiditySensor1.xml"
  5. define DEVICEFILE_MULTI_IO "D_GC100.xml"
  6. define DEVICEFILE_DOOR_LOCK "D_DoorLock1.xml"
  7. define DEVICEFILE_DOOR_SENSOR "D_MotionSensor1.xml"
  8. define DEVICEFILE_ZWAVE_NETWORK "D_ZWaveNetwork.xml"
  9. define DEVICEFILE_TEMPERATURE_SENSOR "D_TemperatureSensor1.xml"
  10. define DEVICEFILE_MOTION_SENSOR "D_MotionSensor1.xml"
  11. define DEVICEFILE_LIGHT_SENSOR "D_LightSensor1.xml"
  12. define DEVICEFILE_IR_TRANSMITTER "D_IrTransmitter1.xml"
  13. define DEVICEFILE_WINDOW_COVERING "D_DimmableLight1.xml"
  14. define DEVICEFILE_GENERIC_IO "D_BinaryLight1.xml"
  15. define DEVICEFILE_REMOTE_CONTROL "D_BinaryLight1.xml"
  16. define DEVICEFILE_COMBO_DEVICE "D_BinaryLight1.xml"
  17. define DEVICEFILE_CAMERA "D_DigitalSecurityCamera1.xml"
  18. define DEVICEFILE_SCENE_CONTROLLER "D_DoorLock1.xml"

// Device Categories

  1. define DEVICE_CATEGORY_INTERFACE 1
  2. define DEVICE_CATEGORY_DIMMABLE_LIGHT 2
  3. define DEVICE_CATEGORY_SWITCH 3
  4. define DEVICE_CATEGORY_SECURITY_SENSOR 4
  5. define DEVICE_CATEGORY_HVAC 5
  6. define DEVICE_CATEGORY_CAMERA 6
  7. define DEVICE_CATEGORY_DOOR_LOCK 7
  8. define DEVICE_CATEGORY_WINDOW_COV 8
  9. define DEVICE_CATEGORY_REMOTE_CONTROL 9
  10. define DEVICE_CATEGORY_IR_TX 10
  11. define DEVICE_CATEGORY_GENERIC_IO 11
  12. define DEVICE_CATEGORY_GENERIC_SENSOR 12

// Cast the second one between int and char * so we can use a simple // array that's fast to iterate and not use an stl map extern const char *g_DeviceCategories[]; extern const char *g_DeviceDescriptions[]; // Default descriptions

// These are stored in the json file for the device itself and not part of the UPNP variables:

/* Device_Num FK_DevType Device_Num_Parent FK_Device_Category Room_Num

Description InternalID // DEVICEDATA_PortChannel_Number_CONST Manufacturer // DEVICEDATA_Manufacturer_Desc_CONST Model // DEVICEDATA_Model_Desc_CONST IPAddress MacAddress UPnPDeviceFile // DEVICEDATA_UPnP_Dev_File_CONST

  • /

// ============ HaGateway ============ // Basic functionality for the gateway itself

  1. define HAGEVICE_FILE "S_HomeAutomationGateway1.xml"
  2. define HAGEVICE_SID "urn:micasaverde-com:serviceId:HomeAutomationGateway1"
  3. define HAGEVICE_STYPE "urn:schemas-micasaverde-org:service:HomeAutomationGateway:1"

// Variables

// Actions

  1. define HAG_GET_USER_DATA "GetUserData"
  2. define HAG_MODIFY_USER_DATA "ModifyUserData"
  3. define HAG_MODIFY_GET_VARIABLE "GetVariable"
  4. define HAG_MODIFY_SET_VARIABLE "SetVariable"
  5. define HAG_MODIFY_GET_STATUS "GetStatus"
  6. define HAG_MODIFY_GET_ACTIONS "GetActions"
  7. define HAG_MODIFY_CREATE_DEVICE "CreateDevice"
  8. define HAG_PROCESS_CHILD "ProcessChildDevices"
  9. define HAG_RELOAD "Reload"
  10. define HAG_RUN_SCENE "RunScene"
  11. define HAG_RUN_LUA "RunLua"


// ============ HaDevice ============ // Basic functionality for all home automation devices

  1. define HADEVICE_FILE "S_HaDevice1.xml"
  2. define HADEVICE_SID "urn:micasaverde-com:serviceId:HaDevice1"
  3. define HADEVICE_STYPE "urn:schemas-micasaverde-com:service:HaDevice:1"

// Variables

  1. define HAD_ENERGY_LOG "EnergyLog" // DEVICEDATA_Energy_Log_CONST
  2. define HAD_WATTS "Watts" // DEVICEDATA_Wattage_CONST
  3. define HAD_IOPORT_DEVICE "IODevice" // The device number to connect to for IO (this is on the master device)
  4. define HAD_IOPORT_PORT "IOPort" // The port to receive connections on from HAD_IOPORT_DEVICE (this is on the serial port)
  5. define HAD_IGNORE_ROOM "IgnoreRoom"
  6. define HAD_COMM_FAILURE "CommFailure"
  7. define HAD_POLLING_ENABLED "PollingEnabled"
  8. define HAD_POLL_MIN_DELAY "PollMinDelay"
  9. define HAD_CONFIGURED "Configured"
  10. define HAD_JOBID "JobID"
  1. define HAD_RECONFIGURE "Reconfigure"
  2. define HAD_REMOVE "Remove"
  3. define HAD_POLL "Poll"
  4. define HAD_SET_POLL_FREQUENCY "SetPollFrequency"

// ============ ZWaveNetwork ============ // Basic functionality for all ZWave devices

  1. define ZWN_FILE "S_ZWaveNetwork1.xml"
  2. define ZWN_SID "urn:micasaverde-com:serviceId:ZWaveNetwork1"
  3. define ZWN_STYPE "urn:schemas-micasaverde-org:service:ZWaveNetwork:1"
  1. define ZWN_RESET_NETWORK "ResetNetwork"
  2. define ZWN_REMOVE_NODES "RemoveNodes"
  3. define ZWN_ADD_NODES "AddNodes"
  4. define ZWN_DOWNLOAD "DownloadNetwork"
  5. define ZWN_HEAL_NETWORK "HealNetwork"
  6. define ZWN_SET_POLLING "SetPolling"
  7. define ZWN_SEND_DATA "SendData"
  8. define ZWN_POLL_ALL_NODES "PollAllNodes"

// Variables

  1. define ZWN_LAST_UPDATE "LastUpdate" // DEVICEDATA_LastUpdate_CONST
  2. define ZWN_AUTO_CONFIGURE "AutoConfigure" // DEVICEDATA_Auto_Configure_CONST
  3. define ZWN_NET_STATUS_ID "NetStatusID"
  4. define ZWN_NET_STATUS_TEXT "NetStatusText"
  5. define ZWN_COM_PORT "ComPort" // DEVICEDATA_COM_Port_on_PC_CONST
  6. define ZWN_NODE_ID "NodeID" // The dongle's id
  7. define ZWN_VERSION_INFO "VersionInfo"
  8. define ZWN_HOME_ID "HomeID"
  9. define ZWN_ROLE "Role"
  10. define ZWN_RESET_MODE "ResetMode"
  11. define ZWN_INCLUSION_MODE "InclusionMode"
  12. define ZWN_NODETYPE "NodeType"
  13. define ZWN_TIMEOUT "Timeout"
  14. define ZWN_MULTIPLE "Multiple"
  15. define ZWN_SIMULATE_INCOMING "SimulateIncomingData"
  16. define ZWN_POLL_ENABLED "PollingEnabled"
  17. define ZWN_POLL_DELAY_INITIAL "PollDelayInitial"
  18. define ZWN_POLL_DELAY_DEADTIME "PollDelayDeadTime"
  19. define ZWN_POLL_MINDELAY "PollMinDelay"
  20. define ZWN_POLL_FREQUENCY "PollFrequency"
  21. define ZWN_LAST_ERROR "LastError"

// ============ ZWaveDevice ============ // Basic functionality for all ZWave devices

  1. define ZWDEVICE_FILE "S_ZWaveDevice1.xml"
  2. define ZWDEVICE_SID "urn:micasaverde-com:serviceId:ZWaveDevice1"
  3. define ZWDEVICE_STYPE "urn:schemas-micasaverde-com:service:ZWaveDevice:1"

// Variables

  1. define ZWD_LAST_UPDATE "LastUpdate" // DEVICEDATA_LastUpdate_CONST
  2. define ZWD_AUTO_CONFIGURE "AutoConfigure" // DEVICEDATA_Auto_Configure_CONST
  3. define ZWD_POLL_SETTINGS "PollSettings" // DEVICEDATA_Polling_Settings_CONST
  4. define ZWD_REVERSE "ReverseOnOff" // DEVICEDATA_Reverse_CONST
  5. define ZWD_MULTCH_ENDPOINT "MultiChEndpoint" // DEVICEDATA_Multi_Channel_End_Point_CONST
  6. define ZWD_MULTCH_CAPABIL "MultiChCapabilities" // DEVICEDATA_Multi_Channel_Capabilities_CONST

// ZWD_MULTCH_ENDPOINT string m_sMultiChannelList, // If m_cProtocolVersion>=2 (multi channel), then If this has embedded devices, Format: [number of end points] , [0/1 end points are dynamic], [0/1 end points are identical] // If m_cProtocolVersion<2 (multi instance), then the total number of instances // ZWD_MULTCH_CAPABIL m_sMultiChannelCapability; // m_cProtocolVersion>=2, if this has devices, Format: [end point #], Generic device class, Specific device class, command class 1, command class 2.... \n repeat next end point // If m_cProtocolVersion<2, command class, # of instances \n repeat command class

  1. define ZWD_NEIGHBORS "Neighbors" // DEVICEDATA_Neighbors_to_Call_CONST
  2. define ZWD_CAPABILITIES "Capabilities" // DEVICEDATA_Capabilities_CONST
  3. define ZWD_CONFIG "Configuration" // DEVICEDATA_Configuration_CONST
  4. define ZWD_LAST_RESET "LastReset" // DEVICEDATA_Last_Reset_CONST
  5. define ZWD_SCENES_AS_EVENTS "ScenesAsEvents" // DEVICEDATA_Scenes_As_Events_CONST
  6. define ZWD_SCENES "Scenes" // DEVICEDATA_Scenes_CONST
  7. define ZWD_WAKEUP_INTERVAL "WakeupInterval" // DEVICEDATA_Wakeup_Interval_CONST
  8. define ZWD_PIN_CODES "PinCodes" // DEVICEDATA_PIN_Codes_CONST
  9. define ZWD_BATTERY_LEVEL "BatteryLevel" // DEVICEDATA_Battery_Level_CONST
  10. define ZWD_LAST_WAKEUP "LastWakeup" // DEVICEDATA_Last_Wakeup_CONST
  11. define ZWD_LAST_ROUTE_UPD "LastRouteUpdate" // DEVICEDATA_Last_Route_Update_CONST
  12. define ZWD_VARIABLES_GET "VariablesGet" // DEVICEDATA_Variables_Get_CONST
  13. define ZWD_VARIABLES_SET "VariablesSet" // DEVICEDATA_Variables_Set_CONST
  14. define ZWD_ASSOCIATION_GET "AssociationGet" // DEVICEDATA_Association_Get_CONST
  15. define ZWD_ASSOCIATION_SET "AssociationSet" // DEVICEDATA_Association_Set_CONST
  16. define ZWD_MANUF_INFO "ManufacturerInfo" // DEVICEDATA_Model_CONST
  17. define ZWD_VERSION_INFO "VersionInfo" // DEVICEDATA_Configuration_CONST
  18. define ZWD_UPDATED_NAME "UpdatedName" // DEVICEDATA_Update_Name_CONST

// ============ Camera ============ // Basic functionality for all Cameras

  1. define CAMDEVICE_FILE "S_Camera1.xml"
  2. define CAMDEVICE_SID "urn:micasaverde-com:serviceId:Camera1"
  3. define CAMDEVICE_STYPE "urn:schemas-micasaverde-com:service:Camera:1"

// Variables

  1. define CAM_USERNAME "Username" // DEVICEDATA_AuthUser_CONST
  2. define CAM_PASSWORD "Password" // DEVICEDATA_AuthPassword_CONST
  3. define CAM_ARCHIVE_SETTINGS "ArchiveSettings" // DEVICEDATA_Video_settings_CONST
  4. define CAM_RELATED_DEVICES "RelatedDevices" // DEVICEDATA_sDevice_Num_Relations_For_Creat_CONST
  5. define CAM_URL "URL" // DEVICEDATA_Path_CONST

// ============ PanTiltZoom ============ // For Cameras

  1. define PTZ_FILE "S_PanTiltZoom1.xml"
  2. define PTZ_SID "urn:micasaverde-com:serviceId:PanTiltZoom1"
  3. define PTZ_STYPE "urn:schemas-micasaverde-com:service:PanTiltZoom:1"

// Actions

  1. define PTZ_LEFT "MoveLeft"
  2. define PTZ_RIGHT "MoveRight"
  3. define PTZ_UP "MoveUp"
  4. define PTZ_DOWN "MoveDown"
  5. define PTZ_IN "ZoomIn"
  6. define PTZ_OUT "ZoomOut"

// ============ SwitchPower1 ============

  1. define SWP_SID "urn:upnp-org:serviceId:SwitchPower1"

// Actions

  1. define SWP_SET_TARGET "SetTarget"

// Variables

  1. define SWP_STATUS "Status"
  2. define SWP_TARGET "Target"

// ============ Dimming1 ============

  1. define SWD_SID "urn:upnp-org:serviceId:Dimming1"

// Actions

  1. define SWD_SET_LOAD_LEVEL "SetLoadLevelTarget"

// Variables

  1. define SWD_LOAD_LEVEL_STATUS "LoadLevelStatus"
  2. define SWD_LOAD_LEVEL_TARGET "LoadLevelTarget"

// ============ DoorLock1 ============

  1. define DL_SID "urn:micasaverde-com:serviceId:DoorLock1"

// Actions

  1. define DL_SET_TARGET "SetTarget"
  2. define DL_SET_PIN "SetPin"
  3. define DL_CLEAR_PIN "ClearPin"

// Variables

  1. define DL_STATUS "Status"
  2. define DL_TARGET "Target"
  3. define DL_SL_USER_CODE "sl_UserCode"
  4. define DL_SL_PIN_FAILED "sl_PinFailed"

// ============ HVAC_UserOperatingMode1 ============

  1. define HVACO_SID "urn:upnp-org:serviceId:HVAC_UserOperatingMode1"

// Actions

  1. define HVACO_SET_MODE "SetModeTarget"

// Variables

  1. define HVACO_STATUS "ModeStatus"

// ============ HVAC_FanOperatingMode1 ============

  1. define HVACF_SID "urn:upnp-org:serviceId:HVAC_FanOperatingMode1"

// Actions

  1. define HVACF_SET_MODE "SetMode"

// Variables

  1. define HVACF_STATUS "ModeStatus"


// ============ TemperatureSetpoint1_Heat/Cool ============

  1. define HVACHEAT_SID "urn:upnp-org:serviceId:TemperatureSetpoint1_Heat"
  2. define HVACCOOL_SID "urn:upnp-org:serviceId:TemperatureSetpoint1_Cool"

// Variables

  1. define HVACHC_SETPOINT "SetCurrentSetpoint"

// Variables

  1. define HVACHC_CURRENTSP "CurrentSetpoint"

// ============ TemperatureSensor1 ============

  1. define TEMP_SID "urn:upnp-org:serviceId:TemperatureSensor1"

// Variables

  1. define TEMP_CURRENT "CurrentTemperature"

// ============ LightSensor1 ============

  1. define LIGHT_SID "urn:micasaverde-com:serviceId:LightSensor1"

// Variables

  1. define LIGHT_CURRENT "CurrentLevel"

// ============ HumiditySensor1 ============

  1. define HUM_SID "urn:micasaverde-com:serviceId:HumiditySensor1"

// Variables

  1. define HUM_CURRENT "CurrentLevel"

// ============ MotionSensor1 ============

  1. define MOT_SID "urn:micasaverde-com:serviceId:MotionSensor1"

// Variables

  1. define MOT_ARMED "Armed"
  2. define MOT_TRIPPED "Tripped"

// ============ EnergyMetering1 ============

  1. define ENE_SID "urn:micasaverde-com:serviceId:EnergyMetering1"

// Variables

  1. define ENE_KWH "KWH"
  2. define ENE_WATT "Watt"
  3. define ENE_ACTUAL "ActualUsage"
  4. define ENE_USER_SUPPLIED "UserSuppliedWattage"

// ============ IrTransmitter1 ============

  1. define IRT_SID "urn:micasaverde-com:serviceId:IrTransmitter1"

// Variables

  1. define IRT_SENDPRONTO "SendProntoCode"


// ============ SerialPort1 ============

  1. define SPT_SID "urn:micasaverde-org:serviceId:SerialPort1"

// Variables

  1. define SPT_BAUD "baud"

// ============ SceneController1 ============

  1. define SCR_SID "urn:micasaverde-com:serviceId:SceneController1"

// Variables

  1. define SCR_SL_BUTTON_PRESSED "sl_SceneButtonPressed"
  1. endif
Personal tools