Does anyone have experience using this kind of board to interface with ESPHome?
It uses a CD4052 multiplexer to connect the four inputs to the single A0 pin on the ESP8266 but I can’t find any references in the Docs.
Does anyone have experience using this kind of board to interface with ESPHome?
It uses a CD4052 multiplexer to connect the four inputs to the single A0 pin on the ESP8266 but I can’t find any references in the Docs.
Cool cheap boards (sucks the shipping cost to Canada is through the roof! ) .
The blue board looking at the schematics doesn’t look like it would be supported in Esphome. BUT The GREEN version(Mottramlabs-Products) of the board looks like it could be used. Due to using the ADS1115
I ended up ordering one of the greenboards and had it shipped to a friend in the UK which will in turn forward the package to me, but will be a few weeks still on getting the SCT-013 from Aliexpress.
Just curious why you picked this particular board?
I have used a Node MCU with 4-channel relay - Amazon.com that would likely perform same as your configuration.
Side Note:
Based on my experience, the stuff from China gets really cheap once you order in bulk. I ordered 50 pieces of NodeMCU (Ali Express) and it ended up as less than $2 a piece with free shipping!
The board in this thread is to monitor the power usage using SCT-013-xxx split core transformers. (Learn | OpenEnergyMonitor)
The green circuitboard (Mottramlabs-Products) " ESP8266 - 4 Channel Mains Current Sensor" uses ADS1115 which is supported by the ESPHOME.
The link you provided is for board that control relays.
Thanks for clarifying, while your original note peaked my curiosity I misunderstood the details.
Did you notice they post the schematic too? Could use fairly readily to implement your own and not pay shipping…
Anybody find a way to get the blue board to work? Also curious if this will work as I just ordered the blue board.
The board maker sent me this link to a Github thread but I have not had time to try it yet:
I have mine already working on ESPHOME. The support is already there for the chip on the board.
I only have one channel. At first I was going to move to a different home , and didn’t install it in the fuse panel , but the way things are going looks like I will be here for another year. So may install it into the fuse panel. I have it only right now on my laptop on my desk. I used for testing.
here is a copy of my testing esphome.
esphome:
name: home-power
platform: ESP8266
board: d1_mini
wifi:
networks:
- ssid: !secret wifi_ssidiot
password: !secret wifi_password
priority: 0
- ssid: !secret wifi_ssid
password: !secret wifi_password
priority: 1
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Home-Power Fallback Hotspot"
password: "9iwxxxxxxXpBc"
manual_ip:
static_ip: 192.168.1.153
gateway: 192.168.1.1
subnet: 255.255.255.0
reboot_timeout: 2min
# fast_connect: true
# Enable logging
logger:
level: DEBUG
baud_rate: 0
logs:
ads1115: ERROR
# Enable Home Assistant API
api:
reboot_timeout: 5min
ota:
password: "dxxxxxxxxxxxxxxxxx"
web_server:
port: 80
captive_portal:
substitutions:
esp_id: "esp-energymon"
# Common ADS1115 Sensor Setting
ads_gain: "2.048"
ads_update_interval: "850ms"
#ads_update_interval: "250ms"
ads_delta: "0.2"
ads_heartbeat: "120s"
ads_voltage: "120"
i2c:
sda: GPIO04
scl: GPIO05
scan: False
ads1115:
# 1st ADS1115 (ADDR -> Grnd)
- address: 0x48
id: ads1115_1
continuous_mode: on
# Example configuration entry
switch:
- platform: gpio
pin: GPIO013
name: "Buzzer"
#restore_mode: ALWAYS_OFF
inverted: true
- platform: restart
name: "ESP Home Power Restart"
sensor:
# Channel 1
- platform: ct_clamp
sensor: ads1115_1_a0
id: current_ch1
name: "${esp_id} Current Ch 1"
update_interval: 5s
## New Start
#sample_duration: 5s
accuracy_decimals: 3
## New End
# Needs adjusting for individual Deployment
filters:
- calibrate_polynomial:
degree: 2
datapoints:
- 0.00 -> 0
- 0.00090 -> 0.11774325429
- 0.003 -> 0.1885245901639344
- 0.029 -> 4.10655737704918
- 0.055 -> 7.516393442622951
- sliding_window_moving_average:
window_size: 5
send_every: 1
- lambda: if ( (x * ${ads_voltage}) < 10 ) { return 0; } else { return x ; }
# When Current updates, update Watts
on_value:
then:
- sensor.template.publish:
id: watts_ch1
# Local Voltage is 240V - adjust as required.
state: !lambda 'if ( (id(current_ch1).state * ${ads_voltage}) < 10 ) { return 0; } else { return id(current_ch1).state * ${ads_voltage}; }'
- platform: ads1115
ads1115_id: ads1115_1
multiplexer: 'A0_GND'
gain: ${ads_gain}
name: "ADS1115-1-A0"
id: ads1115_1_a0
accuracy_decimals: 3
update_interval: ${ads_update_interval}
internal: true
filters:
# Samples every 250ms...Average over 10 Secs, Send every 5 Secs
- sliding_window_moving_average:
window_size: 40
send_every: 20
- delta: ${ads_delta}
# Template Sensors for Watts
- platform: template
id: watts_ch1
name: "${esp_id} Watts Ch 1"
lambda: return id(current_ch1).state * ${ads_voltage} ;
unit_of_measurement: W
accuracy_decimals: 3
device_class: power
# Energy Sensors (kWh) for HA Dashboard
- platform: total_daily_energy
name: ${esp_id} Total kWh Ch1
power_id: watts_ch1
filters:
- multiply: 0.001
unit_of_measurement: kWh
# Voltage from HA
- platform: homeassistant
name: "Voltage"
#ESPHome ID
id: average_voltage
entity_id: switch.1000c00249_voltage
internal: true
- platform: wifi_signal
name: "${esp_id} WiFi Signal Sensor"
update_interval: 60s
# Total Energy sensor requires Times - could be SNTP or Home Assistant
time:
- platform: homeassistant
id: homeassistant_time
Thanks, I will give that a go.
Hi @digiital , I gave this a go over the week and it seems to work great. I do however have a couple of follow-up questions …
Thanks!
Make sure you adjust the following numbers. I used a know power, like a lightbulb, tried heaters as well a few items to get a average to place down below . I don’t recall if I used a youtube video at first to see how it was done. Or just applying a 60w bulb and heater and looked at the logs to see the output.
filters:
- calibrate_polynomial:
degree: 2
datapoints:
- 0.00 -> 0
- 0.00090 -> 0.11774325429
- 0.003 -> 0.1885245901639344
- 0.029 -> 4.10655737704918
- 0.055 -> 7.516393442622951
OK thanks, I did re-calibrate the polynomial.
Regarding the voltage question, you have the following:
And the calculations all use “ads_voltage” (i.e. 120 or 240) instead of “voltage” from a Home Assistant entity e.g.:
Why not use “voltage” instead of “ads_voltage”?
“Voltage” is just a label/name…
I’m pretty sure you could just remove that section. I was experimenting to see if I could figure out the voltages. But I stopped working on it
I’m trying the blue board with this:
And seems to work fine.
Would anyone have an update on whether one of these is worth getting and essentially:
Appreciate any feedback
The headline “Will Low Cost ESP8266 4 Channel Power Monitor Work With ESPHome?” is actually misleading.
The website states that the product shown in the picture from @Jonah1970 is actually a “ESP8266 - 4 Channel Mains Current Sensor”
Accurate power measuring will be impossible with that type of device
The blue uses the internal ADC from the esp while the green board uses a (better) ads1115 - still both only measure current and not power
Does it matter at all? What does it help to know the AC current?
Does it require calibration and how is that performed?
No idea. Low cost power monitoring can be achieved with pzem004t v3’s which not only comes factory calibrated with coil or clamp but are also cheap as hell
Looks like this is cheapest solution… For 3 sets = 22,8EUR with delivery…
Instructions for setting up PZEM-004T power monitors.
I calibrated with different bulbs and a plug power meter to check bulbs real and precise power.
Then I calibrated high power with a current clamp.
I verified precise voltage to set it in the code and I think it is enough accurate for me. In future I will test the difference with a PZem