Giter Site home page Giter Site logo

klaasnicolaas / home-assistant-glow Goto Github PK

View Code? Open in Web Editor NEW
986.0 30.0 143.0 88.19 MB

⚡ The power of energy measurements in your house

Home Page: https://glow-energy.io/

License: MIT License

energy home-assistant esphome hacktoberfest iot electricity esp32 glow smartmeter esp8266

home-assistant-glow's Introduction

Just say hello! 🤙🏻

Nice to meet you! 👋 I'm Klaas, an (almost) graduated student in the field of UX Engineering based in The Netherlands. Be welcome! Feel free to take a look around and if you have any questions, feel free to ask them via email or social media!

"Building bridges so that a user can use system, websites or apps in the most pleasant way possible".

Personal LinkedIn Twitter

GitHub Sponsors GitHub followers


🚀 Projects

As you can see I never sit still, always busy with all kinds of projects. This mainly contains contributions for Home Assistant, building Laravel platforms and python packages pushed to PyPi for various integrations. So my head is full of ideas 🤯, on my blog website you will find more background information from some projects.

Home Assistant configuration repositories (from most to least active):

home-assistant

Would you like to stay informed about project release updates? Follow Mister Assistant 🤖 on Twitter, it's my assistant bot that tweets on project updates. For example, these great projects I've worked on:

Projects Type Description
Home Assistant Glow ESPHome project ⚡ The power of energy measurements in your house
(many) Python Packages Python packages 🐍 Various Python packages
Py-package Template Template 🐍 Python package template for new projects
Laravel Template Template 🚀 Laravel template for new projects
Spot-Redux QuadRuped robot 🤖 Building Quadruped robot for the minor IROB

A full list of all python packages that I've worked on can be found on PyPi.

home-assistant-glow's People

Contributors

adonno avatar ahmadyusuf avatar cchrkk avatar dependabot[bot] avatar frimtec avatar klaasnicolaas avatar knaak avatar m-s-e avatar naofireblade avatar nygellyndley avatar pranavkrishnan007 avatar pschneider87 avatar renovate[bot] avatar slovdahl avatar stevetz avatar wrt54g avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

home-assistant-glow's Issues

Measurement doesn't match the valves from the power company.

Hello
I am having some issues with the accuracy of the measurements.
The values Meter KWH is from the power company and the HA KWH value is from Home Assistant.
As you can see, the values are completely off.
Do you have any idea as to how i can adjust this, or what i am doing wrong?
I am using the Nodemcu V3

image

Diagramms?

May I ask you where are the mentioned diagrams for connect the parts?
I van‘t find them and I really don‘t know how to assemble the parts …

[REQUEST] Water flow metering of Kamstrup smart water meters via IR optical eye header?

Would love water flow reading support for smart water flow meter added to Home Assistant Glow hardware if it could be possible?

Not quite sure if all newer water meters offer an LED which pulses base on a set consumption value or not? See probe examples:

https://www.mysensors.org/build/pulse_water

https://www.kompf.de/tech/watir.html

However believe some modern water meters offer a two-way bidirectional infrared port (IR receiver and sender) for communication?

https://www.mysensors.org/build/ir

http://jheyman.github.io/blog/pages/WirelessWaterMeter/

As I understand those optical probes should work with optical infrared waves be compliant with the international standard IEC 62056-21 (formerly IEC 1107) or ANSI C12.18 communications protocols for energy metering for reading utility meters?

https://en.wikipedia.org/wiki/IEC_62056

https://en.wikipedia.org/wiki/Smart_meter#Protocols

A hackerspace group in Denmark is selling these IR reading heads for about $14 US (Google translate as test written in Danish) and they wrote a note that using magnets is required as the IR port transmitter / reader eye does not activate unless it sense a magnet:

https://wiki.hal9k.dk/projects/kamstrup

I believe that Kamstrup water meters with IR optical head are very common in Europe:

https://www.kamstrup.com/en-en/water-solutions/smart-water-meters

https://www.kamstrup.com/en-en/water-solutions/smart-water-meters/multical-21

image

image

I myself live in Sweden where I think Kamstrup MULTICA 21 / Kamstrup flowIQ 210x ultrasonic water meter is the most common model in normal private residential houses here in Scandinavia (Sweden, Norway, Denmark, Finland, and Island).

Kamstrup official (and expensive) optical read-out head tools are called 6699-099 (USB) and 699-102 (9F D-sub plug serial)

https://www.termonet.rs/pdf/Kamstrup/Optical%20Read-out%20(IR)%20Head%20-%20Data%20Sheet%20-%20English.pdf

Kamstrup apparently call their implementation for Kamstrup Meter Protocol (KMP) and someone has reverse-engineered it here:

https://github.com/bsdphk/PyKamstrup

https://frack.nl/wiki/Stadsverwarming

https://forum.mysensors.org/topic/3525/district-heating-city-heating-stadsverwarming-mysensor-ir-sender-receiver/

https://www.domoticz.com/forum/viewtopic.php?t=11333

They currently also have Kamstrup flowIQ 2200 "advanced model with acoustic leak detection":

image

image

and Kamstrup flowIQ 3100 "Commercial and industrial" model

https://www.kamstrup.com/en-en/water-solutions/smart-water-meters/flowiq-2200

https://www.kamstrup.com/en-en/water-solutions/smart-water-meters/flowiq-3100

Kamstrup seem to provide technical documentation about all their products here:

https://products.kamstrup.com/index.php

PS: Off-topic but FYI; some if not all of these models of Kamstrup water meters can also be read remotely via Sigfox network RF (Radio Frequency) but that communication traffic is most of the time encrypted, at least if the water meter itself is owned and operated by a utility company or a service provider.

https://www.kamstrup.com/en-en/water-solutions/water-meter-reading

https://www.kamstrup.com/en-en/water-solutions/water-meter-reading/usb-meter-reader

If the case is that the RF radio communication is not encrypted then there look to be projects that can work with that:

https://github.com/adams-okode/kamstrup-integration

https://github.com/weetmuts/wmbusmeters

https://github.com/tobiasrask/wmbus-client

Leaps in readings

Good afternoon! Sometimes the power consumption sensor transmits very high values (more than 150000 watts), and then shows the correct data again. This happens several times a minute. It can be fixed?

Question about Power Consumption Sensor

Ive just created my Glow and it's working fine - thank you.

I've added all the sensors it creates to an entities card in home assistant for initial testing. The Power Consumption one alternates between showing a wattage value and 0. Is this normal behaviour? I'm assuming it's to do with how it calculates wattage from the pulses but is there any way of having this always show the last true value?

Values reported by Glow much higher

Hi All,

I've recently setup the glow on my electricity meter and all seemed to be working well.
However, I have noticed that the power consumption readings are going up much quicker than I would expect.

My meter runs at a rate of 4000 blinks per kWh, and i have adjusted my config to that, but when looking in the logs i can see it is tracking each of these blinks and pushing the number up pretty quickly, rather then small increments.

Here is some output from my logs:

[09:48:15][D][sensor:131]: 'House - Power consumption': Sending state 320.39871 W with 0 decimals of accuracy
[09:48:15][D][sensor:131]: 'House - Total energy': Sending state 0.14925 kWh with 3 decimals of accuracy
[09:48:18][D][sensor:131]: 'House - Total energy': Sending state 0.14950 kWh with 3 decimals of accuracy
[09:48:20][D][sensor:131]: 'House - Power consumption': Sending state 319.03583 W with 0 decimals of accuracy
[09:48:20][D][sensor:131]: 'House - Total energy': Sending state 0.14975 kWh with 3 decimals of accuracy
[09:48:23][D][sensor:131]: 'House - Power consumption': Sending state 320.39871 W with 0 decimals of accuracy
[09:48:23][D][sensor:131]: 'House - Total energy': Sending state 0.15000 kWh with 3 decimals of accuracy
[09:48:26][D][sensor:131]: 'House - Power consumption': Sending state 321.77332 W with 0 decimals of accuracy
[09:48:26][D][sensor:131]: 'House - Total energy': Sending state 0.15025 kWh with 3 decimals of accuracy
[09:48:29][D][sensor:131]: 'House - Power consumption': Sending state 321.65833 W with 0 decimals of accuracy
[09:48:29][D][sensor:131]: 'House - Total energy': Sending state 0.15050 kWh with 3 decimals of accuracy
[09:48:32][D][sensor:131]: 'House - Power consumption': Sending state 320.51282 W with 0 decimals of accuracy
[09:48:32][D][sensor:131]: 'House - Total energy': Sending state 0.15075 kWh with 3 decimals of accuracy
[09:48:34][D][sensor:131]: 'House - Power consumption': Sending state 322.69629 W with 0 decimals of accuracy
[09:48:34][D][sensor:131]: 'House - Total energy': Sending state 0.15100 kWh with 3 decimals of accuracy
[09:48:37][D][sensor:131]: 'House - Power consumption': Sending state 320.51282 W with 0 decimals of accuracy
[09:48:37][D][sensor:131]: 'House - Total energy': Sending state 0.15125 kWh with 3 decimals of accuracy
[09:48:40][D][sensor:131]: 'House - Power consumption': Sending state 321.77332 W with 0 decimals of accuracy
[09:48:40][D][sensor:131]: 'House - Total energy': Sending state 0.15150 kWh with 3 decimals of accuracy
[09:48:43][D][sensor:131]: 'House - Power consumption': Sending state 321.65833 W with 0 decimals of accuracy
[09:48:43][D][sensor:131]: 'House - Total energy': Sending state 0.15175 kWh with 3 decimals of accuracy
[09:48:46][D][sensor:131]: 'House - Power consumption': Sending state 320.51282 W with 0 decimals of accuracy
[09:48:46][D][sensor:131]: 'House - Total energy': Sending state 0.15200 kWh with 3 decimals of accuracy
[09:48:48][D][sensor:131]: 'House - Power consumption': Sending state 320.28470 W with 0 decimals of accuracy
[09:48:48][D][sensor:131]: 'House - Total energy': Sending state 0.15225 kWh with 3 decimals of accuracy
[09:48:51][D][sensor:131]: 'House - Power consumption': Sending state 320.39871 W with 0 decimals of accuracy
[09:48:51][D][sensor:131]: 'House - Total energy': Sending state 0.15250 kWh with 3 decimals of accuracy
[09:48:54][D][sensor:131]: 'House - Total energy': Sending state 0.15275 kWh with 3 decimals of accuracy
[09:48:57][D][sensor:131]: 'House - Total energy': Sending state 0.15300 kWh with 3 decimals of accuracy
[09:49:00][D][sensor:131]: 'House - Power consumption': Sending state 319.14893 W with 0 decimals of accuracy
[09:49:00][D][sensor:131]: 'House - Total energy': Sending state 0.15325 kWh with 3 decimals of accuracy
[09:49:02][D][sensor:131]: 'House - Power consumption': Sending state 320.39871 W with 0 decimals of accuracy
[09:49:02][D][sensor:131]: 'House - Total energy': Sending state 0.15350 kWh with 3 decimals of accuracy

so when looking at my energy usage via the energy dashboard it reports really high usage over each half hour, where as my energy company dashboard shows a much lower readings (when looking at yesterday)
image

I will need to wait until tomorrow to get the true usage data from my energy provider for todays usage but i will update this ticket then, to give a good example.

I think the issue here must be due to the pulses but im not 100% sure how the calculation is being done

Not detecting LED of Landis&Gyr ZMB120 meter

Hi

I can't get the sensor to detect the LED of my meter. I set the sensitivity to the lowest possible without triggering on it's own. On another meter of a neighbor it works without problems. The ZMB120 uses a green LED instead of a red one, can this be a problem?

I already fixed the wrong polarity of the LED as mentioned in #34

Has anyone maybe some possible suggestions how I could get this to work? Different sensor or something?

Many thanks.

Home Assistant Glow Sensors unavailable

While I can see the Home Assistant Glow Interface showing data, and the energy dashboard showing a moving dot from grid to house, all sensors of home assistant glow in integrations are unavailable

2021-09-06_15h12_46

image

2021-09-06_15h26_12

Any idea what could cause this?

In the Dashboard, I get strange data
2021-09-06_16h06_04

Question on units

Hi,

Unrelated to my other issue about powering it (found out that there's a way to force on my battery), I'm not sure the values it's reading are correct.

What's the unit for the power consumption, it says "Watt" but is that per hour ?
I'm getting values in the 3000 watts, and I can't think of what would be drawing that much right now.

Is the default config in the repo good for 1000 imp / kwh ?

Thanks

ESP doesn't boot when DO connected

Just received all my parts and wired it all up.

I've run into an issue where the ESP32 won't boot if DO (on the photodiode) is connected.

If I disconnect the pin it'll boot fine, I can connect to it, HA sees it - all is well minus getting no data from the sensor.

If I connect the pin after boot log output freezes with the below message:

[D][sensor:131]: 'House - Total energy': Sending state 3.85000 kWh with 3 decimals of accuracy�
[D][light:038]: 'Red' Setting:�
[D][light:049]:   State: OFF�

I've replaced the wires from ESP to photodiode, resoldered the connections, run the ESP from a different power source and reflashed the firmware. I have no idea what else to try - I appreciate this is unlikely to be a glow specific issue but searching around hasn't helped.

Any help would be greatly appreciated!

I get very strange constant Sending state 450000.00000 W readings.

Hi

I get very strange constant Sending state 450000.00000 W readings, anyone also get this. Not sure where to begin.

See my debug log,

[D][sensor:131]: 'House - Power consumption': Sending state 2310.65454 W with 0 decimals of accuracy�
[D][sensor:131]: 'House - Total energy': Sending state 0.05300 kWh with 3 decimals of accuracy�
[D][sensor:131]: 'House - Power consumption': Sending state 450000.00000 W with 0 decimals of accuracy�
[D][sensor:131]: 'House - Power consumption': Sending state 2298.85059 W with 0 decimals of accuracy�
[D][sensor:131]: 'House - Total energy': Sending state 0.05400 kWh with 3 decimals of accuracy�
[D][sensor:131]: 'House - Total energy': Sending state 0.05400 kWh with 3 decimals of accuracy�
[D][sensor:131]: 'House - Power consumption': Sending state 2282.81543 W with 0 decimals of accuracy�
[D][sensor:131]: 'House - Total energy': Sending state 0.05600 kWh with 3 decimals of accuracy�
[D][sensor:131]: 'House - Power consumption': Sending state 450000.00000 W with 0 decimals of accuracy�
[D][sensor:131]: 'House - Power consumption': Sending state 2282.81543 W with 0 decimals of accuracy�
[D][sensor:131]: 'House - Total energy': Sending state 0.05800 kWh with 3 decimals of accuracy�
[D][sensor:131]: 'House - Power consumption': Sending state 450000.00000 W with 0 decimals of accuracy�
[D][sensor:131]: 'House - Power consumption': Sending state 2271.29346 W with 0 decimals of accuracy�
[D][sensor:131]: 'House - Total energy': Sending state 0.05900 kWh with 3 decimals of accuracy�
[D][sensor:131]: 'House - Power consumption': Sending state 450000.00000 W with 0 decimals of accuracy�
[D][sensor:131]: 'House - Total energy': Sending state 0.06100 kWh with 3 decimals of accuracy�
[D][sensor:131]: 'House - Total energy': Sending state 0.06300 kWh with 3 decimals of accuracy�
[D][sensor:131]: 'House - Power consumption': Sending state 2271.29346 W with 0 decimals of accuracy�
[D][sensor:131]: 'House - Total energy': Sending state 0.06400 kWh with 3 decimals of accuracy�
[D][sensor:131]: 'House - Total energy': Sending state 0.06400 kWh with 3 decimals of accuracy�
[D][sensor:131]: 'House - Power consumption': Sending state 2282.81543 W with 0 decimals of accuracy�
[D][sensor:131]: 'House - Total energy': Sending state 0.06600 kWh with 3 decimals of accuracy�
[D][sensor:131]: 'House - Power consumption': Sending state 450000.00000 W with 0 decimals of accuracy�
[D][sensor:131]: 'House - Power consumption': Sending state 2271.29346 W with 0 decimals of accuracy�
[D][sensor:131]: 'House - Total energy': Sending state 0.06700 kWh with 3 decimals of accuracy�
[D][sensor:131]: 'House - Total energy': Sending state 0.06800 kWh with 3 decimals of accuracy�
[D][sensor:131]: 'House - Power consumption': Sending state 2282.81543 W with 0 decimals of accuracy�
[D][sensor:131]: 'House - Total energy': Sending state 0.07000 kWh with 3 decimals of accuracy�
[D][sensor:131]: 'House - Power consumption': Sending state 450000.00000 W with 0 decimals of accuracy�
[D][sensor:131]: 'House - Power consumption': Sending state 2282.81543 W with 0 decimals of accuracy�
[D][sensor:131]: 'House - Total energy': Sending state 0.07200 kWh with 3 decimals of accuracy�
[D][sensor:131]: 'House - Power consumption': Sending state 450000.00000 W with 0 decimals of accuracy�
[D][sensor:131]: 'House - Power consumption': Sending state 2271.29346 W with 0 decimals of accuracy�
[D][sensor:131]: 'House - Total energy': Sending state 0.07300 kWh with 3 decimals of accuracy�
[D][sensor:131]: 'House - Total energy': Sending state 0.07300 kWh with 3 decimals of accuracy�

sensor has gone crazy - sending reading even though light diode is not connected.

Hi

Yesterday I finally got my case and I set this up against my power meter. I start getting data, the data seems reasonable, all good.

This morning I have a look and the thing has gone wild! It is taking in readings at a lightning fast pace.

image

I thought maybe light was getting in from outside so I put some bluetac around it, still going nuts. I disconnected the light diode and readings are still coming through (thats weird :)). I have tried power cycling it, I double checked all the connections and I reflashed OTA.

[21:57:19][D][sensor:131]: 'House - Total energy': Sending state 24.69900 kWh with 3 decimals of accuracy
[21:57:19][D][sensor:131]: 'House - Total energy': Sending state 24.70900 kWh with 3 decimals of accuracy
[21:57:19][D][sensor:131]: 'House - Total energy': Sending state 24.72300 kWh with 3 decimals of accuracy
[21:57:19][D][sensor:131]: 'House - Total energy': Sending state 24.72500 kWh with 3 decimals of accuracy
[21:57:19][D][sensor:131]: 'House - Total energy': Sending state 24.73800 kWh with 3 decimals of accuracy
[21:57:19][D][sensor:131]: 'House - Total energy': Sending state 24.74100 kWh with 3 decimals of accuracy
[21:57:19][D][sensor:131]: 'House - Total energy': Sending state 24.74600 kWh with 3 decimals of accuracy
[21:57:19][D][sensor:131]: 'House - Total energy': Sending state 24.75900 kWh with 3 decimals of accuracy
[21:57:19][D][sensor:131]: 'House - Total energy': Sending state 24.76100 kWh with 3 decimals of accuracy
[21:57:19][D][sensor:131]: 'House - Total energy': Sending state 24.77100 kWh with 3 decimals of accuracy
[21:57:19][D][sensor:131]: 'House - Total energy': Sending state 24.78200 kWh with 3 decimals of accuracy

any ideas on what to do here? Or has my esp32 kicked the bucket?

Battery Powered Glow

Hello,

I have no option of plugging in a USB charger next to meter (shared hallway of a multi-tenant building).

I was thinking a energy efficient Lorawan-Solution which is battery-based might be interesting?

