SRP Energy Integration not working

I dont understand this behavior at all. I am not giving back any power, nor is it configured to do so.

But, maybe thats just HA compensating for the weird numbers the srp integration is giving

-11.4 kWh - +6.6 kWh = -4.8 kWh

:man_shrugging:

srpworkingkinda

:man_shrugging:

template:

- sensor:
    - name: SRP Main Energy
      device_class: energy
      state_class: total_increasing
      unit_of_measurement: kWh
      state: "{{ states('sensor.srp_energy') }}"

Thats it.

One thing I noticed though.

read

Meter gets read a day late. So yeah…

anyone having anymore luck with this SRP Integration? Its almost completely useless in its current state. I wanted to install CT clamps and just ignore this SRP Integration but due to the way the breaker panel is i cannot do that either.

I parked the issue last year when I ran into trouble with crashes due to swap memory size. Will have a look at this again. Did anyone ever reachout to the code owner?

i cant even figure out how to find the energy section to edit anything now., WTF/

Lol. they put it in dashboards… what in the…?

I swear I am baffled constantly by the main people in charge. 3 years ive been at this. and im pretty active here on the forums, as far as reading goes:

  • 822 days visited
  • 15d read time
  • 6h recent read time
  • 2.9k topics viewed
  • 50.9k posts read
    …

still cant even keep up with all the little changes they make. I read every release notes, and usually even instal the beta on my main instance.

little changes like this drives me insane. ugh.

like the fan speed names fiasco I pretty much gave up on the energy stuff too. 2 steps forward, 10 back,.

started looking into operation, was suprised to see that it runs every 1440 seconds, or 24 minutes, since the data only changes 1 per day. I modified sensor.py module to print out the intermediate values, on first run it captured. next step is to see what shows up when the update does not work.

2022-03-06 08:41:03 DEBUG (MainThread) [homeassistant.components.srp_energy.sensor]
start:2022-03-05 08:41:02.093142
end:2022-03-06 08:41:02.093173
tou: False hour:[
(β€˜03/05/2022’, β€˜00:00 AM’, β€˜2022-03-05T00:00:00’, 0.2, 0.05),
(β€˜03/05/2022’, β€˜01:00 AM’, β€˜2022-03-05T01:00:00’, 0.3, 0.05),
(β€˜03/05/2022’, β€˜02:00 AM’, β€˜2022-03-05T02:00:00’, 0.2, 0.04),
(β€˜03/05/2022’, β€˜03:00 AM’, β€˜2022-03-05T03:00:00’, 0.3, 0.05),
(β€˜03/05/2022’, β€˜04:00 AM’, β€˜2022-03-05T04:00:00’, 0.2, 0.05),
(β€˜03/05/2022’, β€˜05:00 AM’, β€˜2022-03-05T05:00:00’, 0.3, 0.05),
(β€˜03/05/2022’, β€˜06:00 AM’, β€˜2022-03-05T06:00:00’, 0.3, 0.05),
(β€˜03/05/2022’, β€˜07:00 AM’, β€˜2022-03-05T07:00:00’, 1.7, 0.19),
(β€˜03/05/2022’, β€˜08:00 AM’, β€˜2022-03-05T08:00:00’, 4.3, 0.41),
(β€˜03/05/2022’, β€˜09:00 AM’, β€˜2022-03-05T09:00:00’, 1.4, 0.16),
(β€˜03/05/2022’, β€˜10:00 AM’, β€˜2022-03-05T10:00:00’, 3.3, 0.33),
(β€˜03/05/2022’, β€˜11:00 AM’, β€˜2022-03-05T11:00:00’, 1.5, 0.17),
(β€˜03/05/2022’, β€˜12:00 PM’, β€˜2022-03-05T12:00:00’, 2.5, 0.25),
(β€˜03/05/2022’, β€˜13:00 PM’, β€˜2022-03-05T13:00:00’, 0.8, 0.1),
(β€˜03/05/2022’, β€˜14:00 PM’, β€˜2022-03-05T14:00:00’, 0.8, 0.1),
(β€˜03/05/2022’, β€˜15:00 PM’, β€˜2022-03-05T15:00:00’, 1.6, 0.17),
(β€˜03/05/2022’, β€˜16:00 PM’, β€˜2022-03-05T16:00:00’, 2.3, 0.24),
(β€˜03/05/2022’, β€˜17:00 PM’, β€˜2022-03-05T17:00:00’, 1.3, 0.14),
(β€˜03/05/2022’, β€˜18:00 PM’, β€˜2022-03-05T18:00:00’, 0.9, 0.11),
(β€˜03/05/2022’, β€˜19:00 PM’, β€˜2022-03-05T19:00:00’, 1.9, 0.2),
(β€˜03/05/2022’, β€˜20:00 PM’, β€˜2022-03-05T20:00:00’, 2.3, 0.24),
(β€˜03/05/2022’, β€˜21:00 PM’, β€˜2022-03-05T21:00:00’, 0.6, 0.08),
(β€˜03/05/2022’, β€˜22:00 PM’, β€˜2022-03-05T22:00:00’, 0.4, 0.07),
(β€˜03/05/2022’, β€˜23:00 PM’, β€˜2022-03-05T23:00:00’, 0.4, 0.06)] |29.8
2022-03-06 08:41:03 DEBUG (MainThread) [homeassistant.components.srp_energy.sensor] SRP hourly data (2022-03-05T23:00:00) for 0.4, 0.06 daily_usage 29.8
2022-03-06 08:41:03 DEBUG (MainThread) [homeassistant.components.srp_energy.sensor] Finished fetching sensor data in 1.414 seconds (success: True)

