Custom Integration: Linksys Velop

I am currently working on a cessing the images that Linksys use in the web UI. I’ve updated pyvelop to expose the sort of information I need already. However, I need to check the quality of the images. On the web UI they are small images but I don’t think they’ll scale very well.

That may help with having to find the node images and will also allow the integration to show the same imagr for devices as used/assigned in the web UI.

My tests are still ongoing so it may end up being fruitless but I’ll update here either way.

Replying to myself here… this isn’t going to work. The quality of the images used in the web UI is low. It’s essentially an image sprite that is only 56px high. This is the case for both device images and node images. The pyvelop library at least pulls out the defined type of the image (as you selected in the linksys UI) but I won’t be putting anything in my example cards to react to this because it won’t add anything.

I just used an image I found on an image search. Not a specific model number, but I named it with the model number so it would show up. Displays fine, and the resolution is decent. If anyone wants it, here you go…

2022.8.2 is out: -

  • format files using black
  • bump pyvelop version to 2022.8.4
  • allow device specific diagnostics
  • README updates for diagnotics changes
  • allow Visit Device for nodes
  • change mesh device to service

There’s also been various tweaks and clarifications to the README to reflect some of the comments in this thread.

There shouldn’t be anything breaking in this release though.

1 Like

@uvjim hey have you heard of any issues with the latest release?

I noticed the following error randomly today in logs:


Logger: aiohttp.server
Source: custom_components/linksys_velop/config_flow.py:134 
Integration: Linksys Velop (documentation, issues) 
First occurred: 10:54:32 AM (1 occurrences) 
Last logged: 10:54:32 AM

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 238, 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 109, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 277, in async_configure
    result = await self._async_handle_step(
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 359, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
  File "/config/custom_components/linksys_velop/config_flow.py", line 531, in async_step_timers
    return await self.async_step_device_trackers()
  File "/config/custom_components/linksys_velop/config_flow.py", line 502, in async_step_device_trackers
    devices: dict = await _async_get_devices(mesh=mesh)
  File "/config/custom_components/linksys_velop/config_flow.py", line 134, in _async_get_devices
    devices: List[Device] = await mesh.async_get_devices()
  File "/usr/local/lib/python3.10/site-packages/pyvelop/mesh.py", line 629, in async_get_devices
    all_devices = await self._async_gather_details(
  File "/usr/local/lib/python3.10/site-packages/pyvelop/mesh.py", line 290, in _async_gather_details
    resp = await self._async_make_request(action=api.Actions.TRANSACTION, payload=payload)
  File "/usr/local/lib/python3.10/site-packages/pyvelop/mesh.py", line 211, in _async_make_request
    raise err from None
  File "/usr/local/lib/python3.10/site-packages/pyvelop/mesh.py", line 209, in _async_make_request
    req_resp = await req.execute(timeout=self._timeout)
  File "/usr/local/lib/python3.10/site-packages/pyvelop/jnap.py", line 146, in execute
    return Response(action=self._action, data=resp_json)
  File "/usr/local/lib/python3.10/site-packages/pyvelop/jnap.py", line 167, in __init__
    self._process_data()
  File "/usr/local/lib/python3.10/site-packages/pyvelop/jnap.py", line 206, in _process_data
    raise err
pyvelop.exceptions.MeshInvalidInput: _ErrorAbortedAction

And on the device integration I see this error message:


Retrying setup: _ErrorAbortedAction

I tried rebooting HAOS, and reloading the integration a few times and nothing is getting it moving…

I confirmed the Velop is still working fine, so nothing obvious on that side :frowning:

Any thoughts?

I’ve not seen anything. I rebooted today as well.
When you say the Velop is working fine, do you mean the actual device?

Does the integration not finish setup?

The message seems to be coming from the config_flow.py so are you trying to set it up? If not it could be finding it by SSDP.

Could you turn on debug logging? I should be able to tell from that what is being aborted.

Thanks

And yea - the Velop devices are working fine. I can access them from the Linksys app. Network seems ok.

I tried rebooting and reloading the integration and nothing seems to get it working. (And nothing was clearly changed on my side, unless HAOS auto upgraded somethjng)

I turned on debug logging and redacted anything that may be related to serial numbers/PII:


Redacted

2022-09-01 15:12:56.088 DEBUG (MainThread) [custom_components.linksys_velop] async_setup_entry (REDACTED) --> entered
2022-09-01 15:12:56.091 DEBUG (MainThread) [custom_components.linksys_velop] async_setup_entry (REDACTED) --> preparing memory storage
2022-09-01 15:12:56.094 DEBUG (MainThread) [custom_components.linksys_velop] async_setup_entry (REDACTED) --> setting up Mesh for the coordinator
2022-09-01 15:12:56.097 DEBUG (MainThread) [pyvelop.mesh] __init__ --> entered
2022-09-01 15:12:56.100 DEBUG (MainThread) [pyvelop.mesh] __init__ --> Session was passed in: Yes
2022-09-01 15:12:56.104 DEBUG (MainThread) [pyvelop.mesh] __init__ --> pyvelop version: 2022.8.4
2022-09-01 15:12:56.107 DEBUG (MainThread) [pyvelop.mesh] __init__ --> Initialised mesh for 192.168.1.1
2022-09-01 15:12:56.110 DEBUG (MainThread) [pyvelop.mesh] __init__ --> exited
2022-09-01 15:12:56.113 DEBUG (MainThread) [custom_components.linksys_velop] async_setup_entry (REDACTED) --> setting up the coordinator
2022-09-01 15:12:56.117 DEBUG (MainThread) [custom_components.linksys_velop] _async_get_mesh_data (REDACTED) --> entered
2022-09-01 15:12:56.120 DEBUG (MainThread) [custom_components.linksys_velop] _async_get_mesh_data (REDACTED) --> retrieving existing devices for comparison
2022-09-01 15:12:56.124 DEBUG (MainThread) [custom_components.linksys_velop] _async_get_mesh_data (REDACTED) --> retrieving existing nodes for comparison
2022-09-01 15:12:56.128 DEBUG (MainThread) [custom_components.linksys_velop] _async_get_mesh_data (REDACTED) --> gathering details
2022-09-01 15:12:56.132 DEBUG (MainThread) [pyvelop.mesh] async_gather_details --> entered
2022-09-01 15:12:56.136 DEBUG (MainThread) [pyvelop.mesh] _async_gather_details --> entered, args: {"include_backhaul": true, "include_devices": true, "include_firmware_update": true, "include_firmware_update_settings": true, "include_guest_wifi": true, "include_network_connections": true, "include_parental_control": true, "include_speedtest_results": true, "include_speedtest_status": true, "include_storage": true, "include_wan": true}
2022-09-01 15:12:56.140 DEBUG (MainThread) [pyvelop.mesh] _async_make_request --> entered
2022-09-01 15:12:56.144 DEBUG (MainThread) [pyvelop.jnap] Request.execute --> entered
2022-09-01 15:12:56.148 DEBUG (MainThread) [pyvelop.jnap] Request.execute --> URL: http://192.168.1.1/JNAP/, Headers: {'X-JNAP-Authorization': 'Basic REDACTED ==', 'Content-Type': 'application/json; charset=UTF-8', 'X-JNAP-Action': 'http://linksys.com/jnap/core/Transaction'}, Payload: [{"action": "http://linksys.com/jnap/devicelist/GetDevices3", "request": {}}, {"action": "http://linksys.com/jnap/firmwareupdate/GetFirmwareUpdateSettings", "request": {}}, {"action": "http://linksys.com/jnap/nodes/diagnostics/GetBackhaulInfo", "request": {}}, {"action": "http://linksys.com/jnap/guestnetwork/GetGuestRadioSettings2", "request": {}}, {"action": "http://linksys.com/jnap/nodes/networkconnections/GetNodesWirelessNetworkConnections", "request": {}}, {"action": "http://linksys.com/jnap/parentalcontrol/GetParentalControlSettings", "request": {}}, {"action": "http://linksys.com/jnap/healthcheck/GetHealthCheckStatus", "request": {}}, {"action": "http://linksys.com/jnap/healthcheck/GetHealthCheckResults", "request": {"healthCheckModule": "SpeedTest", "includeModuleResults": true, "lastNumberOfResults": 10}}, {"action": "http://linksys.com/jnap/nodes/firmwareupdate/GetFirmwareUpdateStatus", "request": {}}, {"action": "http://linksys.com/jnap/router/GetWANStatus3", "request": {}}], Timeout: 15
2022-09-01 15:12:58.460 DEBUG (MainThread) [pyvelop.jnap] Request.execute --> exited
2022-09-01 15:12:58.466 DEBUG (MainThread) [custom_components.linksys_velop] _async_get_mesh_data (REDACTED) --> error type: <class 'pyvelop.exceptions.MeshInvalidInput'>
2022-09-01 15:12:58.466 DEBUG (MainThread) [custom_components.linksys_velop] Finished fetching linksys_velop (REDACTED) data in 2.353 seconds (success: False)
2022-09-01 15:13:08.473 DEBUG (MainThread) [custom_components.linksys_velop] async_setup_entry (REDACTED) --> entered
2022-09-01 15:13:08.480 DEBUG (MainThread) [custom_components.linksys_velop] async_setup_entry (REDACTED) --> preparing memory storage
2022-09-01 15:13:08.484 DEBUG (MainThread) [custom_components.linksys_velop] async_setup_entry (REDACTED) --> setting up Mesh for the coordinator
2022-09-01 15:13:08.487 DEBUG (MainThread) [pyvelop.mesh] __init__ --> entered
2022-09-01 15:13:08.491 DEBUG (MainThread) [pyvelop.mesh] __init__ --> Session was passed in: Yes
2022-09-01 15:13:08.495 DEBUG (MainThread) [pyvelop.mesh] __init__ --> pyvelop version: 2022.8.4
2022-09-01 15:13:08.498 DEBUG (MainThread) [pyvelop.mesh] __init__ --> Initialised mesh for 192.168.1.1
2022-09-01 15:13:08.501 DEBUG (MainThread) [pyvelop.mesh] __init__ --> exited
2022-09-01 15:13:08.504 DEBUG (MainThread) [custom_components.linksys_velop] async_setup_entry (REDACTED) --> setting up the coordinator
2022-09-01 15:13:08.508 DEBUG (MainThread) [custom_components.linksys_velop] _async_get_mesh_data (REDACTED) --> entered
2022-09-01 15:13:08.512 DEBUG (MainThread) [custom_components.linksys_velop] _async_get_mesh_data (REDACTED) --> retrieving existing devices for comparison
2022-09-01 15:13:08.515 DEBUG (MainThread) [custom_components.linksys_velop] _async_get_mesh_data (REDACTED) --> retrieving existing nodes for comparison
2022-09-01 15:13:08.519 DEBUG (MainThread) [custom_components.linksys_velop] _async_get_mesh_data (REDACTED) --> gathering details
2022-09-01 15:13:08.523 DEBUG (MainThread) [pyvelop.mesh] async_gather_details --> entered
2022-09-01 15:13:08.527 DEBUG (MainThread) [pyvelop.mesh] _async_gather_details --> entered, args: {"include_backhaul": true, "include_devices": true, "include_firmware_update": true, "include_firmware_update_settings": true, "include_guest_wifi": true, "include_network_connections": true, "include_parental_control": true, "include_speedtest_results": true, "include_speedtest_status": true, "include_storage": true, "include_wan": true}
2022-09-01 15:13:08.532 DEBUG (MainThread) [pyvelop.mesh] _async_make_request --> entered
2022-09-01 15:13:08.536 DEBUG (MainThread) [pyvelop.jnap] Request.execute --> entered
2022-09-01 15:13:08.540 DEBUG (MainThread) [pyvelop.jnap] Request.execute --> URL: http://192.168.1.1/JNAP/, Headers: {'X-JNAP-Authorization': 'Basic REDACTED ==', 'Content-Type': 'application/json; charset=UTF-8', 'X-JNAP-Action': 'http://linksys.com/jnap/core/Transaction'}, Payload: [{"action": "http://linksys.com/jnap/devicelist/GetDevices3", "request": {}}, {"action": "http://linksys.com/jnap/firmwareupdate/GetFirmwareUpdateSettings", "request": {}}, {"action": "http://linksys.com/jnap/nodes/diagnostics/GetBackhaulInfo", "request": {}}, {"action": "http://linksys.com/jnap/guestnetwork/GetGuestRadioSettings2", "request": {}}, {"action": "http://linksys.com/jnap/nodes/networkconnections/GetNodesWirelessNetworkConnections", "request": {}}, {"action": "http://linksys.com/jnap/parentalcontrol/GetParentalControlSettings", "request": {}}, {"action": "http://linksys.com/jnap/healthcheck/GetHealthCheckStatus", "request": {}}, {"action": "http://linksys.com/jnap/healthcheck/GetHealthCheckResults", "request": {"healthCheckModule": "SpeedTest", "includeModuleResults": true, "lastNumberOfResults": 10}}, {"action": "http://linksys.com/jnap/nodes/firmwareupdate/GetFirmwareUpdateStatus", "request": {}}, {"action": "http://linksys.com/jnap/router/GetWANStatus3", "request": {}}], Timeout: 15
2022-09-01 15:13:11.484 DEBUG (MainThread) [pyvelop.jnap] Request.execute --> exited
2022-09-01 15:13:11.490 DEBUG (MainThread) [custom_components.linksys_velop] _async_get_mesh_data (REDACTED) --> error type: <class 'pyvelop.exceptions.MeshInvalidInput'>
2022-09-01 15:13:11.490 DEBUG (MainThread) [custom_components.linksys_velop] Finished fetching linksys_velop (REDACTED) data in 2.985 seconds (success: False)

Any ideas? Hoping I don’t have to delete and redo the integration. It has been running perfectly…

If you rollback to the previous release does it all start to work again?

Unfortunately looks like still doesn’t work when I roll back to 8.1. :frowning:

The eagle-eyed amongst you may have noticed that a couple of betas have snuck out recently. The following is where it’s up to so far.

What’s Changed

  • log error for unknown exception
  • Update pl.json by @nepozs
  • bump pyvelop to 2022.9.2
  • make logging the serial configurable
  • Use menu structure for options
  • Add logging options to config flow
  • Start logging from config_flow
  • update readme

What does all this mean. Well, I realised that the logging needed to get a little easier and as @LearningHASlowly found there was a couple of areas that needed redacting as well. So, the update to pyvelop redacts the authentication string by default now and there’s an option in the integration to turn on/off logging of the serial number in the debug logs (it’s off by default).

Logging can now be turned on from the integration configuration meaning no more reboots to do logging (assuming it isn’t an intermittent issue that you’d need to leave logging on to catch).

To make all of this easier the configuration is now menu driven (see following screenshot).

image

The order of the items is the same order they’d be in if the menu wasn’t there, so clicking next once you’re on an option will page through them (that’s dictated by HASS). What this means though, is that you can quickly navigate to the area you wanted to make changes to without the pieces before hand.

The logging section looks like this…

image

As explained in the README, the Single poll option will turn on debug logging only for the duration of 1 poll to get information from the mesh. After which it will be turned off (well back to original state) again. The mode option has no effect if you already have the integration configured in your configuration.yaml.

Oh, and if you’re wondering how you’ll know if the logging is complete… you can either check in the configuration screen (it will be reset to Off) or you can subscribe to the linksys_velop_logging_stopped event (see the README for details). I’ve also updated the example automation in the README to show how a single automation can be used to listen to all the events that the integration emits.

Hopefully that’ll make life a little easier for you.

The pyvelop library has had changes made that may speed up the queries as well, but I make no promises that you’ll notice any difference.


2022.9.1 is not available in HACS with the addition of a couple of guards against logs I saw generated in my HA over the last few days.

2 Likes

@uvjim ,
I have recently reinstall Home assistant supervised (2022.8.7) and HACS (1.27.1) from scratch. However I have trouble with the linksys_velop in HACS. From Home assistant log, I see the following:

ERROR (SyncWorker_0) [homeassistant.loader] The custom integration 'linksys_velop' does not have a version key in the manifest file and was blocked from loading. See https://developers.home-assistant.io/blog/2021/01/29/custom-integration-changes#versions for more details

Could this be something new in Home assistant that affects new install of the component?

Thanks!

Hi @mattho, this integration definitely has a version number in the manifest file. Did you add the GitHub repository was a custom one in HACS?

Someone mentioned a while ago that there’s an integration with the same name. You’ll need to ensure you have one with the author set to “uvjim”.

Thanks @uvjim! Addiing custom_repository in HACS works fine for me.
Safari have problem with adding custom repository but Chrome works.

Thanks a lot!

A couple of betas have snuck out over the weekend. The first didn’t have much other than a bugfix for the configuration flow. In the other I have made some new sensors available. Summary (important bits) of the two betas is below: -

  • add installation details to readme
  • bump pyvelop to 2022.9.5
  • fix options config flow
  • bump pyvelop to 2022.9.6
  • add client steering binary sensor
  • add node steering binary sensor
  • add mac filtering binary sensor (attributes contain the mode and address list)
  • add WPS binary sensor
  • update README

2022.9.2b2 is out (sorry for quick release but there was a bug in services that I found. The additions for this beta are: -

  • add HomeKit integration binary sensors
  • guard against missing config entry in services
  • update the select entity example YAML to include a delete button (only available if the device is offline as you can’t delete an online one) - it’ll look like the following screenshot.

image


2022.9.2b3 is out. Most of the changes here are under the hood.

  • use selectors for timers in config_flow
  • make labels consistent
  • linting fixes
  • use selectors for logging options
  • fix startup after logging options changes
  • use selector for device tracker options
  • use selectors for user step
  • bump minimum hass version to 2022.4.0

Breaking Change (possibly for some)

The bump in minimum HASS version may be a breaking change for some. However, this should have been bumped at the last release and is needed to provide the menu structure when changing options and aloso facilitates the move to using selectors in the configuration flow.


2022.9.2 is now out and available in HACS.

1 Like

2022.10.1b0 is out

  • guard against missing mesh or node
  • mark entities as unavailble for nodes and mesh
  • fixup backhaul sensor conditioning
  • event overhaul
  • add device triggers
  • guard against logger being missing

2022.10.1b1 is out

  • update pyvelop to 2022.10.1
  • bump hass minimum version

Breaking Changes

  • The event overhaul has meant that the event names are now different. The integration now fires a single event type and uses a sub-type to define what the event is. The README has been update to reflect this.
  • Home Assistant minimum version has been bumped to 2022.5.0
1 Like

I installed a prior version without problems and ran it for a few months. When a recent upgrade was released I uninstalled everything to start fresh. However, now I keep getting an error after adding the Integration in HACS and adding the code to the config file. When I try to restart I receive the following platform error:

Platform error device_tracker.linksys_velop - Integration ‘linksys_velop’ not found

I must be doing something dumb, but I cannot figure it out. I sincerely appreciate any help.

For this integration there is nothing to configure in the configuration file. Everything is configured in the UI.

2022.10.1 is out and available for download now

What’s Changed

  • guard against missing mesh or node
  • mark entities as unavailble for nodes and mesh
  • fixup backhaul sensor conditioning
  • event overhaul
  • add device triggers
  • guard against logger being missing
  • update pyvelop to 2022.10.1
  • bump hass minimum version

Breaking Changes

  • The event overhaul has meant that the event names are now different. The integration now fires a single event type and uses a sub-type to define what the event is. The README has been update to reflect this.
  • Home Assistant minimum version has been bumped to 2022.5.0
1 Like

2022.11.1 has been released. Please ensure that you upgrade to this version otherwise things will break in the up coming 2022.11.x versions of Home Assistant.

1 Like

For those using the example cards, the README has been updated with versions that remove the card borders that were introduced in HASS 2022.11.x.

I have been working on a new set of cards that are more mobile friendly, make use of the new sub-view feature and (well to me anyway) are less cluttered. I’ll update this thread and the README with the new ones when I get time.