Integration with Span?

Okay, dumb thing to focus in on, but that seems silly. Can anyone share their printout? Surely we can recreate a simple 8.5x11 sheet for circuit breakers in a google doc that we can edit however we want without having to e-mail support.

That just strikes me as a waste of everyone’s time.

Sure, yes. One could do a table and print out without using the app. Just pointing out the lack of user control.

Another example - change breaker (eg. Single 20A to tandem 20A/20A) or installer didn’t set up breaker info (single vs tandem) correctly, etc., one has to email customer support to get this updated so it shows up in the app breaker map.

Another example - battery/storage integration requires emailing support with details so app’s Flow tab reflects the new energy map.
Thanks.

6 days in to my successful Span integration with HA, and still learning. But in attempting to do what I had assumed would be a simple task, I’m running into multiple challenges and am beginning to fear that the core or start of it may be a fundamental and possibly irreconcilable difference in the architecture of the Span and HA databases???

Span data is logically a time series database with values for every sensor recorded every time step (e.g. 1 sec?)

In contrast, HA appears to be an event-driven database which when importing the Span data associates as event only with a change in a sensor value?

Thus if I have a Span circuit that records a value of 100W, then turns off to 0W, a state that remains for some time period, and then when it later turns on it goes back to 100W. The Span would record the 100W at every time step for as long as the circuit was on, 0W for every time step it was off, and then 100W again when it came on, but the HA would record the last 100W, the first 0W, then not have any values until the sensor turned on again and had the new value of 100W.

Do I understand this right???

The problem arose when trying to make a simple power area blanket chart of all the circuits in my Span panel. As long as a circuit is active and recording non-zero values, everything looks fine. But for those circuits that turn on and off and have 0 values when off, I get long ramp lines when using the ‘straight’ curve option in Apexchart, and odd steps when I use ‘stepline.’ (examples below)

For now, ignore other odd behavior in Apexchart associated with those misbehaving areas where it also appears to be accumulating values incorrectly. Really just trying to see if this is a fundamental problem that is unfixable, or something that I just misunderstand?

Why not just graph the sensor for “Current Power” to get an aggregate view of all circuits?

Edit - attached is my apex chart plot

I do have that on a different card, but the point here was to have a card to see all components of current power in the recent time period (seems to be largely limited by memory? 24 hrs is pretty tough on it). But this may be a class of things for which HA is not the best approach?

Less is more on a Dashboard Russ. That’s some crazy detail. (yes what I am guessing you’re trying to do isn’t quite suitable for what has to happen to make that chart happen real-time)

Think of unique ways to summarize that data like a sankey chart to make that data usable. You’ve go so much coming in from the panels now youll drown in data fast - start looking for anomalies not detail.

This sankey chart card is nothing but breaker data over the last day


And at one glance I know my laundry usage today so far accounts for most of my electricity usage today. (I haven’t made breakfast yet.) and then can dig into that circuit (later plans to add click able reports) if it feels wrong.

If your specific application needs that detail and number crunching maybe the graphana addin can help preprocessing the reports or graphs for displaying on a dashboard

(tl;dr:You’re entering the territory of where you have to start thinking about how much data you’re throwing back at your dashboard and how fast you need to refresh it. There are custom cards to summarize that better)

2 Likes

Already did one Sankey - nice place to start. This is all for secondary dashboards (primary indeed much simpler, and still exploring optimal) to really dive into the energy data. Still, even realizing I’ve got a weird brain when it comes to energy data, I honestly don’t understand why some kind of blanket chart like this isn’t even a default built into a dashboard layer in the mobile app? If the tool would work, at a glance, I can see and understand what is and has been going on with my energy load.

Will look into graphana as a possibly more advanced tool. Thanks for that tip.

But since no one has yet answered the core question of event vs time-series data architecture, am starting to think I may have to keep my R environment alive to work at that analytical level? Will require that I first figure to how to get access to the Span data from that universe. It was precisely the same chart that I first made crudely in Excel and then R using .csv data that had to be manually sent to me by Span support that allowed me to trace what turned out to be a missing screw in the panel (and could’ve been catastrophic).

Still, as I gain understanding from there, can see that the HA event-centric environment will be a powerful environment to implement energy management strategies.

I have two Span panels hooked up via Ethernet. I am getting “Unknown error occurred” on both Panels. I can access them via port 80 and can login using the opening door challenge. Not sure what the error means. Any help will be appreciated!

