Glow is sending strange data

Here is the log for the glow sensor. It looks like it sends a reasonable reading: Sending state 496.14114 W and then immediately an unreasonable reading Sending state 400000.00000 W
Is this something to do with the way it’s configured?

[D][sensor:131]: 'House - Power consumption': Sending state 496.14114 W with 0 decimals of accuracye
[D][light:038]: 'Red' Setting:e
[D][light:049]:   State: ONe
[D][sensor:131]: 'House - Total energy': Sending state 8.50800 kWh with 3 decimals of accuracye
[D][sensor:131]: 'House - Power consumption': Sending state 400000.00000 W with 0 decimals of accuracye
[D][light:038]: 'Red' Setting:e
[D][light:038]: 'Red' Setting:e
[D][light:049]:   State: OFFe
[D][light:038]: 'Red' Setting:e
[D][sensor:131]: 'House - Power consumption': Sending state 493.55634 W with 0 decimals of accuracye
[D][light:038]: 'Red' Setting:e
[D][light:049]:   State: ONe
[D][sensor:131]: 'House - Total energy': Sending state 8.51000 kWh with 3 decimals of accuracye
[D][sensor:131]: 'House - Power consumption': Sending state 400000.00000 W with 0 decimals of accuracye

I’m having exactly the same thing, different number, but still way out of whack. I’ve adjusted the photodiode so it’s just belo going off in the ambient light (which I’m assuming it’s correct), but I’m a bit Lost as where to go from here.

Blockquote
18:02:25][D][sensor:118]: ‘House - Total energy’: Sending state 4.07000 kWh with 3 decimals of accuracy
[18:02:30][D][sensor:118]: ‘House - Total energy’: Sending state 4.08400 kWh with 3 decimals of accuracy
[18:03:02][D][sensor:118]: ‘House - Power consumption’: Sending state 3600000.00000 W with 0 decimals of accuracy
[18:03:02][D][light:035]: ‘Red’ Setting:
[18:03:02][D][light:046]: State: ON
[18:03:02][D][sensor:118]: ‘House - Total energy’: Sending state 4.10000 kWh with 3 decimals of accuracy
[18:03:03][D][light:035]: ‘Red’ Setting:
[18:03:03][D][light:046]: State: OFF
[18:03:06][D][sensor:118]: ‘House - Power consumption’: Sending state 0.00000 W with 0 decimals of accuracy
[18:03:06][D][light:035]: ‘Red’ Setting:
[18:03:06][D][light:046]: State: ON
[18:03:06][D][sensor:118]: ‘House - Total energy’: Sending state 4.12500 kWh with 3 decimals of accuracy
[18:03:06][D][light:035]: ‘Red’ Setting:
[18:03:06][D][light:046]: State: OFF
[18:03:40][D][sensor:118]: ‘House - Power consumption’: Sending state 1800000.00000 W with 0 decimals of accuracy
[18:03:40][D][light:035]: ‘Red’ Setting:
[18:03:40][D][light:046]: State: ON
[18:03:40][D][sensor:118]: ‘House - Total energy’: Sending state 4.13400 kWh with 3 decimals of accuracy
[18:03:41][D][light:035]: ‘Red’ Setting:

@moorep have a look at this discussion https://github.com/klaasnicolaas/home-assistant-glow/issues/47
in short it’s either that the sensor is soldered on the wrong way, or there needs to be a

internal_filter: 100ms

added to config.

(i’ve not resolved my problem yet)

Thanks, but I’ve already done both. Did the photo diode a few days ago, and the internal filters today. No change.

Also tried changing the filter timing to 50ms without any difference.

I added

        - lambda: |-
            float MIN_VALUE = 0.0;
            float MAX_VALUE = 23000.0;
            if (MIN_VALUE <= x && x <= MAX_VALUE) return x;
            else return {};

to my list of filters to drop values that are impossible. I set the filter to ignore values over 23000w - 230v line voltage and my meter is marked as “Max 100A”, so anything more than 23kW is impossible. Its not completely eliminated the issue but its cut down on a lot of the bad readings

Just to let you know. After fiddling with the photodiode taking it in and out, I broke my dodgy soldering. I re-soldered the diode back and it’s now working as expected (with the 100ms entry) for the last 6 hours.

I didn’t flip the diode, did that a few days ago, but since re-soldering I’ve had to turn the adjustment down as it was activating in daylight with the previous setting.

Hope this helps

1 Like

This is of course a kind of a solution, but it should really be done in the firmware of the ESP.

That is in the firmware of the ESP. My ESPHome config looks a little like

sensor:
  - platform: pulse_meter
    name: 'House Power Meter'
    unit_of_measurement: 'W'
    state_class: measurement
    device_class: power
    icon: mdi:flash-outline
    accuracy_decimals: 0
    internal_filter: 5ms
    pin: D1
    filters:
      # multiply value = (60 / imp value) * 1000
      # - multiply: 60
      - lambda: return x * ((60.0 / 1000) * 1000.0);
      - lambda: |-
            float MIN_VALUE = 0.0;
            float MAX_VALUE = 23000.0;
            if (MIN_VALUE <= x && x <= MAX_VALUE) return x;
            else return {};            
    total:
      name: 'House 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 / 1000);
        - lambda: |-
            float MIN_VALUE = 0.0;
            float MAX_VALUE = 23000.0;
            if (MIN_VALUE <= x && x <= MAX_VALUE) return x;
            else return {};        

Right, what i meant was that firmware should filter erroneous values out by default, without having to specify that explicitly.

One thing i noticed, when just testing the sensor board, (as it has a LED indicator), sometimes instead of switching from on to off, i faintly glows for a short time. Could that be some hi frequency “bounce” that confuses the application? If that is the case then it’s the sensor board that is at fault, and all that can be done in software is a filter

Hi there
Had the same problem with the strange values.
Today I adjusted the sensitivity of the photodiode with the potentiometer on the board.
The diode-setting was way too sensitive.
After this adjustment, it works very well without sending any strange values.
You can see the before/after effect in the picture.
I’m using the photodiode linked on the glow github-page.

I tried all sorts of things to sort this. On the ESP32 I changed from on GPIO12 to GPIO26 and all extreme values disappeared

Updated to the esphome to 2022.3 and started using the internal_filter_mode = ‘PULSE’ with the internal_filter set to 120ms

  • internal_filter_mode (Optional, string): Determines how the internal filter is applied. One of EDGE and PULSE. Defaults to EDGE. In EDGE mode subsequent rising edges are compared and if they fall into an interval lesser than the internal filter value, the last one is discarded. In PULSE mode the rising edge is discarded if any further interrupts are detected before the internal_filter time has passed. In other words, a high pulse must be at least internal_filter long to be counted. This is useful if you are detecting long pulses that may bounces before and/or after the main pulse.

It seems as though the EDGE mode was very sensitive to the photodoide signal “bouncing” creating a phenomenal amount of noise

I’ve got solar so the usage is basically zero for this screenshot.