Integration with Span?

My system is still running firmware version spanos2/r202216/04.

Well, SPAN Tech Support Agent Allison got back to me today with a less than helpful email. Here’s what I got:

Thanks for calling in yesterday to talk about API and Home Assistant.

While we do not have a set timeline for when something like this will be available, I am happy to add you to our list of interested customers if you would like to participate in our API beta program when that becomes available.

Again, I do not have a definitive timeline for when this will be opened up, but when the beta is live, someone will be in contact with you.

Does anyone who spoke to a more helpful SPAN representative have a name of anyone there at SPAN who is able to help with this?

@DougLorenz I have been getting the same line from their tech support since the beginning. Seems to be they are on the slow roll with their API.

The funny thing is with the way my solar is set up to the downstream lugs the Span app cannot account for feed to grid, but this Span-HACS has no problem doing this.

It’s a little weird you are having these problems, when I installed the plugin it auto sensed it and came right up. Have you verified install location in HA, and have you probed the Span to see if the ports are open?

@tylas13 I expect that you and I may have talked to the same Level 1 tech support person who’s sole job is to be friendly but useless. Somewhere out there is a Level 2 tech that has the correct answer, and I guess I should probably just try again and again and again until I find out who that is.

I seem to now be getting an error I can’t figure out. My access points were reset a couple of times and the Span panel always takes a long time to reconnect to wifi. The last time it did connect I received the error below:

Logger: custom_components.span_panel
Source: custom_components/span_panel/__init__.py:57 
Integration: Span Panel (documentation, issues) 
First occurred: 11:18:16 PM (10 occurrences) 
Last logged: 11:22:49 PM

Unexpected error fetching span panel SN-TODO data: name 'ConfigEntryAuthFailed' is not defined
Traceback (most recent call last):
  File "/config/custom_components/span_panel/__init__.py", line 53, in async_update_data
    await span_panel.spaces.getData()
  File "/config/custom_components/span_panel/span_panel.py", line 231, in getData
    results.raise_for_status()
  File "/usr/local/lib/python3.10/site-packages/httpx/_models.py", line 736, in raise_for_status
    raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Redirect response '301 Moved Permanently' for url 'http://192.168.1.195/api/v1/spaces'
For more information check: https://httpstatuses.com/301

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in _async_update_data
    return await self.update_method()
  File "/config/custom_components/span_panel/__init__.py", line 57, in async_update_data
    raise ConfigEntryAuthFailed from err
NameError: name 'ConfigEntryAuthFailed' is not defined

I have tried to reset and reinstall the Span-hacs component to no avail. I now also have Span connected via Ethernet so hopefully I won’t get any wifi flakey-ness.

Anyone have an idea on what is going on here? Has been working like a champ until now.

Just got it back up and running. The following fork has resolved the issue:

https://github.com/jeffkibuule/span-hacs.git

2 Likes

Still haven’t been able to resolve this issue. I can access my SPAN panel from my computer using http://[IP Address]/api/v1/circuits and clearly see the data, but every version of SPAN-HACS that I use gives me the same result when entering the IP address of my panel during the process of adding the SPAN integration to Home Assistant. “Unknown error occurred”

Last effort was using GitHub - wez/span-hacs and firmware version “spanos2/r202223/06d09”.

This is also working for me.

I got the same thing at first. Installed the integration from HACS and immediately tried to input my hostname but it failed just like yours. I tried name, IP, full web address - nothing worked. Then I just left it alone and all of a sudden it popped up as a suggestion in HA for me to configure. Weird.

Agreed, with this update from wez everything is working as it should. When I uploaded it to HA it came up as a notification to add almost instantly. This version of the integration has been rock solid for me, even exposing some datapoints I can’t see in the Span app. At least it does for me with the latest Firmware: spanos2/r202223/06d09

@DougLorenz Can you send a view of the error from the logs, or does it not even get that far?

Whoa, first time seeing this.

