Integration with Span?

obviously it would be best if span would support their local api, or at least provide more information so we can know how to fix things - or why they break. but cloud access as a fallback doesn’t seem like the worst idea. plus, not everyone cares about having local access - some people just want it to work. that’s not me, but it’s a valid point of view.

asking them to develop on a totally new platform is probably the biggest lift (matter), and therefore most expensive option for them.

the rep i talked to when my circuit updates were made said they are going to enable home owners to edit their own circuits btw. no timeline on that but they did confirm it.

One of the biggest problems is if the early-adopter curse bites us.
What if Span is acquired, changes their product line, and/or otherwise goes through something where they either cease to exist or are unable to keep the cloud access going?
Or what if, in 5 years, they say, cloud access is now going to be a subscription, because of finances or something?
A locally installed, owned physical item should always have locally available read/write controls for any of its software.
People who don’t know that or don’t believe that are naïve and haven’t yet been bitten hard enough by bad outcomes. For those of us who have, we would like to protect ourselves and those innocent people who do not know better. :slight_smile:
(I know you’re not in that group Jayson – indeed, likely none of us in the forum are. But it bears reminding manufacturers of the big picture, especially when they hear “cloud is okay as a backup” – it can be a nice option for some folks, but it is absolutely not a substitute for local access.)

4 Likes

Having trouble with the galak version of the SPAN integration since 2023.5.x and raised an issue. Anyone else having similar issues?

SPAN Integration will not initialize after HA 2023.5.x · Issue #12 · galak/span-hacs (github.com)

I am not having that issue, but I moved over to Greg’s repo version. Seems to be the most reliable for me:

He is working with jeffkibuule to enable durable authentication, but not enabled yet. I had to do the door cycle x3 again this morning to re-enable it. I also did a re-install of the integration and there is something else at play. It won’t initialize if you use the automatic detection install point, but it will install if you manually add integration and put in the IP address.

2 Likes

I appreciate the help and the shoutout!

Can you file a github issue for the auth troubles? Another github user (etmelvin) had been working hard on that and I’m trying to get him good bug reports.

Sure can. I have already added one for the detection install and etmelvin has said next PR should solve it.

As for the durable auth, is there a specific procedure to follow to get it activated and usable or does the integration pull it’s own authorization?

1 Like

Switched to your fork over the weekend. Fixed the error and also my switches and priority drop downs started working (except I also have the 500 error on attempting to change priority)

1 Like

@NathanCu can you take a look at 500 error during circuit priority change · Issue #10 · gdgib/span (github.com)? etmelvin and I get the same error, and that issue is where we’re looking for help debugging it.

@tylas13 yeah, I wish I had the answer. Mine isn’t durable yet either. I’m leaving it to etmelvin since he’s handled that part of the code more lately. That said, it’s working it’s way up my personal list.

2 Likes

The set up process of version 0.0.7 release is kinda broken (sorry!) however durable auth should already be there. Once you verified that you are able to log into the Span local web console via proximity auth (open and close the panel door 3 times), when setting up the integration through home assistant part of its set up process is to request an access token from the panel and use that going forward. This means that the integration should still function even when the proximity auth expires.

The next PR which I think will be in released as version 0.0.8 fixes the config flow issues. When setting up the integration, it will prompt the users if they want to authenticate using proximity auth or they can enter the access token directly if they already have one handy. If proximity auth is chosen, it then guides them through the open/close panel door process.

3 Likes

Yeah I can try to repro the 500 error tomorrow. I assume you’re looking for a debug log if i get one?

@gdgib is it possible to create an entity for solar? i’ve got a 2 pole breaker in my span panel that is the input from my solar inverters, but it doesn’t show up in the span integration. the real-time readout would be far better than what i have from solaredge, which is only updated every 15 minutes.

1 Like

+1 on this!!! battery would be amazing too!

1 Like

@gdgib happy to help test the solar portion (i don’t have a battery hooked up yet)

@gdgib i did a little investigation into the solar production numbers. i suspect there might be another endpoint that we don’t know about yet, which probably makes a little more sense, but what i’ve found is that the response from the /api/v1/panel endpoint does have the solar production numbers. the total is split between each pole on the 2 pole breaker. the reason i suspect there’s another endpoint is because the solar production figures are omitted from the /api/v1/circuits endpoint and there’s information in the span app about my inverters.

now, i’m not sure how batteries would factor into this - i would suspect there’s yet another endpoint, or this information would be included in the solar endpoint. i say this because i believe different batteries are integrated in different ways. for solaredge, the battery gets dc coupled to the inverter, and then there’s a separate “backup interface” (BUI) unit that sits between the inverters and the grid. they don’t mention this on the span website - only that you need an energyhub inverter, but you also need the BUI.

here are the footnotes from the battery info on the span site.
1 SPAN Remote Meter Kit required for Enphase IQ compatibility.
2 SolarEdge EnergyHub inverter required for LG RESU and SolarEdge Energy Bank compatibility.
All support for SPAN Panel and SPAN Remote Meter Kit compatibility is provided by SPAN.

