Leafspy Integration

Big shoutout to @jesserockz. I have been looking for a good way to integrate some leaf telemetry. I live in Canada, but the leaf I purchased cam from California and the NIssanConnect app wont work because its an invalid VIN for Canada. This was the answer! by using the leafspy app and using this integration I am able to deliver some important data to my HA dashboard. Truly the solution I was looking for. I’m just starting to play around with some cards.


1 Like

What integration are you referring to?

How do I add this? What do I do with the app? I tried and it gave me an error when I hit submit when trying to add my app. I entered the server address in the app under https bc I use https.

Hey @jatgm1 you ever get this working? Its pretty straight forward.

  1. install in HACS
  2. go to integrations page and add the integration.
  3. input information from step 2 into the leafspy app on your phone.

No it just gives me an error. Really weird.

Is it a connection error in the app? I got a couple errors aswell, but i realized I had spelled my server url wrong. Does your server address have “/api/leafspy/update” at the end?

I clicked add integration. It did that. Idk y

Logger: aiohttp.server
Source: helpers/network.py:201
First occurred: 5:34:53 AM (2 occurrences)
Last logged: 5:34:55 AM

Error handling request
Traceback (most recent call last):
File “/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py”, line 435, in _handle_request
resp = await request_handler(request)
File “/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py”, line 504, in _handle
resp = await handler(request)
File “/usr/local/lib/python3.9/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 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 79, in ban_middleware
return await handler(request)
File “/usr/src/homeassistant/homeassistant/components/http/auth.py”, line 219, in auth_middleware
return await handler(request)
File “/usr/src/homeassistant/homeassistant/components/http/view.py”, line 137, in handle
result = await result
File “/usr/src/homeassistant/homeassistant/components/config/config_entries.py”, line 206, in post
return await super().post(request, flow_id)
File “/usr/src/homeassistant/homeassistant/components/http/data_validator.py”, line 62, in wrapper
result = await method(view, request, *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 260, in async_configure
result = await self._async_handle_step(
File “/usr/src/homeassistant/homeassistant/data_entry_flow.py”, line 335, in _async_handle_step
result: FlowResult = await getattr(flow, method)(user_input)
File “/config/custom_components/leafspy/config_flow.py”, line 29, in async_step_user
url = get_url(self.hass, prefer_external = True, prefer_cloud = True)
File “/usr/src/homeassistant/homeassistant/helpers/network.py”, line 201, in get_url
raise NoURLAvailableError

Just removed leaf spy from hacs, reinstalled, and then hit restart, and tried again and got the same error

Anyone else with this issue? I installed the main one and 1.8, and 1.7

Ok, so I think it might have something to do with the fact that I have not set my internal URL via the GUI and it won’t let me do so because I have https set up outside of the nabu casa thingy

So do you get things as SOC ? I only see a device tracker… (Which works) but no other sensors…