puttyman / hass-amplifi

A home assistant integration for Ubiquiti Amplifi
31 stars 15 forks source link

Version 2.0.0 - Error Loading Integration #10

Closed townsmcp closed 3 years ago

townsmcp commented 3 years ago

Getting the following error message in the logs after updating to 2.0.0: image

To try and resolve the issue I have:

My HA is containered, and running the following version: image

HACS is running the following version: image

Also enabled logging and getting this error in the logs: image

puttyman commented 3 years ago

Can you provide a screenshot of below:

  1. Login to http://amplifi.lan/info.php
  2. On Chrome open your developer console
  3. Click on the network tab
  4. Click on info-async.php
  5. Click on preview tab and expand

Example below: image

Also how is your router setup? e.g. How many mesh points and additional router you have setup in mesh?

townsmcp commented 3 years ago

I have 2 Aliens, both are main Alien units, one is working as a slave for repeating wifi. The slave is hardwired rather than wireless meshing. The Aliens are working in Bridge mode. Also, im running firmware 3.6.1rc4 image

puttyman commented 3 years ago

@townsmcp unfortunately this integration is for Amplifi HD only - https://store.amplifi.com/products/amplifi-hd-mesh-router . But since you were able to get pass the login it seems the integration can be extended to work for Alien. I do not have one unfortunately.

If you are a developer feel free to submit a PR. The issue is related to the structure of response of Alien is different from HD. Looks like Alien returns more info.

townsmcp commented 3 years ago

@puttyman unfortunately I’m not a dev ☹️ The previous version worked well with Alien. I switched over to the pull request here https://github.com/hanswilw/hass-amplifi to use device_tracker rather than sensor (this one is still working) but would have rather gone back to source via your code. Will see if I can do some sort of comparison between your code and the other version - hehe you never know, it might be possible to get Aliens working again 😉

jpsmith16 commented 3 years ago

I seem to be having a similar issue. I've an Amplifi HD system is set up with 1 router and 4x routers as mesh points (RAMPS). Set up in Bridged Mode and all 4 RAMPs are connected via ethernet backbone. Running firmware 3.6.1 on all. I've included screenshots below. Sorry if the info-async.php one is not what's needed. Previously used same set up with the integration without issue, up until the HA version key requirement

Screenshot 2021-09-11 at 20 43 31

Screenshot 2021-09-11 at 20 07 58 Screenshot 2021-09-11 at 20 38 19

Screenshot 2021-09-11 at 20 06 57

Screenshot 2021-09-11 at 20 40 28

Screenshot 2021-09-11 at 20 39 56

Screenshot 2021-09-11 at 20 39 28

Screenshot 2021-09-11 at 20 29 18

puttyman commented 3 years ago

@jpsmith16 @townsmcp can you please attach the whole content of the info-async.php. Feel free to modify any content for your security. Before you attach them check if it is valid json https://jsonlint.com/ after altering the content.

I'll take it a look and have it work for both.

townsmcp commented 3 years ago

Sure. Find attached for the Alien file info-async.log

puttyman commented 3 years ago

Pushed a fix for that. Let me know how you go.

townsmcp commented 3 years ago

@puttyman i have installed the update and all is working perfectly on Aliens - all devices are showing and when a device disconnects and reconnects that is updated in status.

One suggested future change if at all possible might be delay the device_tracker showing as away immediately - delay the away status change to 3 or 5 minutes before the device is marked away? Or ideally to make it a configurable period so the user can choose how long a device is off Wi-fi before status changes to away (I believe iPhones still go into deep sleep and drop Wi-fi connection even though at home)

jpsmith16 commented 3 years ago

@puttyman Attached is my info-async file. Did put it through jsonlint.com, so hopefully it's what you need

I did update the Integration based on the one you released earlier today and still getting error

Screenshot 2021-09-12 at 14 35 15

Screenshot 2021-09-12 at 14 36 42

arboeh commented 3 years ago

Same issue for me. Everything updated to latest versions. Still getting the error described above.

lohita commented 3 years ago

Same issue for me even after the latest updates.

Gorbac commented 3 years ago

I've the same problem

teaching-innovation commented 3 years ago

This error originated from a custom integration.

