WeMo
Comment: WeMo is a series of products from Belkin International, Inc. that allows users to control home electronics. The product suite includes the WeMo Switch, WeMo Motion Sensor and WeMo App. The WeMo Switch can be plugged into any home outlet, which can then be controlled from an iOS or Android smartphone running the WeMo App, via home WiFi or mobile phone network.
See http://www.belkin.com/us/Products/home-automation/c/wemo-home-automation/ for more detail.
WeMoSDK provides classes and methods to display, search and control WeMo devices and NotificationListener interface to get notifications from them.
VERY IMPORTANT NOTE: The Belkin WeMo SDK currently only works over local WiFi networks, it does NOT allow control over the internet. This is a limitation of the SDK and not the library.
Author: Trevor Hart
Version: 1
Comment: WeMo is a series of products from Belkin International, Inc. that allows users to control home electronics. The product suite includes the WeMo Switch, WeMo Motion Sensor and WeMo App. The WeMo Switch can be plugged into any home outlet, which can then be controlled from an iOS or Android smartphone running the WeMo App, via home WiFi or mobile phone network.
See http://www.belkin.com/us/Products/home-automation/c/wemo-home-automation/ for more detail.
WeMoSDK provides classes and methods to display, search and control WeMo devices and NotificationListener interface to get notifications from them.
VERY IMPORTANT NOTE: The Belkin WeMo SDK currently only works over local WiFi networks, it does NOT allow control over the internet. This is a limitation of the SDK and not the library.
Author: Trevor Hart
Version: 1
- WeMoDevice
Methods:- IsInitialized As Boolean
- isAvailable As Boolean
It returns the availability of the device (not in official SDK documentation).
- FriendlyName As String [read only]
It returns the name of device. Different devices may have same friendly names. - Logo As String [read only]
It returns the path to logo file in local storage. The return value may be null if local storage is not available. It is recommended to use this method to get the logo. - LogoURL As String [read only]
It returns the URL to device logo. The logo may be downloaded by http. - SerialNumber As String [read only]
It returns the serial number of the device (not in official SDK documentation). - State As String [read only]
It returns the current state of the device. It may be WEMO_DEVICE_ON, WEMO_DEVICE_OFF and WEMO_DEVICE_UNDEFINED (if a problem has occurred during the state update) for switches and sensors. The state of Insight device may be also WEMO_DEVICE_STAND_BY. - Type As String [read only]
It returns the type of device.The possible types are WEMO_TYPE_DEFAULT, WEMO_TYPE_SWITCH, WEMO_TYPE_SENSOR, WEMO_TYPE_LIGHT_SWITCH and WEMO_TYPE_INSIGHT. - UDN As String [read only]
UDN uniquely identifies the device. All notification contains this parameter as argument.
- WeMoSDKContext
Fields:- WEMO_DEVICE_OFF As String
- WEMO_DEVICE_ON As String
- WEMO_DEVICE_STAND_BY As String
- WEMO_DEVICE_UNDEFINED As String
- WEMO_NOTIFY_ADD_DEVICE As String
- WEMO_NOTIFY_CHANGE_STATE As String
- WEMO_NOTIFY_REFRESH_LIST As String
- WEMO_NOTIFY_REMOVE_DEVICE As String
- WEMO_NOTIFY_SET_STATE As String
- WEMO_NOTIFY_UPDATE_DEVICE As String
- WEMO_TYPE_DEFAULT As String
- WEMO_TYPE_INSIGHT As String
- WEMO_TYPE_LIGHT_SWITCH As String
- WEMO_TYPE_SENSOR As String
- WEMO_TYPE_SWITCH As String
- Initialize (EventName As String)
Initializes the WeMoSDKContext and creates the listener from the event name. - IsInitialized As Boolean
- getDeviceState (udn As String) As String
This method returns the state of a device with the udn. If there is no such device it returns WEMO_DEVICE_UNDEFINED value. This method is analogue to WeMoDevice.getState(). - getWeMoDeviceByUDN (udn As String) As WeMoDevice
The method returns the WeMoDevice with provided udn if it exists and null otherwise. - refreshListOfWeMoDevicesOnLAN
This method updates the list of discovered devices and their parameters (the friendly name, the state, the logo). It sends WEMO_NOTIFY_REFRESH_LIST notification on task completion. - setDeviceState (state As String, udn As String)
It changes the state of the device with provided udn to the state passed as 1st parameter and sends notification with WEMO_NOTIFY_SET_STATE event. It is recommended to check the new state of the device by using getState() methods to detect If a problem has occurred during the state update.
- android.permission.ACCESS_COARSE_LOCATION
- android.permission.ACCESS_FINE_LOCATION
- android.permission.ACCESS_NETWORK_STATE
- android.permission.ACCESS_WIFI_STATE
- android.permission.CHANGE_WIFI_STATE
- android.permission.INTERNET
- android.permission.READ_PHONE_STATE
- android.permission.WRITE_EXTERNAL_STORAGE
- ListOfWeMoDevicesOnLAN As List [read only]
It returns the list with UDNs of discovered devices. This method should be called on WEMO_NOTIFY_REFRESH_LIST notification to get up-to-date information. It doesn't update the device parameters.
Attachments
Last edited: