klaasnicolaas / home-assistant-glow

⚡ The power of energy measurements in your house
https://glow-energy.io/
MIT License
1.07k stars 164 forks source link

Glow calculates too much, what can I do? #157

Closed Lorthiz closed 8 months ago

Lorthiz commented 2 years ago

Hello, I am kind of new to this whole HA/ESPHome/monitoring/sensors thing, but I wanted to check how accurate glow is nad from my basic math comparing power on my power counter(the main one mounted by power company) this is what I got: At midight of 09.04.2022 there was X, At midnight of 10.04.2022 there was Y, Difference between X and Y is 10,9kWh, Glow collected data is showing 13,37kWh so that is error of above 20% ;/ Now I am trying to find a cause for that, from what I understand glow is reacting too much and recording too much data. I have photodiode, I set internal_filter: 100ms, diode is inside 3dprinted case and I used thin 2sided tape to mount it to the power counter - power counter is also in a pretty dark place so there is little chance that Glow could fire from sunlight or light bulbs. So I think that conditions should be correct for it to work properly. Logs are somethign that makes me a little suspicious. There are duplicated records for total energy/daily energy inside. If that is not a problem are there any more settings I can change to make it more accurate? If it fires too often meaby I should increase internal_filter even more?

I set Daily energy in Home Assistant as my main 'power consumption'.

00:24:31 | [D] | [sensor:125] | 'House - Power Consumption': Sending state 963.85541 W with 0 decimals of accuracy
-- | -- | -- | --
00:24:31 | [D] | [light:035] | 'Red' Setting:
00:24:31 | [D] | [light:046] | State: ON
00:24:31 | [D] | [sensor:125] | 'House - Daily Energy': Sending state 0.34706 kWh with 3 decimals of accuracy
00:24:31 | [D] | [sensor:125] | 'House - Total Energy': Sending state 36.67900 kWh with 3 decimals of accuracy
00:24:31 | [D] | [sensor:125] | 'House - Total Energy': Sending state 36.67900 kWh with 3 decimals of accuracy
00:24:32 | [D] | [light:035] | 'Red' Setting:
00:24:32 | [D] | [light:046] | State: OFF
00:24:35 | [D] | [sensor:125] | 'House - Power Consumption': Sending state 972.97302 W with 0 decimals of accuracy
00:24:35 | [D] | [light:035] | 'Red' Setting:
00:24:35 | [D] | [light:046] | State: ON
00:24:35 | [D] | [sensor:125] | 'House - Daily Energy': Sending state 0.34806 kWh with 3 decimals of accuracy
00:24:35 | [D] | [sensor:125] | 'House - Daily Energy': Sending state 0.34806 kWh with 3 decimals of accuracy
00:24:35 | [D] | [sensor:125] | 'House - Total Energy': Sending state 36.68000 kWh with 3 decimals of accuracy
00:24:36 | [D] | [light:035] | 'Red' Setting:
00:24:36 | [D] | [light:046] | State: OFF
00:24:39 | [D] | [sensor:125] | 'House - Power Consumption': Sending state 969.30530 W with 0 decimals of accuracy
00:24:39 | [D] | [light:035] | 'Red' Setting:
00:24:39 | [D] | [light:046] | State: ON
00:24:39 | [D] | [sensor:125] | 'House - Daily Energy': Sending state 0.34906 kWh with 3 decimals of accuracy
00:24:39 | [D] | [sensor:125] | 'House - Daily Energy': Sending state 0.34906 kWh with 3 decimals of accuracy
00:24:39 | [D] | [sensor:125] | 'House - Total Energy': Sending state 36.68100 kWh with 3 decimals of accuracy
00:24:39 | [D] | [light:035] | 'Red' Setting:
00:24:39 | [D] | [light:046] | State: OFF
00:24:42 | [D] | [sensor:125] | 'House - Power Consumption': Sending state 971.92224 W with 0 decimals of accuracy
00:24:42 | [D] | [light:035] | 'Red' Setting:
00:24:42 | [D] | [light:046] | State: ON
00:24:42 | [D] | [sensor:125] | 'House - Daily Energy': Sending state 0.35006 kWh with 3 decimals of accuracy
00:24:42 | [D] | [sensor:125] | 'House - Total Energy': Sending state 36.68200 kWh with 3 decimals of accuracy
00:24:43 | [D] | [light:035] | 'Red' Setting:
00:24:43 | [D] | [light:046] | State: OFF
Lorthiz commented 2 years ago

Additional info I did not thought about. I also have solar panels is it possible that energy used from solar panels is triggering a 'blink' while not being calculated by power counter as power consumption?

banemonster commented 2 years ago

I have solar panels, my meter shows a solid red light when solar is being exported. I solved this with the timeout: 15 sec value shown below. It's set to 15 seconds, so the light comes on and remains on, after 15 sec the measurement defaults to 0 and doesn't start displaying usage again until the light starts blinking.

sensor:
  # WiFi signal
  - platform: wifi_signal
    name: "${friendly_name} - WiFi Signal"
    update_interval: 120s

  # Pulse meter
  - platform: pulse_meter
    name: '${friendly_name} - Power Consumption'
    id: sensor_energy_pulse_meter
    unit_of_measurement: 'W'
    state_class: measurement
    device_class: power
    icon: mdi:flash-outline
    accuracy_decimals: 0
    pin: ${pulse_pin}
    timeout: 15 sec
    internal_filter: 200ms
    on_value:
      then:
        - light.turn_on:
            id: led_red
        - delay: 0.5s
        - light.turn_off:
            id: led_red`
cliffordwhansen commented 2 years ago

@Lorthiz I had a similar issue where Glow was reporting my usage as 33KW, after adding the internal_filter: 200ms it is now a realistic 1KW

markusg1234 commented 2 years ago

I Have Solar panels also and unfortunately my meter blinks if power is being exported or imported from the grid.

banemonster commented 2 years ago

I Have Solar panels also and unfortunately my meter blinks if power is being exported or imported from the grid.

Are you 100% sure it blinks on export?

If I'm exporting it's solid lit, however if I'm exporting for instance 2kw but my house is drawing 2.5kw then the led blinks but only at the rate of 0.5kw import.

markusg1234 commented 2 years ago

I Have Solar panels also and unfortunately my meter blinks if power is being exported or imported from the grid.

Are you 100% sure it blinks on export?

If I'm exporting it's solid lit, however if I'm exporting for instance 2kw but my house is drawing 2.5kw then the led blinks but only at the rate of 0.5kw import.

Yeap as my Glow matches the lcd display of current solar output minus what the house is drawing.

I also see the led blinking when the solar is over the house draw or under the house draw.

andrewb2102 commented 1 year ago

Did you find a fix for this?

ahmadyusuf commented 1 year ago

Try using the left calculation method for the daily power sensor instead of the default, that fixed the issue for me

Total day useage

klaasnicolaas commented 1 year ago

Is there a somewhat in-depth explanation of what makes the difference in these methods? Because if this makes it easier for people with solar panels to use the Glow, that would be very nice.

ahmadyusuf commented 1 year ago

@klaasnicolaas here you go:

https://community.home-assistant.io/t/riemann-integral-calculates-wrong-values-with-electrical-devices/328174

klaasnicolaas commented 1 year ago

Maybe not a bad idea to add the method: left to the code (but as a comment) and explanation in the FAQ 🤔

sparkyws commented 11 months ago

GPIO26 fixed all my high readings

https://github.com/klaasnicolaas/home-assistant-glow/issues/300#issue-1832134027

klaasnicolaas commented 8 months ago

Closing the issue, if your measurements are too high, it is best to first check whether you have properly adjusted the photodiode in terms of sensitivity and, if that does not help, set the internal_filter (see also the docs).