Would love to this in context, with the rest of the .yaml?
Also, just trying to move them over the ESPhome and getting;
Upload Failed
Upload buffer miscompare
How did you get around that?
EDIT!
If anyone runs into this, its because I upgraded to the full firmware before I went to ESPhome. Just leave it on the minimal, and you will be fine
Good job figuring it out! Also good to know there arenāt unflashable versions on sale (yet).
Hereās my current yaml file to get switching with energy monitoring in Home Assistant via ESPHome. Itās based on the Gosund SP1 config in the ESPHome cookbook here, but using the pins from the Tasmota template here.
Iām no expert so use this at your own risk. That said itās working fine for me on four devices and as mentioned, Iāve tweaked the energy monitoring settings to match an independent power monitor fairly closely.
For newcomers; my first two plugs I flashed with the tasmota-lite firmware bundled with Tuya-convert before compiling the below ESPHome yaml in Home Assistant then flashing it to the device from the Tasmota page on the deviceās IP address. The next two plugs I skipped the tasmota step and flashed the compiled ESPHome firmware directly from tuya-convert which worked fine. Iād recommend the second approach as thereās no need to involve Tasmota.
I noticed the ESPHome implementation makes switching the device almost instant, where Tasmota had a noticeable delay. I also donāt see the need to involve an MQTT broker as another point of failure however thatās just personal preference.
ESPHome yaml configuration for an Australian Brilliant Smart Plug with energy monitoring (BL20925)
esphome:
# Make sure this name is unique for each device
name: monitoring-plug-1
platform: ESP8266
board: esp01_1m
wifi:
ssid: "YourWifiNameHere"
password: "YourWifiPasswordHere"
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Monitoring-Plug-1"
password: "StrongPasswordHere"
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
# Optional password for adding this device to Home Assistant
password: "StrongPasswordHere"
ota:
# Optional password for flashing the device over the air from ESPHome
password: "StrongPasswordHere"
binary_sensor:
- platform: gpio
pin:
number: 3
mode: INPUT_PULLUP
inverted: true
# Make sure this name is unique for each device
name: "Plug 1 Power Button"
on_press:
- switch.toggle: relay
switch:
- platform: gpio
id: led
pin:
number: GPIO13
inverted: true
- platform: gpio
# Make sure this name is unique for each device.
# This is the entity you'll add to a Home Assistant dashboard to control the switch
name: "Plug 1"
pin: GPIO14
id: relay
sensor:
- platform: hlw8012
sel_pin:
number: GPIO12
inverted: True
cf_pin: GPIO04
cf1_pin: GPIO05
# These values can be tweaked to calibrate the energy monitoring.
# Start with the voltage divider to get the voltage right, then adjust the current resistor to adjust the watts as this relies on the voltage being right.
current_resistor: 0.00103
voltage_divider: 2160
current:
# Make sure this name is unique for each device.
name: "Plug 1 current"
unit_of_measurement: A
voltage:
# Make sure this name is unique for each device.
name: "Plug 1 Voltage"
unit_of_measurement: V
power:
# Make sure this name is unique for each device.
name: "Plug 1 Wattage"
unit_of_measurement: W
id: "energy_temp_Wattage"
# Total energy use may not be very useful as it will be reset if the device looses power, monitoring may be better done in Home Assistant. If needed, uncomment the following lines.
##energy:
# Make sure this name is unique for each device.
## name: "Plug 1 Energy"
## unit_of_measurement: Wh
# How often the device will report energy usage stats to Home Assistant
update_interval: 60s
# The initial report mode - useful if not auto-switching between report types, see below.
initial_mode: CURRENT
# The hlw8012 energy monitor can only report voltage and watts or amps and watts at a time. This setting will switch between them. If you want to stay on one report type, set the 'initial mode' above, then set 'change mode every' to 4294967295.
change_mode_every: 8
Allās well that ends well I guess, but still annoyed that I wasted so much time on something thats so easy LOL
Oh well, thanks for giving it another go and making me try it again
I ended up using this as the template in the end.
Seems to be working well.
Is anyone using Node Red to run automations off of the power drawā¦ eg have alexa notify you when the washings finished?
Good idea nick, although it looks like thereās a better version on esphome-devices already that Shane found (donāt know how I missed this!).
Could have been worse, you could have missed that they can still be flashed HAHA
Has anyone see this? It wont show the correct voltage, other one works fine. I was thinking about deleting and readding itā¦ But no idea if that would actually make a difference.
Any ideas?
Thanks guys
EDIT,
Was a faulty plug swapped it out
Sorry if this has been discussed but I couldnāt find it in the search.
Does anyone know about a dimmer switch with 4 buttons? I was hoping for something like https://www.bunnings.co.nz/deta-grid-connect-smart-quad-gang-touch-light-switch_p0161015 but with dimmers instead of just buttons.
I was also wondering if anyone knew of any pet-sensitive motion detectors?
Cheers
I have seen the Xiaomi plugs with power monitoring. But I donāt know if theyāre certified (or even need certification). I have a couple and they work quite well. Trying to get away from the Xiaomi ZigBee stuff though
Anyone know of any others?
Hi Tim, when you get time please share the changes to the fan.py file to modify the speeds.
Also can someone please let me know how to get to this Entity Configuration screen.
Thanks again for your help.
I went for these in the end. Just flashed them with Tuya Convert (Its pretty easy if you have an old Pi Zero W, or other Pi hanging round)
I cant find type I Zigbee plugs hereā¦ Well for a good price anyway. If youāre rich and like to throw money on the street. You can get Hue plugs that should work with Smartthings ect.
Has anyone installed the new Deta single gang dimmable smart switches? Around $54 at Bunnings, same as this but dimmable.
Keen to know how the dimming function performs!
Iāve been using these with Zigbee2Mqtt. $24 on Ebay for one. Happy with them.
Hey, those plugs look pretty good. Zigbee repeater/extenders as well! Nice find!
Hey mate, can you share your localtuya setup for the Arlec Fan? I have added it with localtuya but am struggling with what āIDā to use, and fan control value etc. Cheers
Indeed, good find, have just ordered a few - thanks for the heads up!
I will too - just spent the weekend crafting a CC2530 based router, but this will be much easier (assuming it will work!)
Can these fit side by side? The pictures it looks a little wide