i believe the tesla powerwall is an ac coupled battery, so that likely hooks up directly to the panel and charges from the panel.

exmaple:
i have an 80A 2 pole breaker that my 2 solar inverters feed into. it’s at position 29/31 (bottom left 2). i’ve checked the debug logs against the numbers reported int he iOS app and they are spot on. if you add instantPowerW from 29 and 31, that equals the total production at that time. this checks out with the other 2 pole breakers i have. the total consumption is the sum of the two.

    {
      "id": 29,
      "relayState": "CLOSED",
      "instantPowerW": 5400.2861328125,
      "importedActiveEnergyWh": 308095.5,
      "exportedActiveEnergyWh": 2065.29150390625
    },
    {
      "id": 30,
      "relayState": "CLOSED",
      "instantPowerW": -0.18362312018871307,
      "importedActiveEnergyWh": 36.09699249267578,
      "exportedActiveEnergyWh": 39.8343505859375
    },
    {
      "id": 31,
      "relayState": "CLOSED",
      "instantPowerW": 5406.00390625,
      "importedActiveEnergyWh": 310859.125,
      "exportedActiveEnergyWh": 1798.598388671875
    },
    {
      "id": 32,
      "relayState": "CLOSED",
      "instantPowerW": 0.23783566057682037,
      "importedActiveEnergyWh": 0.05833250656723976,
      "exportedActiveEnergyWh": 104.77339935302734
    }

side note: i’m going to explore ways to connect the span panel to my inverters via modbus rs485 so that i don’t need to purchase and install the backup interface from solaredge. each inverter has a production meter in it but it doesn’t have any knowledge of power draw from the grid since it’s only hooked up to the solar panels and then feeds out to the span panel. there are no communication lines to the panel.

also, ugh, i would really like ssh access to this panel.

1 Like

I’ve got Tesla panels and batteries being installed next week. I’ll provide an update after they’re hooked up, though I may need guidance on where/how to check/probe for data. I had heard that there was a way for the span panel to communicate with the Tesla system to know when it was on battery, but not sure exactly how that’s supposed to take place.

1 Like

The span panel’s local api only provides data measured directly on the panel. It does not show data reported by other devices, such as a third party backup interface.

So what this means is that if your solar lands on a breaker in span, as you’ve discovered, you can measure it with the /api/v1/panel endpoint by adding together the values from the two spaces where it lands. It would be great if it was also available in the /api/v1/circuits endpoint, with a name for ease of use, but at the moment that endpoint only includes “load” circuits connected to the panel. If your solar doesn’t land in the span panel, you’re going to need to find another way to get the data.

As a home automation enthusiast, I wish the panel exposed more data. As a span employee who can read the source code, I can tell you that as of now, it does not.

1 Like

Sadly the Tesla gateway and panels weren’t tied into my SPAN sub-panel, but instead my main panel. I need to talk to my SPAN installer to see if we can figure out how to get the SPAN to talk to the Tesla gateway to get battery level and grid status.

I have been following this thread to gain knowledge about the API and thrilled with some of the data I can get. Thanks for working on this and posting here and links to details!

@variousplaces Mine is via an internet cable from the Gateway into the Span. This mean I am not able to get any data from the Gateway API because it breaks the connection to Panel when I access the Gateway API while Span is pulling. Without the connection, Panel won’t know when to shed loads nor have the details of the PV system production.

I was actually hoping I would be able to get my Gateway data via the Panel API, but it appears that is currently a limitation of Panel coding per mbbush’s post just before yours. :frowning:

@turtle2472 I’ve noticed that my SPAN panel has two ethernet network connections – one is an ethernet port that I currently have wired into my home network and the second appears to be a USB to ethernet dongle. I’ve heard that if you’re missing the latter, you can ask SPAN and they’ll send one to you.

My Tesla gateway is on the network via WiFi, but I’ve also wired the ethernet connection into my network with the intention of moving the primary connection to wired ethernet instead of WiFi. Before doing that, I am contemplating trying to run a cable from the gateway’s ethernet interface to this second port on the SPAN panel. What occurs to me is that it’s simply an IP connection between the Tesla gateway and the SPAN panel, which makes me wonder if it possible to simply tell the SPAN panel to talk to the gateway over their existing network connections. I haven’t reached out to my SPAN installer to see what options they have, but I really don’t want to give up access to the Tesla gateway – either via the Tesla mobile app or via the integration with Home Assistant.

As for shedding load automatically – what I’ve found is that during a power outage I am typically home and we simply don’t run the non-essential appliances/devices, doing what the SPAN panel does automatically. Conveniently we experienced this first hand with a power outage 4 days after the batteries were online…

@variousplaces If you are able to get Panel talking to the Gateway via wifi AND be able to access the Gateway API please let me know. I would move to that method in a heartbeat if it means I can get data from both APIs. Not being able to get Gateway data without having to go through the non-public Tesla APIs is a pain and something I would rather not have to rely on. Local is better.