Before starting, make sure you have:
- Home Assistant installed and running (version 2024.1 or higher recommended)
- HACS (Home Assistant Community Store) installed
- Tuya IoT Platform account (for obtaining credentials)
- PC321-W-TY already configured and working in Smart Life/Tuya Smart app
- Same network: The energy meter and Home Assistant must be on the same local network
- Open Home Assistant
- Go to HACS → Integrations
- Click the + Explore & Download Repositories button
- Search for LocalTuya
- Click Download
- Restart Home Assistant
You need to obtain:
- Device ID
- Local Key
See TUYA_CREDENTIALS.md for detailed instructions.
The PC321-W-TY needs a static IP or you need to know its current IP address.
Methods to find the IP:
- Check your router's DHCP client list
- Use a network scanner app (like Fing)
- Check the Tuya IoT Platform device list
Recommended: Assign a static IP to the device in your router.
- Go to Settings → Devices & Services
- Click + Add Integration
- Search for LocalTuya
- Select Add a new device manually
- Enter:
- Name:
WIFi_Meter(or your preferred name) - Host: Device IP address (e.g.,
192.168.0.202) - Device ID: From Tuya IoT Platform
- Local Key: From Tuya IoT Platform
- Protocol Version:
3.5
- Name:
After adding the device, you need to configure each entity (sensor).
See CONFIGURATION.md for the complete entity configuration.
After configuration, verify that:
- All sensors show numeric values (not "unknown" or "unavailable")
- Voltage readings are approximately correct (e.g., ~120V or ~220V depending on your region)
- Power readings change when you turn appliances on/off
- Energy counters increment over time
If sensors show "unavailable":
- Check the device IP address is correct
- Verify the Local Key hasn't changed
- Make sure Protocol Version is
3.5 - Check firewall isn't blocking UDP ports 6666-6668
See TROUBLESHOOTING.md for more help.