custom-components / sensor.personalcapital

💵 Personal Capital Integration for Bank Account Monitoring
MIT License
15 stars 8 forks source link

Integration Stopped Working Nov 16th? #19

Open olines opened 2 years ago

olines commented 2 years ago

Hi, the personalcapital integration 0.1.2 seems to have stopped working on Nov 16th?

Home Assistant 2021.11.5

Entity not available:

raman325 commented 2 years ago

https://github.com/haochi/personalcapital/issues/20

raman325 commented 2 years ago

Looks like this PR fixes it: https://github.com/haochi/personalcapital/pull/21

sanghviharshit commented 2 years ago

For anyone looking for the easiest way to get this working again - I forked this repo and got it working with the fixes mentioned above. You can switch over to https://github.com/sanghviharshit/sensor.personalcapital (add it as custom repository and reinstall personal capital using HACS)

ecoen66 commented 2 years ago

@sanghviharshit I uninstalled PC, and re-installed from your custom repo, but now I get:

Logger: homeassistant.components.sensor Source: custom_components/personalcapital/sensor.py:120 Integration: Sensor (documentation, issues) First occurred: 8:51:12 AM (1 occurrences) Last logged: 8:51:12 AM

Error while setting up personalcapital platform for sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform await asyncio.shield(task) File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/personalcapital/sensor.py", line 120, in setup_platform from personalcapital import PersonalCapital, RequireTwoFactorException, TwoFactorVerificationModeEnum File "/usr/local/lib/python3.9/site-packages/personalcapital/init.py", line 1, in from .personalcapital import PersonalCapital, RequireTwoFactorException, TwoFactorVerificationModeEnum File "/usr/local/lib/python3.9/site-packages/personalcapital/personalcapital.py", line 1, in import cloudscraper ModuleNotFoundError: No module named 'cloudscraper'

sanghviharshit commented 2 years ago

I think it's still using the old personalcapital dependency installed with the old component. Can you uninstall both old and new components completely, restart HA, and then install the new component?

ecoen66 commented 2 years ago

Really? I would think that that last part indicates that it is using the new personalcapital:

File "/usr/local/lib/python3.9/site-packages/personalcapital/personalcapital.py", line 1, in import cloudscraper ModuleNotFoundError: No module named 'cloudscraper'

sanghviharshit commented 2 years ago

Yes, you are right. Although I have listed cloudscraper as a requirement here https://github.com/sanghviharshit/personalcapital/blob/master/requirements.txt Not sure why it isn't installed when it installed the new dependency

raman325 commented 2 years ago

It needs to be added to the manifest.json dependencies list in the integration folder. HA does not use requirements.txt

Sorry I misunderstood how you implemented it. You would instead need to add an install_requires list in setup.py. Both requests and cloud scraper should be in there, the reason it worked in HA before is that HA core installs requests by default

sanghviharshit commented 2 years ago

Updated. Thanks for the tip.

markmonroy commented 2 years ago

Thanks so much for the fork. I had used this sensor extensively and was missing it a lot.

ecoen66 commented 2 years ago

Agreed. Thank’s for forking and fixing!

Sent from Yahoo Mail for iPhone

On Saturday, January 15, 2022, 7:21 AM, markmonroy @.***> wrote:

Thanks so much for the fork. I had used this sensor extensively and was missing it a lot.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

markmonroy commented 2 years ago

@sanghviharshit Are you still using your fork of this integration? A while back mine stopped pulling in data for individual accounts. It still pulls in totals for net worth, investment, and cash.

sanghviharshit commented 2 years ago

Yes, I'm using my fork and it stopped pulling in data for individual accounts. I haven't looked in to it though :(

sanghviharshit commented 2 years ago

@markmonroy I looked into the missing attributes and updated my fork. Let me know if you still see any issues.

sanghviharshit commented 2 years ago

It also includes the changes to the personalcapital library based on this https://github.com/haochi/personalcapital/pull/24

markmonroy commented 2 years ago

Hey, it works! Thanks very much!