Any thoughts on this?

Constantly rebooting on a 10 minute cycle.

The sensor, for the most part works great. But after 9-11 minutes of running it shuts off for exactly 10 minutes. Could it be a temperature issue or? (It's really quite cold tonight) Also this is my first night trying the sensor for real.

Proposal for an all-in-one enclosure

I flashed this to a Wemos D1 Micro last night and although I have not tested the functionality yet, it flashed OK and it should work as it's an ESP8266. Given the very small size of the Wemos D1 Mini, this led me to think that there is potential for the sensor and MCU to be in a single case, which would be quite a neat solution I think. Unfortunately I'm not skilled at 3D design, but maybe someone in the community could design something?

German Meter WS74 (WS7412.1) works with Infrared LED - Will it also work?

Fantastic job! That is really great, what you have created!

Now I also need to monitor my energy usage. So I have checked my meter for an LED, but it was not visible (at least for the human eye). So I've had a look at the manual and it says it is an infrared LED (5000 Imp/kWh). I am wondering if the photodiode will also work, or do I need a different one?

I have attached a photo of my meter as well as a screenshot of the manual. Here you can find the full manual in German

Thanks in advance and have a nice day!

Bildschirmfoto 2021-08-05 um 14 27 34

IMG_3753

Cant see any entity or values

Ive got a working pulse counter and in the past I send the values via mqtt. Now I copyed your yaml file and do the changes for my secrets etc. At the webinterface i can see all the values and their updates. But Ive got no entity at ha nothing at developer console, What I`m doing wrong i want to use the new energy function.

Please help.
Best regards
Sascha

---
#
substitutions:
  device_name: pulse_counter
  friendly_name: House
  device_description: "Measure your energy consumption with the pulse LED on your smart meter"
  pulse_pin: GPIO0
  status_led: GPIO2

esphome:
  name: '${device_name}'
  comment: '${device_description}'
  project:
    name: "klaasnicolaas.home_assistant_glow"
    version: "1.1.1"
  platform: ESP8266
  board: d1_mini

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_pass

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: '${device_name}'
    password: !secret fallback_password

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:
  #password: !secret esphome_api_password

ota:
  safe_mode: true
  reboot_timeout: 10min
  num_attempts: 5

web_server:
  port: 80
  auth:
    username: !secret esphome_web_username
    password: !secret esphome_web_password

output:
  # - platform: gpio
  #   pin: GPIO5
  #   id: output_blue
  - platform: gpio
    pin: GPIO2
    id: output_red
  - platform: gpio
    pin: GPIO5
    id: output_green

light:
  - platform: binary
    internal: true
    id: led_red
    name: Red
    output: output_red

# Status LED for connection
status_led:
  pin:
    # Blue LED
    number: ${status_led}

# Sensors for ESP version and WIFI information
text_sensor:
  - platform: version
    hide_timestamp: true
    name: "${friendly_name} - ESPHome Version"
  - platform: wifi_info
    ip_address:
      name: "${friendly_name} - IP Address"
      icon: mdi:wifi
    ssid:
      name: "${friendly_name} - Connected SSID"
      icon: mdi:wifi-strength-2

sensor:
  - platform: pulse_meter
    name: '${friendly_name} - Power consumption'
    unit_of_measurement: 'Watt'
    icon: mdi:flash-outline
    accuracy_decimals: 0
    pin: ${pulse_pin}
    on_value:
      then:
        - light.turn_on:
            id: led_red
            flash_length: 400ms
    filters:
      # multiply value = (60 / imp value) * 1000
      - multiply: 12
    total:
      name: '${friendly_name} - Total energy'
      unit_of_measurement: 'kWh'
      icon: mdi:circle-slice-3
      last_reset_type: auto
      state_class: measurement
      device_class: energy
      accuracy_decimals: 3
      filters:
        - multiply: 0.001

image

Constantly disconnecting and reconnecting

I was about to put the sensor on my meter when I did a final test with it in the case (Different from the official one). Now it constantly reboots and restarts creating a loop. It ended up just looping this
ERROR Error while reading incoming messages: Error while receiving data: [Errno 104] Connection reset by peer
WARNING Disconnected from API: Error while receiving data: [Errno 104] Connection reset by peer
INFO Connecting to home-meter.local:6053 (10.0.1.82)
WARNING Couldn't connect to API (Timeout while waiting for message response!). Trying to reconnect in 1 seconds
INFO Connecting to home-meter.local:6053 (10.0.1.82)
WARNING Couldn't connect to API (Error connecting to 10.0.1.82: timed out). Trying to reconnect in 1 seconds
INFO Connecting to home-meter.local:6053 (10.0.1.82)
INFO Successfully connected to home-meter.local

Active/Reactive power measurements

Hi,

I'm not sure this is the right place for this question, so if it's not, please feel free to close this issue/point me elsewhere.

TL-DR: I'm know very little about power measurement: Do I need to bother about reactive power? If so, how do I measure it?


The energy meeter (3-phase, 220v AC) in my apartment has 2 LEDs, and they are labeled as "Active" and "Reactive". So far I could only notice the Active blinking. (I can post a picture of it, if required)

Now I know very little about energy measurement, but I've read a bit about this matter online.
Most of the material is either too simplistic and offers naive comparisons, or is too technical and mention other terms that I also don't have a full grasp of, like the power factor, being inductive or capacitive, or " reactive bounces back and forth between source and load" (whatever that means)

I do understand that Reactive power is not actually consumed by circuits, so some countries/providers do not charge for this kind of load/"consumption".
Since my meeter does mention it, I'm assuming that my provider does account for it (either direct or indirectly).
I tried their website, but information in there is imprecise and confusing (I guess very few customers ask these questions), so I really don't know whether or I pay for it.

I'm having a hard time grasping:

  • Whether or not I should bother/care about reactive power measurement
  • How do I measure reactive power
  • Whether or not reading only the active power will be representative of my actual energy usage/footprint
  • Understand the core concepts

I'd appreciate if anyone could help me get tho these points, or point me in the right direction.

Filtering out extreme values

I seem to be getting some noise on my sensor and I get very extreme values when this happens. These readings are usually over 100,000 W up to over 1 million some times.

I have found a lambda filler that has a max difference value but am not smart enough to combine the current lambda filter with this one and I can't find in the esphome docs if I can have two lambda filters and it process in order or not.

This is the filter I have found
filters:
- lambda: |-
float MAX_DIFFERENCE = 50000.0; // adjust this!
static float last_value = NAN;
if (isnan(last_value) || std::abs(x - last_value) < MAX_DIFFERENCE)
return last_value = x;
else
return {};

And I need to combine it with the current filter of

  • lambda: return x * ((60.0 / ${pulse_rate}) * 1000.0);

Calculation of per minute energy usage

Apologies if I have got this wrong but isn't line 111 of the yaml file incorrect if your pulse rate is not 1000. If for example the pulse rate is 4000 then the current calculation " - lambda: return x * ((60.0 / ${pulse_rate}) * 1000.0);" ends up giving an estimate of 15 minutes consumption not per hour. i would suggest that it needs to be multiplied by pulse rate not 1000 -

Apologies I have just realised my error - please ignore

Is anyone using an ESP8266?

The project page makes reference to ESP32/8266. Does anyone have any experience using it with an ESP8266? I know they are both cheap cards, but I have spare ESP8266 cards which I try to use up for project that are suitable.

How to power it

Hi,

I had everything (except the LED) on hand so I gave this a try, but I don't know how to power it.
I tried plugging it in to a usb battery (the kind you'd charge you phone with) but it keeps turning off, I think it's not drawing enough for the battery to stay on. Maybe I need a dumber battery.

What's a good way to power this ? Any way to not have to recharge a battery regularly, if I find one that works ?

As a bonus question, is there any risk of conflict with the guy who comes to read the meter from time to time, could they have an issue with finding this attached to the meter ? The meter LED is just below the screen, it's still readable but it's definitely a bit in the way.

Thanks

Photodiode sensitivity not enough for led detection + red led stays on

Hi, I'm having a couple of issues :

  1. I have the recommended photodiode but doesn't seem to be sensitive enough to pick up the meter led
  2. I can use a torch to trigger the photodiode but often the red light will tend to stay on permanently

On (1) I've adjusted to pot so the D0-LED on the photodiode board is just off. From there I can get the red led to light and see a detection registering in the logs when I get a torch and shine it right up to the photodiode.

It's entirely possible this is some hardware fault with the photodiode sensor, or that this version just isn't sensitive enough or something, but I thought I'd ask since it's not hugely clear to me. Given the ESPHome sensor type is essentially "pulse" I suspect all the logic around outputting a pulse to D0 is done on the photodiode board, so this is probably not some code or config issue? Maybe I should reorder the same board or perhaps there's an alternative with better sensitivity?

On (2) I can use a torch to trigger the photodiode and I see log entries appearing for the detection. Moving the torch away the red led stays on though, my understanding is it should turn itself off?

Worth noting that even though the led stays on, moving the torch back over the photodiode does register a secondary detection, so if this is an issue it doesn't seem to be with light detection as such, more around turning on/off the led.

LED constantly on since updating

Since updating the glow yaml to 1.2 and esphome to 2021.8.0 the LED on my glow sensor is constantly on where as prior to this it flashed in sync with the pulse of my smart meter.

Is there a setting that needs to be changed in the yaml?

Question about Energy total

My Sensor run since round about 24h. The Energy usage every second looks like before with my own configuration pulse-counter. But the total energy consumption is now doubled. So at night, I have an energy consumption round about 250W every second tell the sensor but at HA ist shows it should be 1.5kwh. Are these values correct it feels much to high ?

Do you have any idea ?

Best regards
Sascha

Every other power consumption reading is 0W.

Every other power consumption reading is 0 W. I can see that the photodiode works correctly from its led and it flashes just like the led on the power meter. I have a meter that has 10000 impulses per 1 kWh.

I have shortened the config because i have no need for the leds or web server.

#
substitutions:
  device_name: home_assistant_glow
  friendly_name: House
  device_description: "Measure your energy consumption with the pulse LED on your smart meter"
  pulse_pin: GPIO12

esphome:
  name: '${device_name}'
  comment: '${device_description}'
  project:
    name: "klaasnicolaas.home_assistant_glow"
    version: "1.1.2"
  platform: ESP32
  board: esp32doit-devkit-v1

wifi:
  ssid: "redblock"
  password: "si(ni2neb3fanhGEe!vo4neGna"
  fast_connect: true

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: '${device_name}'
    password: "luVL44uRRwpW"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: "asidna3tq3t9ah2A)RF#HA9ah3fa"

ota:
  safe_mode: true
  reboot_timeout: 10min
  num_attempts: 5

sensor:
  - platform: pulse_meter
    internal_filter: 8us
    name: '${friendly_name} - Power consumption'
    unit_of_measurement: 'W'
    state_class: measurement
    device_class: power
    icon: mdi:flash-outline
    accuracy_decimals: 0
    pin: ${pulse_pin}
    filters:
      # multiply value = (60 / imp value) * 1000
      - multiply: 6
    total:
      name: '${friendly_name} - Total energy'
      unit_of_measurement: 'kWh'
      icon: mdi:circle-slice-3
      last_reset_type: auto
      state_class: measurement
      device_class: energy
      accuracy_decimals: 3
      filters:
        # multiply value = 1 / imp value
        - multiply: 0.0001`

How to calculate price as per the units consumed

Hi , this is great and thank you for wonderful project. as i saw in HA their is option to calculate static price per kWH consumed. but here in my place its completely different. could anyone help me how to make this work in home assistant to calculate the cost as bellow. and here its calculated every two months
here the price is calculated per kwh with range
FOR
0-100kwh (no cost)
101-200kwh (3.5 rupees)
201-500kwh (4.6 rupees)
500kwh (6.6 rupees)

calculation

3200 / kwh meter - esphome config ?

Hi there,

I have a meter that has a 3200 / kwh pulse rate rather than a 1000 /kwh pulse rate ..how would I change the config to allow for this ..I have tried to work it out but have not found anything that makes sense

if you could let me know where and how I need to change my config that woul be amazing

cheers

Richard

Calculating Remaining Units

I love this integration. Got it working quite well with an LDR since I don't have access to photodiode.

I have a prepaid meter where I load e.g 500 units at the beginning of the month. Since I can look on the display to see there are currently 537.1 units left, I'm looking for tips on how I can manually enter this into HA and then expose/calculate the remaining units in HA (since glow is able to tell me how many times the light blinked - i.e. how many units I have consumed.)

Any nifty ways for achieving this in HA?

How to use this and use as little power as possible? Deep sleep? Disconnect wifi?

I'm trying to use a large battery to get some readings without having to touch the mains wiring.

Is it possible to use any sleep modes to preserve power? Could we wake when the impulse comes in and increase the counter? If not can we disconnect the wifi and only sync once per minute for example?

Any other suggestions more than welcome.

Use for Gas-Meter

Hello
In Germany many of the gas meters are non electric but emmit a magnetic impuls e.g 1x per 1/10 m³.
I replaced the board with the sensitive LED by a magnetic switch (KY-021 mini) and foud that it can be triggert by a magnet in the same way (like with the LED).

Cannot test it at the moment because our gas heating is not running yet - but will try to test A.S.A.P.

May be there could be a Gas-spinn-off with m³ and names according to that new GAS function.

Total count is very high

Great project Klaas, thanks!

I have a LDR based sensor I made a while ago, it worked great - accurate to my energy supplier's readings - but i wanted to update to use with the new energy integration, so used yours. Now the hourly totals is very high - not reflecting my real use.

I used to use this:

sensor:
  - platform: pulse_meter
    id: electricity
    pin:
      number: GPIO5
      mode: INPUT_PULLUP
    unit_of_measurement: 'kW'
    name: '${friendly_name} - Electricity Meter'
    internal_filter: 75ms
    filters:
      - multiply: 0.01875

# Daily Count
  - platform: total_daily_energy
    name: '${friendly_name} - Daily Total'
    power_id: electricity

# Enable time component to reset energy at midnight
time:
  - platform: homeassistant
    id: hasstime

and now I've got this:

sensor:
  - platform: pulse_meter
    name: '${friendly_name} - Electricity Meter'
    icon: mdi:flash-outline
    unit_of_measurement: 'Watts'
    pin:
      number: GPIO5
      mode: INPUT_PULLUP
    internal_filter: 75ms
    accuracy_decimals: 2
    filters:
      - multiply: 18.75
    total:
      name: '${friendly_name} - Total Electricity'
      unit_of_measurement: 'kWh'
      icon: mdi:circle-slice-3
      last_reset_type: auto
      state_class: measurement
      device_class: energy
      accuracy_decimals: 3
      filters:
        - multiply: 0.001

There isn't much documentation about the total variable, so I'm not sure if I have it right - but on the face of it, it appears fine ... clearly something's going wrong! I'll add, in the new configuration the instantaneous Electricity Meter still appears correct with what is using power in the house.

Resistor for output LED?

Has anybody used a resistor for the output LED using the components mentioned in the readme file? If I understand correctly ESP32 pins supply 3.3V and the output LED is rated for 3V.

Esp8266 module

Hi,

Are it possible to port this great project to esp8266 chip type ?

best regards
Phillip J.

Question about photodiode sensitivity

Hello all,

First of all, let me congratule you for this project! 🎉

It's been a long time since I wanted to start playing with some ESP32 devices, and this has been enough to buy one 😋 I received my ESP32 a couple of days ago and I've been doing some testing since today.

The reason I'm opening this issue is because I would like to ask if there is some way to change the sensitivity of the photodiode sensor. In spain we have some sort of methacrylate protecting our meters, this means there is a gap between the meter light and the photodiode. As far as I could check, this gap is preventing my sensor to properly read data. I manged to emulate this by using my smartphone. I realised it only worked fine when the sensor was stucked to the camera led... but it fails when there is a gap bigger to 1 cm.

So, do you know if there is any chance to change this sensitivity?

Thanks in advance! :)

