Sensor dropout

I’m having trouble with sensor dropout (rainforest eagle). I don’t know if it’s from the zigbee connection or from the device itself, but sometimes I get a zero instead of the total energy delivered. Is there a way to trap that, and use the last good/non-zero reading? Something via the stats integration or something?

Thanks for any suggestions.

Does it became unavailable during that period when you are getting 0? If yes, maybe you can create another sensor and uses availability template-

template:
  - sensor:
      - name: "Eagle Total Energy"
        unit_of_measurement: "kWh"
        state_class: measurement
        device_class: energy
        state: >-
          {{ states('sensor.eagle_total_energy') }}
        attributes:         
          last_reset: '1970-01-01T00:00:00+00:00'
        availability: >-
          {{ not 'unavailable' in states('sensor.eagle_total_energy') }}

Replace sensor.eagle_total_energy with your energy entity_id.

Try it with a filter for sensors, in your case I’d suggest the outlier. See here:

I’m also suffering from a similar issue with an Old legacy Eagle device, on reboot/dropout it loves to report 0, and while I can create the output i want with an outlier filter, the filtered output is not valid input for the new ‘grid consumption’ field. I can’t find any documentation on how to apply a filter to a custom sensor like the 1st example, and the default ‘filter’ entity doesn’t allow state_class to be set to ‘total_increasing’. is there a way to apply the filter to the template sensor directly? or have the template not wildly outlying data?

I’m hoping this is the right thread to chime in on.
Lately I’ve been seeing significant drop outs from the Eagle-200 (HA Integration) as it just shows unavailable. I just assumed this was their cloud service, but it’s all the time now; every hour or two, it’s unavailable for about 5 min.

I added a local webhook entry in the Eagle along with the respective HA sensor. That approach is flawless of course, but that webhook sensor, AFAIK, can not be leveraged by the Energy dashboard.

I don’t know if this helps (the Energy dashboard), but I set up an automation that fires when the Eagle shows unavailable, and it sets the sate of the integration’s sensor with the value from the webhook sensor.

Any suggestions?
Just trying to ensure the Energy Dashboard is accumulating data consistently.

Tnx