https://github.com/blazej222/pp-w162-smart-plug
Custom software for SmartDGM PP-W162 smart plugs allowing gathering data and controlling the relay.
https://github.com/blazej222/pp-w162-smart-plug
domoticz esp8285 espressif espressif32 internet-of-things iot tuya
Last synced: over 1 year ago
JSON representation
Custom software for SmartDGM PP-W162 smart plugs allowing gathering data and controlling the relay.
- Host: GitHub
- URL: https://github.com/blazej222/pp-w162-smart-plug
- Owner: blazej222
- Created: 2025-01-20T18:29:57.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-26T12:28:17.000Z (over 1 year ago)
- Last Synced: 2025-02-03T12:47:04.219Z (over 1 year ago)
- Topics: domoticz, esp8285, espressif, espressif32, internet-of-things, iot, tuya
- Language: C++
- Homepage:
- Size: 504 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Smart Plug
This repository contains a simple software written for SmartDGM PP-W162 SmartPlugs (more commonly known as Tuya).

## Features
- Hosts local website allowing checking parameters and changing configurations.
- Remote enabling and disabling power relay (by making HTTP GET request to http://IP/enable or http://IP/disable, or via the website).
- Showing realtime voltage, current and active power statistics on the website.
- Reporting statistics mentioned above to a data collection server (available on another repo).
- Collecting energy usage statistics (how many Wh used in period of time) and sending it to data collection server every period of time, allowing to analyze household power consumption trends.
- Ability to perform OTA update via the website instead of having to connect to UART.
## Screenshots
### Main page

### Settings page

### Main site with debug options

### Version tracking capability

## Usage
Project management system used is platformio.
First copy config-sample.cfg and rename it to config.cfg. You can optionally replace SSID and KEY within the file to your SSID and WiFi password, but it's not necessary as the device will create it's own AP in case of connection error, allowing you to change these options from config site.
Use platformio action "Build filesystem image" to build the littlefs filesystem that needs to be uploaded into the device. It will be stored inside `.pio/build/esp8285/littlefs.bin`
Then choose build. A firmware file will be created called `firmware.bin` .
Now you can either upload both files to the ESP8285 MCU either via UART programming, or another OTA updater.
## OTA Updates
Enter http://IP/update after the device was flashed.
First upload the filesystem image (will require a device reboot).
Then upload `firmware.bin` and the device will reboot.
When making changes to flash filesystem contents, always remember about backwards compatibility - otherwise after flashing the filesystem via OTA the device might require an USART connection to be unbricked