Extra Config for LDRs

I know that using an LDR isn't recommended, but for some reason finding a 4 pin photodiode or similar is impossible down here in Australia. The only way I can get one is from Alibaba or similar and I don't want to wait that long. Can anyone share with me the extra config and different wiring guide for using an LDR thanks!

Suggestions for updating readme

I've got this working now but I would have found it easier with the following pointers so these are documentation suggestions that might help others;

  • show how to bend the sensor to fit the 3D case ( I know this must seem obvious but I scratched my head worrying I'd got the wrong component for a bit)
  • mention the need to adjust the sensitivity of the photodiode to suit the meter led. I found one of the meters much darker than the other and this took several adjustments to get it working
  • mention that it is possible to use 2 glow sensors if your solar meter also has a pulse led and integrate this with the Energy dashboard

I found the pulse_meter behaved strangely with the solar meter. I switched to use pulse_counter and it seems to be stable if slower to update - I guess it updates at a lower frequency

I defined an additional pin (I use 13) as solar_pin

great work by the way - I now have a working HA Energy dashboard working for the cost of a few sensors!

Extract from my yaml

sensor:
  - platform: pulse_meter #counter
    name: '${friendly_name} - Power consumption'
    unit_of_measurement: 'W'
    state_class: measurement
    device_class: power
    icon: mdi:flash-outline
    accuracy_decimals: 0
    pin: ${pulse_pin}
    on_value:
      then:
        - light.turn_on:
            id: led_red
            flash_length: 400ms
    filters:
      # multiply value = (60 / imp value) * 1000
      # - multiply: 60
      - lambda: return x * ((60.0 / ${pulse_rate}) * 1000.0);
    total:
      name: '${friendly_name} - Total energy'
      unit_of_measurement: 'kWh'
      icon: mdi:circle-slice-3
      last_reset_type: auto
      state_class: measurement
      device_class: energy
      accuracy_decimals: 3
      filters:
        # multiply value = 1 / imp value
        # - multiply: 0.001
        - lambda: return x * (1.0 / ${pulse_rate});
  - platform: pulse_counter
    name: '${friendly_name} - Solar production'
    unit_of_measurement: 'W'
    state_class: measurement
    device_class: power
    icon: mdi:flash-outline
    accuracy_decimals: 0
    pin: ${solar_pin}
    on_value:
      then:
        - light.turn_on:
            id: led_red
            flash_length: 400ms
    filters:
      # multiply value = (60 / imp value) * 1000
      # - multiply: 60
      - lambda: return x * ((60.0 / ${pulse_rate}) * 1000.0);
    total:
      name: '${friendly_name} - Total solar'
      unit_of_measurement: 'kWh'
      icon: mdi:circle-slice-3
      last_reset_type: auto
      state_class: measurement
      device_class: energy
      accuracy_decimals: 3
      filters:
        # multiply value = 1 / imp value
        # - multiply: 0.001
        - lambda: return x * (1.0 / ${pulse_rate});        

Measurement on bi-directional meter (Germany/Zweirichtungszähler)

Hello
My house has a bi-directional meter with an IR-Signal (10.000 imp./kWh) which works fine with the sensor in general BUT:
As this is recording exported and imported energy the results fit to other measurements of imported or exported energy quite well, but as the impulses do not have an algebraic sign (math. +/-) the signal itself does not provide sensful measurements - especially when I try to interpret the total values over time.

2021-08-24 08_22_25-

Does anybody have a good idea how to sepatate the imported and exported values?

2021-08-24 08_04_30-Grafana - Home Assistant
Green Line: Glow Sensor - Yellow Dots: Imported - Blue Dots: Exported

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.