Luup UPnP Variables and Actions

From MiOS
Revision as of 17:15, 4 September 2012 by Mcvflorin (Talk | contribs)

Jump to: navigation, search

Contents

HomeAutomationGateway1

  • Service ID: urn:micasaverde-com:serviceId:HomeAutomationGateway1
  • File: S_HomeAutomationGateway1.xml


Variable Type Description
DataVersion ui4 A number that increases each time the data changes.
UDN string The Unique Device Name of the UPnP device.


Action Arguments Description
Name Related variable/type
Reload none Reload the LuaUPnP engine.
ModifyUserData inUserData UserData Make changes to the UserData.
  • inUserData is the new UserData object which will be added to the UserData or will replace an existent UserData object.
  • DataFormat must be json.
  • If Reload is 1 the LuaUPnP engine will reload after the UserData is modified.

For more information read the ModifyUserData page.

DataFormat string
Reload boolean
SetVariable DeviceNum ui4 or string Create or change the value of a variable.
  • DeviceNum can be an UDN or a number.
  • Service is the service ID of the variable.
  • Variable is the variable name.
  • Value is the new variable value.
Service string
Variable string
Value string
RunScene SceneNum ui4 Run the given scene.
SceneOff SceneNum ui4 Turn off all the devices from DEVICE_CATEGORY_DIMMABLE_LIGHT and DEVICE_CATEGORY_SWITCH from the given scene.
RunLua DeviceNum ui4 or string Run the given Lua code. If DeviceNum is specified, the code is run using that device's interface.
Code string
CreateDevice deviceType string Create a device using the given parameters.
  • deviceType is the UPnP device type.
  • internalID is the specific ID (also known as altid) of the device; for example, for Z-Wave devices this is the Node ID, and for Insteon device it is the Insteon ID.
  • Description is the device name, which is shown to the user on the dashboard.
  • UpnpDevFilename is the UPnP device description file name.
  • UpnpImplFilename is the implementation file to use.
  • If the device is IP based, IpAddress is the IP address and port of the device.
  • If this should be the child of another device, DeviceNumParent is the device number of the parent device.
  • RoomNum is the number of the room the device will be in.
  • StateVariables is a string containing the variables you want set when the device is created. You can specify multiple variables by separating them with a line feed ('\n'), and use ',' and '=' to separate service, variable and value, like this: service,variable=value\nservice,variable=value\n...
internalID string
Description string
UpnpDevFilename string
UpnpImplFilename string
IpAddress string
MacAddress string
DeviceNumParent ui4
RoomNum ui4
StateVariables string
DeleteDevice DeviceNum ui4 Delete the device given either through its number, or through its UDN.
UDN string
CreatePlugin PluginNum ui4 Create a plugin with the PluginNum number and Version version. StateVariables are the variables that will be set when the device is created. For more information look at the description of the CreateDevice action above.
Version ui4
StateVariables string
DeletePlugin PluginNum ui4 Uninstall the given plugin.
CreatePluginDevice PluginNum ui4 Creates a device for plugin #PluginNum.
StateVariables string
ImportUpnpDevice UDN UDN
RoomNum DeviceNum
LogIpRequest IpAddress UDN
MacAddress UDN

HaDevice1

  • Service ID: urn:micasaverde-com:serviceId:HaDevice1
  • File: S_HaDevice1.xml


Variable Type Description
CommFailure boolean This is set to 1 if we've lost communication with the device.
Configured boolean The configuration state of the device:
  • -3 = Configuration failed
  • -2 = Configuration in process
  • -1 = Device waiting to be configured
  • 0 = Device not configured
  • 1 = Device successfully configured
  • 2 = Device partially configured
PollingEnabled boolean This is 1 if polling is enabled for this device, meaning that MiOS can automatically poll the device for its status.
PollMinDelay ui1 The minimum interval for polling. MiOS won't poll this device more often that this interval.
BatteryLevel i1 The battery level reported by the device.