I noticed I’d lost connection to the panel today from HA and went to access via plain webpage and was presented with this. Took me a couple tries but eventually the door switch presses worked. Let me in via the webpage and then HA could see everything again.

Hey All,
My name is David Shoop - although colleagues and friends call me Shoop, and you can too. I am a new product manager at SPAN and one of the areas I am responsible for is local API access to SPAN’s physical products.

I can almost hear the Oooo’s, Aaaaah’s, and Yeeeeeses from some of you now.

If I’m correct about the ooos and aaaahs, I’m sure there may be a number of questions and requests… and that’s part of the reason I popped in here. I enjoy connecting with customers to understand what drew you to our product(s), how they are are being used, what you like, what you don’t, and what is missing. Let’s take things in order, shall we?

1. Thank you - No really, thank you! First, thanks for being a SPAN customer, and an early SPAN customer to boot. Thank you for your curiosity about integration with SPAN, the collaboration in this forum, and the discovery of some easter eggs. Thank you for future collaborations here and possibly with SPAN on future products .

2. Easter Eggs (Web Dashboard and Local APIs) - As mentioned above, your curiosity has led you to the discovery of a web based dashboard and local APIs that provide access to SPAN Panel functions and data - I see you @hyun007! While SPAN does not officially support these easter egg features, we do our best to keep an eye on discussions around easter egg discovery and usage, feature requests, and interest in these becoming an official product.

3. Software Updates - Warning - when using easter egg features, software updates could cause problems. Customer support, public documentation, or official release notes may not help you if you run into easter egg issues. I get it - it can be frustrating when you have come to rely on those easter eggs. To that end, I want to be as helpful as I can. We are rolling out a software update to our SPAN Panel fleet which will be a cause for anomalies noticed by anyone using either the web dashboard or the local APIs. Given these are still easter egg features, I will skip the details of what was changed or why, but focus on how to roll with the changes so that you may continue to use them.

4. Web Dashboard Change - As some have discovered there is a Web Dashboard that can be accessed from a browser by entering the IP addressed assigned to the SPAN Panel. With the latest software update, the web dashboard presents a login page. To access the web dash board we have implemented a proof of proximity check which is satisfied by opening and closing the panel door 3x. A count down can be found in the lower left corner of the page. Once the count reaches 0, simply click the button to gain access.

5. Local API Change - As some have discovered there are REST based APIs that provide information from the panel. With the latest software update, calls to the panel may result in errored responses. In order to retrieve information previously obtained you must complete a proof of proximity challenge which is satisfied by opening and closing the panel door 3x. Once this is complete API calls previously used should provide their responses. Access may be blocked if the internal computer in the panel reboots. If a reboot occurs, you will need to complete the proof of proximity challenge once again before the data begins to flow.

6. Official Support of Local APIs - I’m sure you’re thinking, “come on Shoop, why can’t you give us the APIs? It seems like you have em’. Heck your product should already be using them.” We are not trying to hold out on you… but… Like any company, perhaps more so as an early stage start up, we continually review our product offering and prioritize products/features/services that provide the greatest value to our customers or spur innovation. We continue to access when (not if) we will provide local APIs to the SPAN Panel. Before rolling out an official product we will run a Beta program to capture customer feedback and fine tune a product customers will love.

7. Beta Program(s) - I don’t have a specific date to announce, but when I do, I would love the opportunity to have some\all of you participate in a Local API Beta program. I believe that your contributions to this forum, your interest in SPAN, and your technical know-how will not only help us create a great API offering, but help us spin the innovation flywheel. When we are ready, be on the look out for the Bat SPAN Signal!

For now, I wish you a great weekend. I hope this information has been helpful and encourage you to tag me or send a direct message if you have any comments, questions, or feature request. I don’t lurk here often, but will do my best to respond in a timely manner.

Thanks
SPAN-Shoop

12 Likes

Nice!

