KAUF Smart Plug
w/ Power Monitoring
This classic home automation device can be used to switch on and off a device that plugs into a standard U.S. 120-volt wall outlet. Common usages include lamps, box fans, and Christmas lights. Power monitoring can let you know whether the plugged in device is running and how much electricity is being used.
- Runs ESPHome out of the box for 100% local control without flashing, soldering, or editing YAML.
- Connects natively to Home Assistant without going through a cloud connection or requiring a third-party App to setup or connect the plug.
- Reprogrammable with any ESP8266 compatible firmware if desired.
Note: ESPHome currently crashes every time its access point is enabled and the normal Wi-Fi connection becomes available. This creates the potential for our version 1.5 firmware that the KAUF Smart Plug could turn off power momentarily to whatever is plugged in if your home Wi-Fi goes out and then comes back. Please update to version 1.7 using the below downloadable bin file to mitigate this issue.
Adding the KAUF Smart Plug to Home Assistant
The KAUF Smart Plug comes programmed with a firmware that was made using ESPHome. The ESPHome firmware currently only works using Home Assistant as a hub. Home Assistant comes with a native API that is used to easily add and configure ESPHome based devices.
Please visit https://www.home-assistant.io/getting-started/ if you still need to get Home Assistant set up. The easiest way is to purchase a Raspberry Pi kit, flash the appropriate Home Assistant image onto an SD card, and then boot the Raspberry Pi from the SD card. Feel free to contact us if you still need further help.
Once you have Home Assistant running, complete the following steps to add a KAUF Smart Plug.
Step 1: Plug in a KAUF Smart Plug. The red LED will start blinking relatively soon after the device is plugged into a wall outlet. In general, the red light blinking indicates that the plug cannot connect to Wi-Fi (expected on a new plug), or that the plug cannot connect to Home Assistant.
Step 2: Connect to the KAUF Smart Plug’s Wi-Fi Hotspot. When a KAUF Smart Plug is unable to connect to a Wi-Fi network, the plug will wait 15 seconds and then create its own Wi-Fi hotspot. The Wi-Fi hotspot SSID will be “Kauf Plug Hotspot”.
Step 3: Enter Wi-Fi credentials into the web interface. When you connect to the KAUF Smart Plug’s hotspot, you should be prompted by your device to sign-in to the Wi-Fi network. The sign-in page will list Wi-Fi networks the KAUF Smart Plug found, and allow entry of any SSID and password used to connect to your local Wi-Fi network. Enter your network credentials and click save. The KAUF Smart Plug will reboot and connect to your Wi-Fi network.
Step 4: Add the KAUF Smart Plug in Home Assistant. Shortly after your KAUF Smart Plug reboots, Home Assistant will give you a notification that a new device was discovered. Follow the notification to go to the Integrations page, and you will see the detected KAUF Smart Plug in a blue box that says Discovered. Click the “Configure” button to complete setup.
Optional Step 5: Rename the device and entities. From the Home Assistant Integrations page, accessed through the configuration menu, the KAUF Smart Plug can now be found within the ESPHome card, initially named “Kauf Plug”. Selecting the KAUF Smart Plug from the list of ESPHome devices will allow you to rename the device to something more descriptive and useful. Follow the link that says “6 entities” to access a list of the available entities. The switch entity will be the entity that is used to turn the KAUF Smart Plug on and off. Several sensor entities will be available to indicate detected voltage, current, and power usage. Another sensor entity will be a text sensor that provides the plug’s IP address on your network. Clicking the individual entities will open up a window allowing the entity names and IDs to be changed to something more descriptive and useful.
The KAUF Smart Plug includes an ESP8266 chip and uses the following pins:
- GPIO 0 – Red LED. The red LED will be lit when GPIO0 is output low, and off when GPIO0 is output high.
- GPIO 2 – Blue LED. The blue LED will be lit when GPIO2 is output low, and off when GPIO2 is output high.
- GPIO 4 – Relay output. When the GPIO4 output is high, the relay connects input power to output power. When GPIO4 is low, the relay opens and power is disconnected.
- GPIO 5 – CF pin for power monitoring.
- GPIO 12 – SEL pin for power monitoring.
- GPIO 13 – Button input. The input is shorted to ground when the button is pressed, and is pulled up to 3.3v by a resistor when the button is not being pressed. When using the button input, the ESP8266 built-in pull-up resistor needs to be enabled. If you flash the KAUF Smart Plug to a different firmware and are getting strange results, you may not have enabled the pull-up resistor.
- GPIO 14 – CF1 pin for power monitoring.
The KAUF Smart Plug includes a relay rated for a 15-amp resistive load. The relay is the physical component that moves to connect or disconnect the input 120v power to the output of the KAUF Smart Plug. Resistive load means things like lights and household fans. Small household appliances will typically be resistive loads or have a small enough capacitive or inductive load to work fine with the KAUF Smart Plug. This plug is not appropriate for large capacitive or inductive loads, which includes things like water and air pumps.
Power monitoring is done by an HJL-01, which is an HLW8012 clone. For ESPHome, the HLW8012 Power Sensor component is used.
Out of the box, power monitoring will be sufficient to determine if a device or appliance is running or not, but will not necessarily be highly accurate beyond that due to manufacturing variances. Here is some good info by Home Assistant’s Frenck on how to calibrate a smart plug.
Here is some information specific to calibrating on Tasmota that will be helpful if you go that route.
To convert the KAUF Smart Plug to Tasmota, simply download tasmota.bin.gz, browse to the plug’s IP address in a web browser, and use the web page to flash.
The proper Tasmota template is:
- kauf-plug.bin (v1.7) – The firmware bin file as compiled by ESPHome. Flash to update to the latest version.
- kauf-plug.bin.gz (v1.7) – The same bin file, but gzipped. Sometimes the gzip will work when the .bin file fails.
- kauf-plug.yaml – The yaml file recommended to import a KAUF plug into your own ESPHome dashboard. Note that you must enter your local wifi credentials into this yaml file.
- PLF10 Manual.pdf – a PDF version of the manual included with the device.
Video explaining changes in version 1.6 firmware:
Version 1.7 – Adds a switch that can be toggled to clear saved WiFi credentials. Allows setting of different WiFi credentials without having to take down the set WiFi network or take the plug out of range of the set WiFi network. The switch is disabled by default in Home Assistant to avoid accidental triggering. The recommendation is to not enable it, but rather to browse to the plug’s web interface to toggle the switch. The method of holding the button for 5 seconds to enable the AP still works, but will still not clear the WiFi credentials.
Version 1.6 – The WiFi AP that allows configuration of WiFi credentials crashes the plug, which may cause the plug to turn off power to whatever is plugged in. This update mitigates that problem by disabling the WiFi AP once credentials are saved. The plug’s button can be held for 5+ seconds to re-enable the access point. Also added options to disable the plug’s button and led.
Version 1.5 – Initial public release.