Action Arguments Description
Name Related variable/type
Reconfigure none Reconfigure the device.
StressTest none Stress test the Z-Wave device.
Remove none Remove the device from the Z-Wave network.
Poll none Poll the device.
ToggleState none Toggle the state of the device (e.g. if the device it's Off, turns it On). The device must have a binary state (On/Off, Locked/Unlocked, etc.).
SetPollFrequency PollingEnabled PollingEnabled Sets the PollMinDelay variable.
PollMinDelay PollMinDelay


ZWaveNetwork1

  • Service ID: urn:micasaverde-com:serviceId:ZWaveNetwork1
  • File: S_ZWaveNetwork1.xml


Variable Type Description
NetStatusID ui1 The status of the Z-Wave network:
  • 0 = Status not set
  • 1 = OK
  • 2 = Quiting
  • 3 = Waiting to quit
  • 4 = No dongle
  • 5 = Configuring: still running init/configure scripts
  • 6 = Failure
  • 7 = Initializing
NetStatusText string Full Z-Wave network status description
LastError string The last Z-Wave error in the network
LastUpdate ui4 The UNIX time when the Z-Wave component of the LuaUPnP engine started.
LastDongleBackup ui4 The UNIX time of the last Z-Wave dongle backup.
LastHeal ui4 The UNIX time of the last Z-Wave network heal.
VersionInfo boolean The Z-Wave version.
HomeID boolean The unique ID of the Z-Wave network.
Role boolean Z-Wave specific stuff.
TO3066 boolean Internal stuff.
ComPort string This is the port where MiOS will search for the Z-Wave dongle. On Vera Lite, this is /dev/ttyS0.
LockComPort boolean If this is "1", MiOS won't search for the Z-Wave dongle on the other available ports if it doesn't find it on ComPort.
Use45 boolean If this is "1", use Z-Wave version 3.20 instead of 2.78.
UseMR boolean If this is "1", use MiOS routing.
LimitNeighbors boolean With MiOS routing: if this is "1", when the routing table is created, consider only Z-Wave's neighbors as valid options.
PollingEnabled boolean If this is "1", MiOS will automatically poll the Z-Wave devices.
PollDelayInitial ui1 Number of seconds after the LuaUPnP engine has (re-)started before the polling loop begins.
PollDelayDeadTime ui1 Number of seconds MiOS must not have transmitted any non-poll command before the next poll command is sent.
PollMinDelay ui1 Number of seconds between poll commands.
PollFrequency ui1 Minimum number of seconds between poll commands to the same node.


Action Arguments Description
Name Related variable/type
ResetNetwork ResetMode string Reset the Z-Wave network.
  • ResetMode can be "SIS" or "SUC".
  • HomeID is a 32 bit hex number representing the new HomeID. If this parameter doesn't exist or is 0, MiOS will generate the new HomeID.
  • ZeroMemory: if this is "1", the memory will be zeroed before resetting.
HomeID string
ZeroMemory boolean
PutByte StartAddress string Used to convert Z-Wave from 2.78 to 3.20 in which case the StartAddress parameter must be "convert502_452" and the rest are ignored.
StopAddress string
Value ui4
ReconfigureAllNodes FailedOnly boolean Reconfigure the Z-Wave nodes. If FailedOnly is "1", only the devices that failed to configure are reconfigured.
UpdateNetwork none Get network update from SUC/SIS.
UpdateNeighbors Device ui4 Update the neighbor nodes of the given device. Device is the device number.
BackupDongle Restore boolean Backs up the Z-Wave network. The backup is in /etc/cmh/dongle.dump. If Restore is "1", the Z-Wave network is restored from the backup.
PollAllNodes none -
RemoveNodes InclusionMode string Puts Vera in exclude mode.
  • InclusionMode can be "FullPower" or anything else, in which case the exclusion will be low power.
  • NodeType is the type of node to be excluded. The valid values are:
    • 1 = any
    • 2 = controller
    • 3 = slave
    • 4 = existing
    • 5 = stop
  • Timeout is the number of seconds Vera will be in exclude mode.
  • If Multiple is "0" then Vera will exit exclude mode after a node is excluded.
  • If Reload is "1" the LuaUPnP engine will be restarted after Vera exits exclude mode.
NodeType ui1
Timeout ui1
Multiple boolean
Reload boolean
AddNodes InclusionMode string Puts Vera in include mode.
  • InclusionMode can be "FullPower" or anything else, in which case the inclusion will be low power.
  • NodeType is the type of node to be included. The valid values are:
    • 1 = any
    • 2 = controller
    • 3 = slave
    • 4 = existing
    • 5 = stop
  • Timeout is the number of seconds Vera will be in include mode.
  • If Multiple is "0" then Vera will exit include mode after a node is included.
  • ControllerShift must be "0".
  • If Reload is "1" the LuaUPnP engine will be restarted after Vera exits include mode.
NodeType ui1
Timeout ui1
Multiple boolean
ControllerShift boolean
Reload boolean
DownloadNetwork none Copy the Z-Wave network from a master controller.
HealNetwork BatteryMinutes ui1 Heals/consolidates the Z-Wave network.
  • BatteryMinutes: how many minutes to wait for battery operated devices to be discovered.
  • If Node is not blank, then only this node will be repaired.
  • StressCycles is the number of cycles to stress test each node.
  • If Configure is "1", then all the devices will be re-configured when done.
  • If ManualRoute is "1", then only update MiOS routing (overrides other settings).
  • StartStage is the starting heal stage. The valid values are:
    • 1 = Request network update.
    • 2 = Request neighbor node update.
    • 3 = Update the routing tables and neighbor nodes.
    • 4 = Calculate the best routes.
    • 5 = Re-configure all nodes.
    • 6 = Wait BatteryMinutes to request neighbor node update and configure all battery operated nodes.
    • 7 = Do a stress test for StressCycles.
  • StopStage: Same as StartStage.
Node ui1
StressCycles ui1
Configure boolean
ManualRoute boolean
StartStage ui1
StopStage ui1
SetPolling IsTemporary boolean Set the polling parameters.
  • If IsTemporary is "1", then these polling settings will be lost when the LuaUPnP engine is reloaded.
  • PollingEnabled: see the related variable.
  • PollDelayInitial: see the related variable.
  • PollDelayDeadTime: see the related variable.
  • PollMinDelay: see the related variable.
  • PollFrequency: see the related variable.
PollingEnabled PollingEnabled
PollDelayInitial PollDelayInitial
PollDelayDeadTime PollDelayDeadTime
PollMinDelay PollMinDelay
PollFrequency PollFrequency
SendData Node ui1 Sends the Z-Wave Data to the Z-Wave Node.
Data string
SimulateIncomingData Data string Calls the Z-Wave message handler for the given data.

InsteonNetwork1

  • Service ID: urn:micasaverde-com:serviceId:InsteonNetwork1
  • File: S_InsteonNetwork1.xml


Variable Type Description
Node string


Action Arguments Description
Name Related variable/type
ResetNetwork none
RemoveNodes none
AddNodes none
StopAddRemoveNodes none
SendData Node Node
Data Node


USBUIRT1

  • Service ID: urn:micasaverde-com:serviceId:USBUIRT1
  • File: S_USBUIRT.xml


Variable Type Description
ComPort string The path of the USB port the UIRT is connected to. On Vera Lite this is /dev/ttyUSB0

Camera1

  • Service ID: urn:micasaverde-com:serviceId:Camera1
  • File: S_Camera1.xml


Variable Type Description
VideoURLs string This variable defines the streaming parameters, and without it streaming doesn't work. This variable has this structure:

Info1:URL1:Info2:URL2:


The Info parameters are:

1. The protocol: can be rtsp or http

2. HTTP authentication required: 1 = yes, send the username and password in the request, 0 = no, don't send the username and password

3. Video codec: mpeg4 | mjpeg | etc.

4. Audio codec: blank = no audio

5. Resolution: t = thumbnail, s = small, m = medium, l = large

6. Width: 640

7. Height: 480

8. Players: q|a|i|w, a string of characters indicating known good players. q = Quicktime plugin, a = Android, i = iPhone, w = normal web browser.


The URL is the streaming URL compatible with the players specified in Info.

Currently only the protocol, players and URL parameters are used. The rest of the parameters are ignored.


VideoURLs example for VistaCam:

rtsp,0,mpeg4,,m,640,480,qai:img/media.sav:http,0,mjpeg,,m,640,480,w:img/video.mjpeg:

URL string This is the URL to get a snapshot from the camera.
RelatedSensors string Comma separated list of device numbers: archive a photo whenever one of the sensors is tripped.
SensorArchiveSeconds ui4 How many seconds to archive the video after the sensor(s) are tripped.
RelatedLights string Comma separated list of device numbers: which lights should be turned on when viewing this camera.
LightOptions string When to turn on the lights:
  • V: when I view the camera from the web or phone;
  • S: when the sensor(s) above are tripped and they are armed;
  • B: when the sensors above are tripped and they are *not* armed;
  • A: when you take an automatic picture for the archive;

So VSBA means do them all.

AutoArchiveSeconds ui4 Archives a picture from the camera every this number of seconds.
AutoArchivePreserveDays ui4 How many days to keep the pictures in the archive.

PanTiltZoom1

  • Service ID: urn:micasaverde-com:serviceId:PanTiltZoom1
  • File: S_PanTiltZoom1.xml


Action Arguments Description
Name Related variable/type
MoveLeft none -
MoveRight none -
MoveUp none -
MoveDown none -
ZoomIn none -
ZoomOut none -
GoToPreset presetNumber ui1 Moves the camera to the given preset.

SwitchPower1

  • Service ID: urn:upnp-org:serviceId:SwitchPower1
  • File: S_SwitchPower1.xml


Variable Type Description
Target boolean The target state of the device.
Status boolean The current state of the device.


Action Arguments Description
Name Related variable/type
SetTarget newTargetValue Target Sets the target state of the device. Used to turn a device On or Off.

WindowCovering1

  • Service ID: urn:upnp-org:serviceId:WindowCovering1
  • File: S_WindowCovering1.xml


Action Arguments Description
Name Related variable/type
Up none -
Down none -
Stop none -

Dimming1

  • Service ID: urn:upnp-org:serviceId:Dimming1
  • File: S_Dimming1.xml


Variable Type Description
LoadLevelTarget ui1 The target dimming value; it doesn't represent the actual dimming state.
LoadLevelStatus ui1 Represents the actual dimming state.


Action Arguments Description
Name Related variable/type
SetLoadLevelTarget newLoadlevelTarget LoadLevelTarget Sets the desired dimming level. Used to adjust the dimming level of a device.

DoorLock1

  • Service ID: urn:micasaverde-com:serviceId:DoorLock1
  • File: S_DoorLock1.xml


Variable Type Description
Target boolean Represents the target (desired) door state.
Status boolean Represents the current door state. "1" = locked, "0" = unlocked
PinCodes string The list of PIN codes.

Syntax:

<VERSION=2>user_code_index_number,active,PIN_code(encrypted),name(a-z,0-9);
slotid,slotid_lock,w,[d|s],dow,hour_start,minute_start,hour_stop,minute_stop;
slotid,slotid_lock,t,[d|s],start,stop;\t

Where:

  • VERSION is used to track syntax changes.
  • active can be one of the following values:
    • 1 = The code is permanently programmed into the lock, which doesn't support hardware-based scheduling.
    • 2 = The code is permanently programmed into the lock, which does support hardware-based scheduling.
    • 3 = The code is programmed into the lock and will be removed by software later.
    • 4 = The code is not programmed into the lock, but will be later by the software.
    • 5 = The code is programmed into the lock which supports hardware-based scheduling and will enable/disable it automatically.
  • The slotid is an auto-incrementing number.
  • The slotid_lock is the ID in the lock.
  • The restriction type: w (weekly) or d (daily repeating) = day of week based, t = time based (yearly)
  • [d|s]: internal stuff.
NumSchedules string Maximum number of restrictions supported by the door lock.

Syntax:

max_weekly,max_yearly,max_daily_repeating

Where:

  • max_weekly is the number of weekly restrictions slots.
  • max_yearly is the number of yearly restrictions slots.
  • max_daily_repeating is the number of daily repeating restrictions slots.
MinPinSize and MaxPinSize ui1 The minimum and maximum number of digits of the PIN code.
sl_UserCode string The index number of the last PIN code entered by the user.
sl_PinFailed boolean This becomes "1" when a bad PIN code is entered.
sl_CodeChanged ui1 If a PIN code was changed using the lock keypad, this contains the PIN code index number.
sl_LockButton boolean This is "1" if the Lock button has been pressed on the lock keypad.
sl_LockFailure boolean This is "1" if the lock fails to operate.
sl_UnauthUser boolean This is "1" if the user code was entered outside of a valid date.
sl_LockChanged ui1 If a PIN code was changed using the lock keypad, this contains the PIN code index number.
sl_LowBattery boolean This is "1" when the battery level is low.
sl_VeryLowBattery boolean This is "1" when the battery level is very low.


Action Arguments Description
Name Related variable/type
SetTarget newTargetValue Target Sets the target (desired) state of the door. Used to lock and unlock the door.
SetPin UserCodeName sl_UserCode Adds a PIN code. This code will be added to the PinCodes variable and to the door lock.
  • UserCodeName is the PIN code name.
  • newPin is the new PIN code.
newPin sl_UserCode
SetPinValidityDate UserCode ui1 Sets the daily time interval in which a PIN code is valid.
  • UserCode is the PIN code index number. The starting index is 1.
  • StartDate and StopDate are strings representing the dates, formatted like this: year-month-day hour:minute
  • Replace: If this parameter is "1" the current restriction is replaced with the new one. Otherwise a new restriction is added, unless there are no more available restriction slots.

Example: http://192.168.81.1:3480/data_request?id=action&DeviceNum=6&serviceId=urn:micasaverde-com:serviceId:DoorLock1&action=SetPinValidityDate&UserCode=1&StartDate=2012-09-03+14:00&StopDate=2012-09-03+15:00&Replace=1

StartDate string
StopDate string
Replace boolean
SetPinValidityWeekly UserCode ui1 Sets the weekly time interval in which a PIN code is valid.
  • UserCode is the PIN code index number. The starting index is 1.
  • DayOfWeek contains the days of week numbers when the PIN code is restricted. Monday is '1' and Sunday is '7'.

Example: 1367 means Monday, Wednesday, Saturday and Sunday.

  • StartHour is the hour the restriction starts at.
  • StartMinute is the minute the restriction starts at.
  • StopHour is the hour the restriction stops at.
  • StopMinute is the minute the restriction stops at.
  • Replace: If this parameter is "1" the current restriction is replaced with the new one. Otherwise a new restriction is added, unless there are no more available restriction slots.

Example: http://192.168.81.1:3480/data_request?id=action&DeviceNum=6&serviceId=urn:micasaverde-com:serviceId:DoorLock1&action=SetPinValidityWeekly&UserCode=1&DayOfWeek=1367&StartHour=15&StartMinute=31&StopHour=16&StopMinute=42&Replace=1

DayOfWeek ui4
StartHour ui1
StartMinute ui1
StopHour ui1
StopMinute ui1
Replace boolean
ClearPinValidity UserCode ui4 Clears the given restriction slot.
  • UserCode is the PIN code index number. The starting index is 1.
  • slotID is the slot number. The starting index is 1.
slotID ui4
ClearPin UserCode ui1 Removes the PIN code at index UserCode.

HVAC_UserOperatingMode1

  • Service ID: urn:upnp-org:serviceId:HVAC_UserOperatingMode1
  • File: S_HVAC_UserOperatingMode1.xml


Variable Type Description
ModeTarget string The desired operating mode of the HVAC. Currently MiOS supports only:
  • Off
  • HeatOn
  • CoolOn
  • AutoChangeOver
ModeStatus string The actual operating mode of the HVAC.
EnergyModeTarget string The desired energy mode. Can be Normal or EnergySavingsMode.
EnergyModeStatus string The actual energy mode.


Action Arguments Description
Name Related variable/type
SetModeTarget NewModeTarget ModeTarget Sets the desired HVAC operating mode.
SetEnergyModeTarget NewModeTarget EnergyModeTarget Sets the desired energy mode.

HVAC_OperatingState1

  • Service ID: urn:micasaverde-com:serviceId:HVAC_OperatingState1
  • File: S_HVAC_OperatingState1.xml


Variable Type Description
ModeState string Represents what the HVAC is actually doing right now. The most common actions are:
  • Idle
  • Heating
  • Cooling

HVAC_FanOperatingMode1

  • Service ID: urn:upnp-org:serviceId:HVAC_FanOperatingMode1
  • File: S_HVAC_FanOperatingMode1.xml


Variable Type Description
Mode string The fan operation mode. Can be:
  • Auto
  • ContinuousOn
  • PeriodicOn
FanStatus string Represents the current fan state; can be On or Off.


Action Arguments Description
Name Related variable/type
SetMode NewMode Mode Sets the fan operating mode. Changes the Mode variable.

TemperatureSetpoint1

  • Service ID: urn:upnp-org:serviceId:TemperatureSetpoint1_Heat / urn:upnp-org:serviceId:TemperatureSetpoint1_Cool
  • File: S_TemperatureSetpoint1.xml


Variable Type Description
SetpointTarget i4 The target temperature setpoint.
CurrentSetpoint i4 The actual temperature setpoint.


Action Arguments Description
Name Related variable/type
SetCurrentSetpoint NewCurrentSetpoint CurrentSetpoint Sets the target setpoint.

TemperatureSensor1

  • Service ID: urn:upnp-org:serviceId:TemperatureSensor1
  • File: S_TemperatureSensor1.xml


Variable Type Description
CurrentTemperature i4 -

GenericSensor1

  • Service ID: urn:micasaverde-com:serviceId:GenericSensor1
  • File: S_GenericSensor1.xml


Variable Type Description
CurrentLevel i4 -

LightSensor1

  • Service ID: urn:micasaverde-com:serviceId:LightSensor1
  • File: S_LightSensor1.xml


Variable Type Description
CurrentLevel i4 -

HumiditySensor1

  • Service ID: urn:micasaverde-com:serviceId:HumiditySensor1
  • File: S_HumiditySensor1.xml


Variable Type Description
CurrentLevel i4


SecuritySensor1

  • Service ID: urn:micasaverde-com:serviceId:SecuritySensor1
  • File: S_SecuritySensor1.xml


Variable Type Description
Tripped boolean
Armed boolean This is used by MiOS as a way to disable sending notifications when a sensor is tripped/untripped.
LastTrip i4 This is the UNIX time when the sensor last reported that it was tripped.


Action Arguments Description
Name Related variable/type
SetArmed newArmedValue Armed Arms or disarms the sensor.

EnergyMetering1

  • Service ID: urn:micasaverde-com:serviceId:EnergyMetering1
  • File: S_EnergyMetering1.xml


Variable Type Description
Watts ui4 If the device can report its wattage, this is the value reported by the device, otherwise this is the value supplied by the user in UserSupliedWattage.
Pulse ui4
UserSuppliedWattage ui4 See Watts.
KWH ui4


Action Arguments Description
Name Related variable/type
ResetKWH none

IrTransmitter1

  • Service ID: urn:micasaverde-com:serviceId:IrTransmitter1
  • File: S_IrTransmitter1.xml


Action Arguments Description
Name Related variable/type
SendProntoCode ProntoCode string Sends the given IR code.

SerialPort1

  • Service ID: urn:micasaverde-org:serviceId:SerialPort1
  • File: S_SerialPort1.xml


Variable Type Description
path string The path of the serial port. On Vera Lite it's /dev/ttyUSB0
baud ui4
stopbits ui1
databits ui1
parity string Can be odd or even.

SceneController1

  • Service ID: urn:micasaverde-com:serviceId:SceneController1
  • File: S_SceneController1.xml


Variable Type Description
sl_SceneActivated ui2
sl_SceneDeactivated ui2
Scenes string


SceneControllerLED1

  • Service ID: urn:micasaverde-com:serviceId:SceneControllerLED1
  • File: S_SceneControllerLED1.xml


Variable Type Description
Light ui1


Action Arguments Description
Name Related variable/type
SetLight newValue Light
Indicator Light


IrDevice1

  • Service ID: urn:micasaverde-com:serviceId:IrDevice1
  • File: S_IrDevice1.xml


Variable Type Description
Codesets string
Codeset string
Remote int
Scene string


Action Arguments Description
Name Related variable/type
SendCode Codeset Codeset
Button Remote
Repeat Remote
Personal tools