i am wondeirng if anyone has any experience they would care to share with metering the electricity and/or gas consumption with an impulse meter.
in my home i have an impulse meter which lets out an impulse per kwh, or per m3ā¦ these are installed by the electricity/gas company.
i would like to have a counter for thisā¦ which i can integrate into home assistantā¦ are there any people who have done this?.. or what tools could one use for thisā¦ i would rather not solder something together, but would like to use some kind of wireless technology ā¦ Wifi/zwave or zigbeeā¦ any ideas?
If you can find out an existing device you can integrate for this Iād be keen to find out also. There are a few ways I know people have done this, one involving a photodiode on top of the blinking LED, for example this one:
https://www.4-noks.com/shop/energy-meter-en/zigbee-optical-interface-for-energy-meter/?lang=en
I have no experience with this product myself though.
Iāve been fiddling around with a current transformer ring which outputs the measurements via MQTT. The accuracy is lower (around 90%) than a MID certified meter, but for non-billing purposes should be fine. This approach does entail some electrical work, in any case, please be safe if you do look into it and obey your local regulation.
OpenEnergyMonitor has several products intended for this type of purpose.
https://openenergymonitor.com/
A notable thing about pulse counting is, that not all pulse meters emit pulses at the same frequency/power, probably itās a lot less than one kWh.
I just finished that project today
I think it needs some additional fine tuning with conversion, etc.
If anyone has any suggestions how to make this configuration better, please share
I copied this project from this guide: Here (polish)
Here is what I did:
Assumptions:
- MQTT Broker configured
- ESP Flashing Basics Guide
Hardware:
Steps:
-
Connect photodiode to GPIO Pin (my case GPIO-14), Voltage (3.3V) and GND
-
Flash ESP Easy Mega Here
-
Configure ESP to communictae with MQTT Broket in HA
-
Configure device in ESP:
Note: Values 1/6400 is defined by my electricity couter from provider - it is stated on cover as 6400 impulses / kWh
Note2: Change āCountā value to: ā(%value%*(1/6400)) * 1000 * 60ā to get value of Watts every 60 seconds -
Configure MQTT sensors in HA:
First one uses Count value and provides power consumption every minute (ESP is set to 60 seconds interval - screen above)
Second one uses Total value and provides input for utility meter component:
-
Place photodiode directed on electricity meter flashing diode:
Duct tape is your friend
Final efect looks like this:
I added cost calculation
almost what i looking for, i dont what whan to use mqtt to get all the info, i what to use Utility Meter in HA to get in all the data. any ide how?
Will you be using an ESP device with ESPHome firmware on it? If so, you donāt need to use mqtt, you can just use the homeassistant API for communication, then just plug the values into a Utility Meter entity.
mmm i dont know, rellyā¦ now i am just trying to understand how i can bulid on, then i need some to make the code
So Iād definitely suggest using an ESP device, flashing it with an ESPHome firmware (where youāre using homeassistant for communication rather than mqtt). Hereās the code for my firmware:
esphome:
name: power_meters
platform: ESP32
board: esp-wrover-kit
wifi:
ssid: {{ssid}}
password: {{passw}}
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
# Enable Web server
web_server:
port: 80
sensor:
# Uptime sensor
- platform: uptime
name: Elec Meter Uptime
# WiFi Signal sensor
- platform: wifi_signal
name: Elec Meter WiFi Signal
update_interval: 60s
#########################################
#
# Electricity usage
#
#########################################
# usage right now in kW
- platform: pulse_counter
pin: GPIO12
unit_of_measurement: 'kW'
name: 'Power Meter'
id: power_meter
filters:
- multiply: 0.06
# converts above to kWh used today
- platform: total_daily_energy
name: "Total Daily Energy test"
power_id: power_meter
id: kwh_so_far
switch:
# Switch to restart
- platform: restart
name: Electricity meter monitor restart
# Sync time
time:
- platform: sntp
id: my_time
i have order some stuff. I hope i can make it work never use esp so its a a good way to trying to get it to work.
Hello, have almost got all that I order:
ESP-32 ESP32S Development Board 2.4GHz WiFi+Bluetooth Antenna CP2102 Module
NodeMcu Lua V2 WiFi Development Board Based On ESP8266 ESP-12E CP2102 Module
I am still wating for Photodiode module detects brightness light-sensitive light detector
Can link what firmware I should download so I can use your code?
Regard
If you get my code just paste it into a new node on the Hass.io ESPHome addon, change your details, compile the firmware, download it and flash it onto your board with something like ESPHome Flasher. Does that make sense? Sounds long winded but itās relatively simple.
i think i understand. This is a new world for me, never using this before so i know very litel about this.
think i need to reda alot about this
i allos need to figuer out how to coonect it all:S
Yeah I understand, if you want to get into ESPHome this video covers the basics I mentioned. Youād have to specify the correct board type youāre using and generate a firmware based on your needs but this is a good start: https://www.youtube.com/watch?v=soKuma8DJWQ
I just starting to get this a chance:)
Do I need to use the card on image? Or can I use it the esp directly in the usb?
If not, how should I wiring them?
Regard
i have done my homework:P well some:D
now i understand how to flash it and get it in to HA,
but i am a bit unsuer how to wiring it.
i have Photodiode and having AO,DO,GnD, and VCC
just a guess is
gnd= ground
AO = anolog
do= digital
VCC= power
so if think right it sholde ne
gnd to gnd
VCC to 3.3V
do= to a pin like that one u using in the code (pin: GPIO12)
I did it! It works flawlessly
thank you
I am going to give this a try to, did you get it to work?
BTW, why is the NodeMcu board needed, shouldnāt one esp32 suffice?
This looks like a neat solution, but doesnāt the energy company mind that you have duct-taped something to their meter? It would look awfully suspicious for the person that comes and does periodic readingsā¦
I suspect the duct tape has an extra role to filter out outside light that might confuse the photodiodeā¦