I’m looking for help creating a yaml config for this plug. I have one already that I’ve flashed using Tuya Convert and put tasmota on it. It seems to report the power correctly – however I want to consolidate all my devices on ESPHome instead of Tasmota.
The specific part I need clarification on is the power monitoring aspect
I just tried it and it seems to mostly work. Relays 1, 2, and 3 all turn on and off as expected. Relays 1 and 2 show a status (OFF, ON) but relay 3 shows nothing. Nothing showing for button, status, or esphome version. Haven’t tested a load that shows anything with current or power yet. Only a lamp with an LED bulb.
I stripped the config down a bit and it seems to be working. I removed the actions on the button as well as removing the version, wifi, and uptime sensors.
Honestly, I don’t have any purpose for the button. This is for my washing machine. I needed a multi-outlet so I could also plug in another ESP8266 sensor for the dryer.
The energy sensor, web interface, and all relays work. I’ve got a few automations set in hass to notify laundry cycles.
Thanks for trying it out! I realized the same thing.
We need to add a sensor filter in esphome to calibrate the energy monitor sensor. Unfortunately, I don’t have a kill-a-watt or other power meter and shipping times have been slow here.
Do note that the web server uses quite a lot of resources and can cause problems. And in any case, it is of little value apart from testing. Web Server Component — ESPHome
The web_server component creates a simple web server on the node that can be accessed through any browser and a simple REST API. Please note that enabling this component will take up a lot of memory and can lead to problems, especially on the ESP8266.
The code I originally posted works fine on my plugs, I haven’t calibrated the energy consumption part but mostly use the plugs just for toggling on/off the relays with Home Assistant and don’t really care about accurate energy consumption. You can still use it to tell when something is on/off - like my desktop computer which was plugged into it and relays to turn on/off dual monitors.
After testing, I did comment out the webserver component as Nick suggested.
LMK if you end up getting it working or making any improvements!
I set up two of these for my houseplant lighting. It all works with some small adjustments.
First:
The mode of GPIO16 for esp01 (generic), does not permit INPUT_PULLUP. Mode should simply be INPUT.
Second:
Inverted: should be set to TRUE. As it originally was, the button action occurred when the button was released instead of when it is pushed.
Third: The current and Voltage measurements are way off. Voltage measured 130V for an actual 117V, and the current measurement was way high. The power reported does not appear to be taking into account the power factor and consequently also gives very high readings. I freaked out when it reported that my 200W power supply was delivering 335W. I’m not sure that it is worth the effort to
I see some flickering of the button light when first powered up. After operation, that stops. This may be worth investigating.