gdgib / span

SPAN Integration for HomeAssistant/HACS
Other
19 stars 4 forks source link

feed_through_consumed_energy is total_increasing but negative #11

Open gdgib opened 1 year ago

gdgib commented 1 year ago
2023-04-12 18:26:42.646 WARNING (Recorder) [homeassistant.components.sensor.recorder] Entity sensor.feed_through_consumed_energy from integration span_panel has state class total_increasing, but its state is negative. Triggered by state -54967.208492206 with last_updated set to 2023-04-13T01:19:59.004244+00:00. Please report it to the custom integration author.

Honestly not sure whether this is due to solar causing negative energy consumption, or maybe just a silly sign error (e.g. a negative number needs to be inverted before passing it to HA).

etmelvin commented 1 year ago

Honesty, I don’t really know what feedthrough means and have never really tried to use it for anything; I mainly stick with the Main Meter entities for my energy dashboard. I’ve seen this behavior on the previous integration versions too.

Reading existing posts about feedthrough seems to indicate it is used when multiple (sub)panels are installed? I only have 1 single panel with solar and am getting negative reading on those entities too.

Like the changes made to the relay switch toggle controls and the priority selector controls API are undocumented and I only stumbled upon them the right configuration to pass to the API by luck.

It’ll be nice if we have some documentations on these exposed properties from the API, maybe we can ask the SPAN employees on the forum but I doubt they will commit to anything about the local API at this time. :P

gdgib commented 1 year ago

Agreed, that makes sense. I'll try and do a little detective work, myself on the values and docs, maybe get a little lucky.

I'll also try the span folks. I got some good responses from them in DMs, but then they dropped off the HA forums.

tylas13 commented 1 year ago

My feed-through consumed energy is also negative and I think I know why. I have my solar inverter system hooked up to the downstream lugs, or "downstream loads" on the Span app, and the wattage closely follows my dual SolarEdge inverter output. The frustrating thing is the Span app is not set up to do this so it doesn't actually capture my solar power. Fortunately this integration shows the raw numbers so I can measure it more accurately.

I'll watch at night when the optimizers are using electricity at night to see if it switches over to positive. If I get time I'll set up a db to compare the power output of inverters compared to the downstream output.

gdgib commented 1 year ago

Thanks @tylas13. That matches my suspicions, so I wouldn't be surprised. Let me know if I can help in any way.

I do plan to sort this out, but I admit it's not yet the top of my SmartHome development priorities.

mbbush commented 1 year ago

There's definitely something goofy about the feedthrough energy numbers reported by the span local api. If I had to bet, I'd say there's a bug somewhere related to signed/unsigned integers and over/underflow, but I haven't been able to find it yet, and it is also not yet on the top of my list of development priorities.

What does feed through mean?

These numbers represent the energy transferred through the feed-through lugs attached to the bottom of the panel. These lugs are designed for attaching another panel (smart or otherwise) downstream, and providing up to a 200A connection. If you don't have anything connected to them, you can just ignore these values.

gdgib commented 7 months ago

I'm going to leave this out of 0.0.9, where I want to focus on control & connection issues. 0.0.10 is where I'm planning to look at the sensors in more detail.