image

The api is returning the correct data on every call, however it only updates on the first call after a boot. The data is not stable for the first few hours in the morning, I suspect SRP is adjusting the last hour reading to balance the daily meter reading. Thus the reading should be delayed until after 7:00 am

I also think that the sensor setup is problematic as it is not a total increasing value, instead it would be better represented as a measurement of the daily kwh or kwh/day.

I will try changing it to a different sensor type to see if the updates are captured.

1 Like

I documented the current behaviour and raised an issue SRP energy integration does not update on new data ;

2 Likes

in playing around with the code I got things to work and I changed it to produce the accumulated total up to the current hour.

image
let me know if you would prefer to see the data presented this way instead of a daily total.

1 Like

Here is the energy dashboard now:

That is super cool.

have these recent changes made it into HACS?

I have been interested in this for a while, but read there were issues so I was waiting to see if they would get resolved.

This was just something I tried while troubleshooting the integration. Currently waiting on the code owner to have a look at the problem. I will put it in as a feature request once we get reliable daily updates working again.

I actually raised this issue something like 2 years ago when it first came out. My issue was closed without being solved. I just saw your issue on github @richardcalgary403. I am going to go ask that someone look at this as well.

Does your solution work reasonably well? Can we consider sharing that as a fork? Might be better to just fix it in house than to wait on them.

Unfortunately I don’t understand what was actually broken in the code, I just poked/stuck in a couple of things that seemed to be missing so I would not be happy making this a fork. If you want to use it as a custom component or have a look at the code I would be willing to share it with you.

@richardcalgary403, I would like to take a look at what you have done and play around with it to add more functions. Thx

1 Like

Went through and it looks like the change to make it work was to set self._state = self.coordinator.data under the native method. Likely a better way however will post the code under the issue at https://github.com/home-assistant/core/issues/69431

1 Like

Anybody got this to work? It never show values hourly only the total for the whole day, and only when I restart HA then it get the data. I had the latest HA 2023.3.1 and it’s still has the same issue. Thanks!

the daily reading generally works now, hourly data is still a future feature, however the code is acutally quite simple if you want to customize it for yourself. it is documented above.