Logger: homeassistant Source: custom_components/amplifi/coordinator.py:79 Integration: Amplifi (documentation, issues) First occurred: 7:48:20 (88 occurrences) Last logged: 8:02:52

Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 134, in _handle_refresh_interval await self._async_refresh(log_failures=True, scheduled=True) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 265, in _async_refresh update_callback() File "/config/custom_components/amplifi/coordinator.py", line 79, in extract_ethernet_ports self._ethernet_ports = self.data[ETHERNET_PORTS_IDX][router_mac_addr] KeyError: None

puttyman commented 3 years ago

All those having issues can you please post the info-async.php as mentioned above. Also please do not replace the whole mac addresses instead you may find and replace the mac you'd like to hide.

E.g. if the mac is 66:22:22:11:77 replace all 66:22:22:11:77 with an actual valid dummy mac.

arboeh commented 3 years ago

Are you serious to post the whole info-async.php response? That response is full of MAC- and IP-addresses... I would send it to you via e-mail.

jpsmith16 commented 3 years ago

All those having issues can you please post the info-async.php as mentioned above. Also please do not replace the whole mac addresses instead you may find and replace the mac you'd like to hide.

E.g. if the mac is 66:22:22:11:77 replace all 66:22:22:11:77 with an actual valid dummy mac.

Have updated my file based on this. Hopefully this works for you to enable a fix soon?

selhammer commented 3 years ago

Hi Just installed hass-amplifi and experience the same as above, Failed to setup. Guess I have the latest since I installed it some hour ago :)

Im using Amplify Mech HD with two mesh points and no other router.

What part of info.php are you interested in?

arboeh commented 3 years ago

My response file. Was "a little bit" of work to change every security relevant info :-| Hope it helps to fix the issue. info-async.json.txt

puttyman commented 3 years ago

@arboeh Are you having same issue as https://github.com/puttyman/hass-amplifi/issues/10#issuecomment-922118659 ? If not please post your logs.

arboeh commented 3 years ago

Hey @puttyman. Log is:

2021-09-21 07:55:51 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry 192.168.0.218 for amplifi Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 304, in async_setup result = await component.async_setup_entry(hass, self) # type: ignore File "/config/custom_components/amplifi/init.py", line 32, in async_setup_entry await coordinator.async_config_entry_first_refresh() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 156, in async_config_entry_first_refresh await self._async_refresh(log_failures=False, raise_on_auth_failed=True) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 265, in _async_refresh update_callback() File "/config/custom_components/amplifi/coordinator.py", line 79, in extract_ethernet_ports self._ethernet_ports = self.data[ETHERNET_PORTS_IDX][router_mac_addr] KeyError: None 2021-09-21 07:56:01 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 134, in _handle_refresh_interval await self._async_refresh(log_failures=True, scheduled=True) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 265, in _async_refresh update_callback() File "/config/custom_components/amplifi/coordinator.py", line 79, in extract_ethernet_ports self._ethernet_ports = self.data[ETHERNET_PORTS_IDX][router_mac_addr] KeyError: None

Horsboell commented 3 years ago

On the road atm so no logs, but just chiming in to sat that I have the same issue after upgrading. Hopefully some of the above will solve my issue as well - great work on the integration - many thanks :)

puttyman commented 3 years ago

@arboeh pushed a fix based on the data from your router response. Hopefully that should fix it for everyone. If not then reopen this issue.

C0NTi commented 3 years ago

@arboeh pushed a fix based on the data from your router response. Hopefully that should fix it for everyone. If not then reopen this issue.

Updated to this latest version and I no longer get the error. many thanks @puttyman your integration has basically replaced all my presence detection measures!

arboeh commented 3 years ago

@puttyman Thanks, works again. Great integration. If you need any help again, feel free to ask.

teaching-innovation commented 3 years ago

Legend. Thank you. Now HA can tell me when my in law’s arrive again.

Horsboell commented 3 years ago

Working here again as well. Thanks a bunch for the effort @puttyman - this is the backbone of my presence-detection. You're a legend.

jpsmith16 commented 3 years ago

Back working here too. Many thanks for your help!

lohita commented 3 years ago

And here too! Thanks Puttyman!

Regards,

Lohita

On Sun, 26 Sep 2021, 19:32 jpsmith16, @.***> wrote:

Back working here too. Many thanks for your help!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/puttyman/hass-amplifi/issues/10#issuecomment-927269501, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEVHYABE4BCWL7QFDDW2FDTUD3SEDANCNFSM5D2XWBTA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.