@macdudeuk/node-red-contrib-tapo-hub 2.0.1
Node-RED nodes for TP-Link Tapo H100 hub - control switches (S220/S210) and read sensors (T310/T315)
node-red-contrib-tapo-hub
Node-RED nodes for controlling TP-Link Tapo devices via H100 hub - smart switches (S220/S210) and temperature/humidity sensors (T310/T315).
Features
- π Switch Control - Turn S220/S210 switches on/off/toggle
- π‘οΈ Temperature Sensors - Read T310/T315 temperature and humidity
- π Hub Config Node - Configure credentials once, use everywhere
- π Device Discovery - Automatically find all devices on your hub
- π Battery Monitoring - Track battery levels and signal strength
- π Efficient - Shared hub connection with request queuing
Architecture
Tapo S220 switches and T310 sensors communicate via sub-GHz radio (not WiFi) to the H100 hub. These nodes connect to your H100 hub via local network, which then controls/reads the devices wirelessly.
[Node-RED] βWiFi/LANβ [H100 Hub] βsub-GHzβ [S220 / T310 Devices]
Installation
npm install @macdudeuk/node-red-contrib-tapo-hub
Or install directly from the Node-RED palette manager.
Quick Start
1. Create Hub Configuration
- Add any Tapo device node (switch or sensor) to your flow
- Double-click and create a new Tapo Hub config:
- Hub IP: Your H100 hub IP address (e.g.,
192.168.1.100) - Email: Your Tapo account email (lowercase)
- Password: Your Tapo account password
- Hub IP: Your H100 hub IP address (e.g.,
2. Discover Your Devices
// Send discover command
msg.payload = "discover";
Copy the device_id from the debug output.
3. Configure Device Node
- Edit the device node
- Select your hub config
- Paste the Device ID
- Deploy
4. Control Devices
Switches:
msg.payload = "on"; // Turn on
msg.payload = "off"; // Turn off
msg.payload = "toggle"; // Toggle
msg.payload = "status"; // Get status
Sensors:
msg.payload = "read"; // Read temperature/humidity
Node Types
Tapo Hub (Config Node)
Configuration node that manages the H100 hub connection. All device nodes reference this config.
Tapo Switch
Controls S220/S210 smart switches.
Commands:
discover- Find all switcheson/off/toggle- Control switchstatus- Get device info
Response:
{
success: true,
state: "on",
deviceId: "..."
}
Tapo Sensor
Reads T310/T315 temperature and humidity sensors.
Commands:
discover- Find all sensorsread/status- Get readings
Response:
{
success: true,
readings: {
temperature: 24.5,
humidity: 66,
temp_unit: "celsius"
},
device: {
nickname: "Boiler Room",
status: "online",
battery_low: false,
signal_level: 3
},
timestamp: "2025-10-19T12:00:00.000Z"
}
Supported Devices
| Device | Model | Type | Status |
|---|---|---|---|
| Smart Switch (Dual) | S220 | Switch | β Tested |
| Smart Switch (Single) | S210 | Switch | β Compatible |
| Smart Button | S200 | Button | β οΈ Untested |
| Temp/Humidity Sensor | T310 | Sensor | β Tested |
| Temp/Humidity Display | T315 | Sensor | β Tested |
Example Flows
Temperature Monitoring
[inject: every 5 min] β [tapo-sensor: read] β [function: check temp > 30] β [alert]
Scheduled Switch Control
[inject: daily 7am, "on"] β [tapo-switch: Kitchen Lights]
[inject: daily 11pm, "off"] β [tapo-switch: Kitchen Lights]
Multi-Device Dashboard
[tapo-hub config: My H100]
βββ [tapo-switch: Kitchen] β [dashboard: switch widget]
βββ [tapo-switch: Parking] β [dashboard: switch widget]
βββ [tapo-sensor: Boiler] β [dashboard: gauge widget]
Requirements
- Node.js >= 14.0.0 (18.20.x recommended)
- Node-RED >= 1.0.0
- TP-Link Tapo account
- H100 hub connected to your network
- Devices paired with H100 hub via Tapo app
Troubleshooting
Cannot Connect to Hub
Check:
- Hub IP address is correct (may change with DHCP - set static IP!)
- Hub is online and connected to network
- Email is lowercase (capital letters cause auth failures)
- Internet connection available (initial cloud auth required)
No Devices Discovered
Check:
- Devices are paired with H100 in Tapo app
- Devices show as "online" in Tapo app
- Device batteries are not low
- Signal strength is adequate
Commands Don't Work
Check:
- Device ID is correct
- Device is online (use discover command)
- Hub connection is active
Technical Details
Protocol
- Uses KLAP or Passthrough protocol (auto-detected)
- Cloud authentication for credentials
- Local hub communication for commands
- Request queuing for concurrent operation safety
Dependencies
homebridge-kasa-hub- Hub communication library
Performance
- Device cache (5 second TTL) reduces hub queries
- Request queue serializes commands (prevents conflicts)
- Typical command response: 1-3 seconds
Documentation
Contributing
Contributions welcome! Please:
- Test with actual hardware
- Follow existing code style
- Update documentation
- Submit clear pull requests
Credits
- homebridge-kasa-hub - Hub communication
- home-assistant-tapo-p100 - Architecture inspiration
License
Apache-2.0 - See LICENSE file
Disclaimer
This is an unofficial integration. TP-Link and Tapo are trademarks of TP-Link Technologies Co., Ltd. This project is not affiliated with or endorsed by TP-Link.
The code uses reverse-engineered protocols for home automation purposes only. Use at your own risk.