Logger: aiohttp.server
Source: /usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py:421
First occurred: 9:34:57 PM (2 occurrences)
Last logged: 9:35:01 PM

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py", line 543, in _handle
    resp = await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_middlewares.py", line 114, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 233, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 31, in headers_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 149, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 63, in with_admin
    return await func(self, request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 177, in post
    return await super().post(request, flow_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper
    result = await method(view, request, data, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 293, in async_configure
    result = await self._async_handle_step(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 389, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/span_panel/config_flow.py", line 125, in async_step_user
    host_valid = await validate_host(self.hass, user_input[CONF_HOST])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/span_panel/config_flow.py", line 38, in validate_host
    return await span_api.ping()
           ^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/span_panel/span_panel_api.py", line 42, in ping
    await self.get_status_data()
  File "/config/custom_components/span_panel/span_panel_api.py", line 59, in get_status_data
    status_data = SpanPanelStatus.from_dict(response.json())
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/span_panel/span_panel_status.py", line 37, in from_dict
    remaining_auth_unlock_button_presses=data["system"][
                                         ^^^^^^^^^^^^^^^
KeyError: 'remainingAuthUnlockButtonPresses'

Any ideas what might be on “feed through” circuit in my Span panel - i.e. power flowing to and from where?

I see above wiring can be optional, but can’t reconcile to what I see in my case. It is somewhat similar in character to the grid curve, but clearly not part of the import or export. Curve is a noisy curve generally +/- within 10W of zero, with sparse large spikes also + or -. Here compared to both “current” power (from Span), and “Site” power from Tesla Gateway.

For now, mostly just trying to figure out where it’s energy needs to be accounted for in my Sankey chart?

Do you have anything wired to the feed-thru lugs of your Span panel?
My guess is no.
It is my understanding that the feed-thru lugs power is not measured, it is computed, something like Power(feed-thru-lugs) = Power(input-lugs) - Sum( Power( circuit[1]), Power( circuit[2]), … , Power( circuit[32]))
Any noise or errors along that summation would cause a (presumably) small deviation from zero.
If I understand you correctly, you are seeing ~ +/- 10 watts which seems consistent with how I beleive the Span panel is reporting feed-thru power.

On the span integration, which entry is the one that shows how much Solar is being produced? None of the options in HA seem to match up with what my Span panel reports.

And side note, why does the API produce different power readings than the app?

Depends on how your solar system was integrated into SPAN. Likely power produced on the breaker you have the inverter attached to.

I found that once I was monitoring the correct entities the correct way - everything was spot on for my install and the energy dashboard jives with the SPAN app.

What are you basing your measurements off of?

It’s on the bottom right, the breaker recommended for Solar use. On the Span app it’s listed as “Solar”. For everything else, whatever the breaker is named in the Span app is how it is shown in the HA integration, but I don’t see any solar option in HA.

I Open the Span app, it says this breaker is currently using X watts. I open the HA integration, it gives a different value. So for example, I just opened it. For one circuit breaker the app says 323w, the integration says 313.

I’m not sure if this is just a difference in polling rate and one is lagging behind the other, or if they’re actually consistently reporting different values. :man_shrugging:

It’s probably on the breaker number that space is on. Check the power produced entity on that breaker. Is it climbing as you use power?

On the other that’s a point in time measurement of current power (watts) so you’re likely seeing the difference in polling times. (time delta in measurement displayed by app v what’s displayed on the dashboard) If you’re measuring energy (kWh) over time the power used matches up if you measure the same time period.

@donaldcjackson Thanks. That would make sense as that’s what it looks like. That means it should pretty much be the same in net as what I show as “Span Loss” on this Sankey diagram. Instantaneously, might be + or - , but in summation should then be the internal energy consumed by system not otherwise showing up in a circuit.

The integration doesn’t list any breaker numbers, in HA it’s all shown as the name the breaker is given in the Span app. That’s why I was wondering if anyone who uses the integration is aware what name the solar feed is given, or how it is calculated in the Span app

Which may or may not be accurate. My Enphase Solar app says my grid is currently producing 3.0 kW, but the Span app says the solar is producing 5.7 kW. which just so happens to be the amount my Grid is producing + the amount my home is consuming so I think there may be a math error on Span’s side, but we’re not sure as my Enphase app is also reporting a meter issue, which may be related to the CT clamps being installed backwards. I had the electrician come out and fix it, but he says it will take up to 24 hours for the error message to go away in enphase’s app, so we’ll see where that one goes.

Although my PV system lands on the bottom two spaces of my primary Span panel, I don’t rely on Span to accurately report my PV/solar generation, I use the Enphase Envoy (DEV) integration (via HACS?), see: GitHub - briancmpbll/home_assistant_custom_envoy
which I name as “PV” in HASS.
Then in the HASS Energy Dashboard configuration screen, in the “Solar panels” section, I added “PV Today’s Energy Production”, and AFAICT that works pretty well.

1 Like

I contacted Span, and it turned out my installer had configured breakers 30 and 32 as two separate solar inputs so my solar production was being reported twice. Span fixed it so that the breaker was reported a single double throw breaker and now Span and Enphase match up.

There’s definitely not an entry for solar on the Span integration. I somewhat suspect that solar is a calculated value on Span’s side rather than measured. Something like (Current Power - [The sum of all circuit]) = Solar production.

Or maybe it’s just not exposed in this integration, I don’t know :slight_smile:

I’m on

  • Home Assistant 2024.1.2
  • HACS 1.33.0
  • Span Panel update installed version 99911c8
    when I try to do the custom install of
    https://github.com/jeffkibuule/span-hacs.git
    I get to the very last step:
    Connect to the Span Panel
    but after inputting the Host IP address then clicking SUBMIT, I immediately get
    ! Unexpected error

I was able to get into to that same IP address (statically mapped in my DNS/DHCP server) via browser just fine, after pushing the Span door button 3 times. In other words, things like http:///#/circuits work just fine, and I’m able to turn on and turn off circuits.

Any idea what might be causing this?

The default repository is a bit behind in updates, use this one instead:

1 Like