Site Tools


en:tech:powermeter

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:tech:powermeter [2021/01/21 11:43] – [S0 signal] bullaren:tech:powermeter [2022/11/07 16:15] (current) – [Programming (ESPHome)] bullar
Line 48: Line 48:
 {{ :tech:powermeter_3d_print.jpeg?direct&200 |}} {{ :tech:powermeter_3d_print.jpeg?direct&200 |}}
  
-===== Programmierung =====+===== Programming (ESPEasy)=====
  
 After the hardware has been created, we still have to program the ESP module. As already mentioned, the PowerMeter is based on [[https://www.letscontrolit.com/wiki/index.php/ESPEasy|ESPEasy]]. In the link you can also find instructions on how the ESPEasy firmware is installed on the module. In order to get into the programming mode, the jumper SJ1 must be closed during the reset release. The programming is done serially via JP1 (USB-serial converter). After the hardware has been created, we still have to program the ESP module. As already mentioned, the PowerMeter is based on [[https://www.letscontrolit.com/wiki/index.php/ESPEasy|ESPEasy]]. In the link you can also find instructions on how the ESPEasy firmware is installed on the module. In order to get into the programming mode, the jumper SJ1 must be closed during the reset release. The programming is done serially via JP1 (USB-serial converter).
Line 105: Line 105:
  
 The calculated result is sent to the MQTT server at each completed measurement interval. The calculated result is sent to the MQTT server at each completed measurement interval.
 +
 +===== Programming (ESPHome)=====
 +The PowerMeter can also easily be integrated with help of [[https://esphome.io|ESPHome]] into [[https://www.home-assistant.io|Home Assistant]]. The sample code for one phase you will find here:
 +
 +<code yaml>
 +esphome:
 +  name: powermeter
 +
 +esp8266:
 +  board: esp01_1m
 +
 +# Enable logging
 +logger:
 +
 +# Enable Home Assistant API
 +api:
 +  encryption:
 +    key: "---key---"
 +
 +ota:
 +  password: "---password---"
 +
 +wifi:
 +  ssid: !secret wifi_ssid
 +  password: !secret wifi_password
 +
 +  # Enable fallback hotspot (captive portal) in case wifi connection fails
 +  ap:
 +    ssid: "Powermeter Fallback Hotspot"
 +    password: "--password--"
 +
 +captive_portal:
 +
 +time:
 +  - platform: sntp
 +    id: my_time
 +
 +sensor:
 +  - platform: pulse_counter
 +    pin: 
 +      number: GPIO14
 +      inverted: true
 +      mode:
 +        input: true
 +        pullup: true
 +    unit_of_measurement: 'kW'
 +    name: 'Power Meter Flat'
 +    id: powermeter_flat
 +    internal_filter: 10us
 +    filters:
 +      - multiply: 0.06  # (60s/1000 pulses per kWh)
 +
 +  - platform: total_daily_energy
 +    name: "Total Daily Energy"
 +    power_id: powermeter_flat
 +</code>
 +
 +Instead of measuring the time between two pulses the number of pulse per time interval is counted. 
  
  
 ===== Conclusion ===== ===== Conclusion =====
  
-The PowerMeter has been running for 2 months without any problems and is transmitting the data. A typical consumption curve looks like this (screen shot from my own //Volkszähler//):+The PowerMeter is running more than a year now without any problems and is transmitting the data. A typical consumption curve looks like this (screen shot from my own [[https://www.volkszaehler.org|//Volkszähler//]]):
  
 {{ :tech:verbrauch.png?direct&600 |}} {{ :tech:verbrauch.png?direct&600 |}}
Line 124: Line 182:
  
  
-==== Donate ====+===== Donate =====
  
-If you line my articles feel to donate a cappuccino or so...+If you like my articles feel to donate a cappuccino or so...
  
 <html> <html>
en/tech/powermeter.1611229381.txt.gz · Last modified: 2021/01/21 11:43 (external edit)