Enable Allow2Automate the ability to control Wemo smart devices for IoT-based parental controls and home automation.
This plugin integrates Belkin Wemo smart devices with Allow2 parental controls, allowing parents to automate device control based on time quotas, schedules, and parental rules. Control smart plugs, switches, and other Wemo devices to manage access to TVs, gaming consoles, computers, and more.
- Automatic Wemo device discovery on local network
- Manual device addition by IP address
- Turn devices on/off remotely
- Real-time device state monitoring
- Event-driven triggers for device changes
- Support for multiple Wemo devices
- Integration with Allow2 quota system
- Seamless smart home automation
- Device offline detection
Some older Wemo devices may not be discovered automatically due to changes in Wemo's SSDP/UPnP implementation over time. Belkin has made changes to the Wemo firmware and discovery protocols that can prevent older devices from responding to standard discovery broadcasts.
If your Wemo devices are not appearing in the device list:
-
Assign a Static IP Address to Your Wemo Device
- Log into your router's admin panel
- Find the DHCP or LAN settings
- Create a DHCP reservation (static lease) for your Wemo device's MAC address
- This ensures your Wemo always has the same IP address
-
Manually Add the Device by IP
- In the Wemo plugin, go to the "Add Device" tab
- Enter your Wemo device's IP address (e.g.,
192.168.1.100or192.168.1.100:49153) - Click "Add Device"
- The device will be added and will persist across restarts
- Check your router's connected devices list
- Use the official Wemo app to view device information
- Use a network scanner app to find devices on your network
- Common Wemo ports are 49153 and 49152
Without a static IP, your Wemo device may get a different IP address after a power cycle or router restart, causing the manual connection to fail. Setting a static IP ensures reliable long-term connectivity.
- Run allow2automate on your machine:
- [https://apps.apple.com/au/app/allow2automate/id1369546793?mt=12](Mac App Store)
- Windows App Store (to be completed)
- [https://snapcraft.io/allow2automate](Linux Snap Store)
-
Log in using your Allow2 Parent Account
- Install the plugin in your Allow2Automate application
- Ensure Wemo devices are on the same network
- Run device discovery to find Wemo devices
- Configure device mappings and rules
- Set up quota-based automation
This plugin requires the following permissions:
- network: To discover and communicate with Wemo devices on the local network
- configuration: To read and modify plugin settings, including device mappings and automation rules
These permissions are necessary for the plugin to:
- Discover Wemo devices using SSDP protocol on the local network
- Send control commands to turn devices on/off
- Monitor device state changes in real-time
- Store device configurations and automation rules
import WemoPlugin from '@allow2/allow2automate-wemo';
const plugin = new WemoPlugin();
const devices = await plugin.actions.discover({
timeout: 10000 // Discovery timeout in ms
});
console.log('Found devices:', devices);await plugin.actions.turnOn({
deviceId: 'wemo-switch-001',
deviceName: 'Gaming Console'
});await plugin.actions.turnOff({
deviceId: 'wemo-switch-001',
deviceName: 'Gaming Console'
});const state = await plugin.actions.getState({
deviceId: 'wemo-switch-001'
});
console.log('Device is:', state.isOn ? 'ON' : 'OFF');// Automatically turn off gaming console when quota exceeded
plugin.on('quotaExceeded', async (event) => {
await plugin.actions.turnOff({
deviceId: 'wemo-switch-gaming'
});
});
// Turn on device when quota renewed
plugin.on('quotaRenewed', async (event) => {
await plugin.actions.turnOn({
deviceId: 'wemo-switch-gaming'
});
});- Name: Discover Devices
- Description: Discover Wemo devices on the network
- Parameters:
timeout(number, optional): Discovery timeout in milliseconds (default: 10000)
- Returns: Array of discovered devices
- Name: Turn On
- Description: Turn on a Wemo device
- Parameters:
deviceId(string): Wemo device identifierdeviceName(string, optional): Device name for logging
- Name: Turn Off
- Description: Turn off a Wemo device
- Parameters:
deviceId(string): Wemo device identifierdeviceName(string, optional): Device name for logging
- Name: Get State
- Description: Get current state of Wemo device
- Parameters:
deviceId(string): Wemo device identifier
- Returns: Device state object with
isOnboolean
- Name: Device Discovered
- Description: Triggered when a new Wemo device is discovered
- Payload:
deviceId(string): Device identifierdeviceName(string): Device friendly namedeviceType(string): Type of Wemo deviceipAddress(string): Device IP address
- Name: Device State Changed
- Description: Triggered when Wemo device state changes
- Payload:
deviceId(string): Device identifierpreviousState(boolean): Previous on/off statecurrentState(boolean): Current on/off statetimestamp(date): Time of state change
- Name: Device Offline
- Description: Triggered when Wemo device goes offline
- Payload:
deviceId(string): Device identifierdeviceName(string): Device namelastSeen(date): Last communication timestamp
- Wemo Switch
- Wemo Insight Switch
- Wemo Light Switch
- Wemo Mini
- Wemo Dimmer
This plugin requires main process execution for SSDP device discovery. The plugin declares this requirement via:
module.exports = {
plugin,
TabContent,
requiresMainProcess: true // SSDP discovery needs main process
};When loaded in the main process, the plugin:
- Initializes Wemo client for SSDP network discovery
- Polls for devices every 10 seconds
- Persists discovered devices via
context.configurationUpdate() - Sends device updates to renderer via
context.sendToRenderer()
The main process receives a rich context object:
function plugin(context) {
context.isMain // true in main process
context.ipcMain // Electron ipcMain for IPC handlers
context.configurationUpdate(state) // Persist plugin configuration
context.statusUpdate(status) // Update plugin status
context.sendToRenderer(channel, data) // Send updates to UI
}- Main Process:
Wemo.jsperforms SSDP discovery - Device Found: Device info persisted to state
- UI Update: Renderer notified via IPC
- User Control: UI sends commands via
setBinaryStateIPC handler
For detailed main process documentation, see:
# Clone the repository
git clone https://github.com/Allow2/allow2automate-wemo.git
cd allow2automate-wemo
# Install dependencies
npm install
# Start development server
npm start
# Build for production
npm run build
# Run tests
npm test- Automatically control gaming consoles based on quotas
- Schedule TV access for specific times
- Control computer power based on homework completion
- Manage smart home devices as parental controls
- Monitor and restrict device usage patterns
- Create time-based automation rules
- Try manual IP addition - Go to the "Add Device" tab and enter the device's IP address directly (see "Device Discovery Limitations" section above)
- Assign a static IP to your Wemo device in your router settings
- Ensure Wemo devices are powered on
- Verify devices are on the same network as Allow2Automate
- Check firewall settings allow SSDP discovery (UDP port 1900)
- Older Wemo firmware may have incompatible discovery protocols
- Verify device is online and responsive
- Check network connectivity
- Ensure device firmware is up to date
- Restart Wemo device if necessary
- Node.js 12.0 or higher
- Allow2Automate 2.0.0 or higher
- Belkin Wemo devices
- Local network connectivity
MIT - See LICENSE file for details
- Issues: GitHub Issues
- Documentation: Allow2 Documentation
- Community: Allow2 Community Forums
Contributions are welcome! Please read our contributing guidelines and submit pull requests to our repository.
Allow2
allow2automate, allow2, wemo, plugin, iot, parental-controls, smart-home