I’m super keen to see you guys working with Sunrun/Ford so the Ford Home Integration System can tell the span panel there’s a power cut!

Right now (both getting installed next week) I think we’ll have to either enable use groups manually, or sort something out with HA.

1 Like

I’d definitely be interested in the local api beta access

2 Likes

Ok, here’s the error log I get when I get when I try to add the integration…

This error originated from a custom integration.

Logger: aiohttp.server
Source: custom_components/span_panel/config_flow.py:136
Integration: Span Panel (documentation, issues)
First occurred: 8:40:14 PM (1 occurrences)
Last logged: 8:40:14 PM

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
    resp = await request_handler(request)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 222, 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 82, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 136, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 178, in post
    return await super().post(request, flow_id)
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 73, 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 280, in async_configure
    result = await self._async_handle_step(
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 367, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
  File "/config/custom_components/span_panel/config_flow.py", line 136, in async_step_user
    return self.async_create_entry(title=info["title"], data=user_input)
TypeError: 'SpanPanel' object is not subscriptable

Does any of this point to what I might be doing wrong?

Hello everyone,
I’m in the early architectural stages of a new home build that will start in 2024. I was researching about home automation and found out both about the Span and the HomeAssistant.
I am fairly new to this but I would like to know what is the potencial of an integration between Span and HomeAssistant. If I lay out the wiring in the house in the right way, could I achieve a home automation system with low EMF’s while using only Span, HomeAssistant and different kinds of sensors? I suspect I would need to plug into Span independently everything that I want automated, even if it were just a specific light switch. This would probably demand more than one Span panel, and could cost a lot of money right now, but maybe not so much in the future decades.

I just want to lay out the wiring the best I can for this house to be compatible with future upgrades without the use of wifi in every corner…

Thank you for keeping this community active

There’s a pretty common story here, but with a very uncommon ending.

  1. New company produces new smart thing. It’s built quickly, perhaps some corners are cut, and it has an unauthenticated, undocumented, local api.
  2. Company is maturing, and realizes that it needs to secure that local api.

Here’s the twist. Usually what happens next is

  1. The company just updates the software to lock down the api, breaking any unofficial integrations, and moves on with its business.

But based on what @SPAN-Shoop said, it sounds like what happened here was a thoughtful design decision to include an easy-to-implement compromise that, while not ideal, still allows the end user to keep doing advanced things. “proof of proximity” is a great idea, because it allows you to secure against who you actually should be securing against–remote attackers–while letting the actual user keep using it.

Well done. This is a feather in SPAN’s cap for sure. And then the icing on the cake is the direct communication from the company to the community.

5 Likes

I wouldn’t read it as the Intent of the SPAN hardware - this is more infrastructure-level circuit protection switching and monitoring. For control of individual loads you’ll need something else.

I recently entered into contract for my own SPAN panels (that SPECIFIC interaction was the final decision point for me @SPAN-Shoop, sold - sir.) If they were willing to find an intelligent compromise between security and client local access - I’m all for it. I’ll encourage that with my pocketbook. David - You know how much I will spend on a two-panel install. I’m hoping you can point to this as proof this is what your end-users want and keep that API up and developed for us. Thanks…

3 Likes

Echoing this sentiment – I’m literally in the decision making stages of adding SPAN into a project – (notably, at the cost of delaying the timeline of my overall solar project) and a decisive factor was the ability to integrate SPAN data into my local home network for a variety of use cases. It’s worth noting that I recognize that current state is obviously scrappy, nascent, community driven & far from fully baked.

However, if the signal here had been “shit – they locked down the API with the latest update, and sent some patronizing reason as to why with no alternatives or visibility into roadmap or prioritization” I would have absolutely backed out this week from commitment, and probably never looked back. Instead, I’m moving forward in part specifically because of the official comment & engagement here. Nice!

Good form to engage with the community transparently & proactively, clearly there is a vocal interest here. It pays.

3 Likes