Git Product home page Git Product logo

Comments (29)

ttaidapos avatar ttaidapos commented on June 19, 2024 1

Also, was your issue running on the pi fixed by using another version of the integration or by installing the suggested package?

Installing suggested package.

from home-assistant-mail-and-packages.

moralmunky avatar moralmunky commented on June 19, 2024

Are you running home assistant as root or as hass?
You activated it through the integration menu?

from home-assistant-mail-and-packages.

moralmunky avatar moralmunky commented on June 19, 2024

It appears that there is an issue on your system preventing python packages being installed. This person had a similar issue and it appeared to be related with how they installed python 3.7.

numpy/numpy#14553

from home-assistant-mail-and-packages.

ttaidapos avatar ttaidapos commented on June 19, 2024

Are you running home assistant as root or as hass?

hass aka (homeassistant)

You activated it through the integration menu?

Correct

It appears that there is an issue on your system preventing python packages being installed. This person had a similar issue and it appeared to be related with how they installed python 3.7.

numpy/numpy#14553

This is a vanilla buster lite installation following instructions from hass website.

from home-assistant-mail-and-packages.

moralmunky avatar moralmunky commented on June 19, 2024

I see that the permission on your file are owned by root and are group root. Are the other files for the configuration also owned by root?

from home-assistant-mail-and-packages.

moralmunky avatar moralmunky commented on June 19, 2024

I followed the instruction for rasp pi 3 from this page. Used Samba to copy the files over manually, added my details to the integration with the exception of changing the path to the home folder since it is different in this system installation.

/config/www/mail_and_packages/

All sensors are showing. See if the path corrects your issue. Or if you used different installation instruction please post the link to the page.

from home-assistant-mail-and-packages.

firstof9 avatar firstof9 commented on June 19, 2024

numpy isn't a requirement in 0.1.2 so use that version, which is the version on the master branch.

from home-assistant-mail-and-packages.

ttaidapos avatar ttaidapos commented on June 19, 2024

I see that the permission on your file are owned by root and are group root. Are the other files for the configuration also owned by root?

Yes they are below are the two other directories.

pi@hass:/home/homeassistant/.homeassistant/custom_components/mail_and_packages $ cd .translations/
pi@hass:/home/homeassistant/.homeassistant/custom_components/mail_and_packages/.translations $ ls -lha
total 12K
drwxr-xr-x 2 root root 4.0K Mar 3 21:34 .
drwxr-xr-x 3 root root 4.0K Mar 14 22:06 ..
-rw-r--r-- 1 root root 1.0K Mar 3 21:34 en.json

and images folder...
pi@hass:/home/homeassistant/.homeassistant/www/mail_and_packages $ ls -lha
total 96K
drwxr-xr-x 2 pi homeassistant 4.0K Mar 14 12:32 .
drwxr-xr-x 5 pi homeassistant 4.0K Mar 14 12:31 ..
-rw-r--r-- 1 pi homeassistant 44K Mar 3 20:34 image-no-mailpieces700.jpg
-rw-r--r-- 1 pi homeassistant 41K Mar 3 20:34 mail_none.gif

By comparison, here's another custom component I'm using and the permissions.
pi@hass:/home/homeassistant/.homeassistant/custom_components/nws_alerts $ ls -lha
total 16K
drwxr-xr-x 2 root root 4.0K Feb 23 11:17 .
drwxr-xr-x 4 root root 4.0K Mar 14 12:20 ..
-rw-r--r-- 1 root root 0 May 8 2019 init.py
-rw-r--r-- 1 root root 5.9K May 9 2019 sensor.py

I followed the instruction for rasp pi 3 from this page. Used Samba to copy the files over manually, added my details to the integration with the exception of changing the path to the home folder since it is different in this system installation.

/config/www/mail_and_packages/

All sensors are showing. See if the path corrects your issue. Or if you used different installation instruction please post the link to the page.

The guide you used is for hass.io it looks like. Here are the instructions I use:
https://www.home-assistant.io/docs/installation/raspberry-pi/

numpy isn't a requirement in 0.1.2 so use that version, which is the version on the master branch.

I'll give this a try.

from home-assistant-mail-and-packages.

firstof9 avatar firstof9 commented on June 19, 2024

This is why the recommended way is to use HACS to install. The files being owned by root should be fine since there's read access.

from home-assistant-mail-and-packages.

ttaidapos avatar ttaidapos commented on June 19, 2024

numpy isn't a requirement in 0.1.2 so use that version, which is the version on the master branch.

Removed integration, deleted files, installed 1.2 and rebooted. Added integration, rebooted again and i still get the exact same issues as OP including numpy.

This is the zip i used for .1.2
https://github.com/moralmunky/Home-Assistant-Mail-And-Packages/releases/tag/0.1.2

I did try hacs but ran into some goofy issues hence the manual route.

from home-assistant-mail-and-packages.

firstof9 avatar firstof9 commented on June 19, 2024

Double checked imageio uses numpy, try giving this command a go: sudo apt-get install libatlas-base-dev

from home-assistant-mail-and-packages.

moralmunky avatar moralmunky commented on June 19, 2024

I flashed raspberry lite and used the instructions you provided to install manually within a venv.

I also received this error. It occurs right after saving the integration settings. It appears to be an issue specific to raspberry pi. @firstof9 taking the current version from the repository produces this, there might be a dependency on numpy that hasn't been completely removed?

Based on recommendation from other forums installing
sudo apt-get install libatlas-base-dev

This fixes the initial error but other errors are produced on this platform, line 868.

UnboundLocalError: local variable 'fp' referenced before assignment

I've run out of time to go deeper, but still platform specific. I run hass in the same manner but on Ubunutu without this issue.

from home-assistant-mail-and-packages.

firstof9 avatar firstof9 commented on June 19, 2024

UnboundLocalError: local variable 'fp' referenced before assignment

This sounds like the try/catch had an error. When you have time can you check the log for a CRITICAL error?

from home-assistant-mail-and-packages.

firstof9 avatar firstof9 commented on June 19, 2024

The fix for numpy related errors: sudo apt-get install libatlas-base-dev

from home-assistant-mail-and-packages.

ttaidapos avatar ttaidapos commented on June 19, 2024

The fix for numpy related errors: sudo apt-get install libatlas-base-dev

Do you still get error messages "UnboundLocalError: local variable 'fp' referenced before assignment" as @moralmunky mentioned?

from home-assistant-mail-and-packages.

firstof9 avatar firstof9 commented on June 19, 2024

I never got an error regarding 'fp' have you @ttaidapos ?

from home-assistant-mail-and-packages.

ttaidapos avatar ttaidapos commented on June 19, 2024

The said error mentioned above I did not get. I was able to configure once and that was initially. After everything looked good, i removed the integration and re-added (reboots in between) so I can change the folder to look into in GMail since I was not able to find any file to edit my initial configuration.

Every since, I'm not able to get it working again even with using the default "inbox" folder. Below is what i'm seeing. During the integration add, all i'm getting is "unknown error" in red letters.

P.S I'm on hass 107.5

`Log Details (ERROR)
Logger: aiohttp.server
Source: custom_components/mail_and_packages/config_flow.py:106
First occurred: 8:54:11 PM (3 occurrences)
Last logged: 8:54:51 PM

Error handling request
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
resp = await task
File "/srv/homeassistant/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
resp = await handler(request)
File "/srv/homeassistant/lib/python3.7/site-packages/aiohttp/web_middlewares.py", line 119, in impl
return await handler(request)
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/http/real_ip.py", line 39, in real_ip_middleware
return await handler(request)
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/http/ban.py", line 72, in ban_middleware
return await handler(request)
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/http/auth.py", line 127, in auth_middleware
return await handler(request)
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/http/view.py", line 123, in handle
result = await result
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/config/config_entries.py", line 163, in post
return await super().post(request, flow_id)
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/http/data_validator.py", line 50, in wrapper
result = await method(view, request, *args, **kwargs)
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/data_entry_flow.py", line 92, in post
result = await self._flow_mgr.async_configure(flow_id, data)
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/data_entry_flow.py", line 130, in async_configure
result = await self._async_handle_step(flow, cur_step["step_id"], user_input)
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/data_entry_flow.py", line 172, in _async_handle_step
result: Dict = await getattr(flow, method)(user_input)
File "/home/homeassistant/.homeassistant/custom_components/mail_and_packages/config_flow.py", line 42, in async_step_user
user_input[CONF_USERNAME], user_input[CONF_PASSWORD])
File "/home/homeassistant/.homeassistant/custom_components/mail_and_packages/config_flow.py", line 106, in _test_login
account = imaplib.IMAP4_SSL(host, port)
File "/usr/lib/python3.7/imaplib.py", line 1288, in init
IMAP4.init(self, host, port)
File "/usr/lib/python3.7/imaplib.py", line 198, in init
self.open(host, port)
File "/usr/lib/python3.7/imaplib.py", line 1301, in open
IMAP4.open(self, host, port)
File "/usr/lib/python3.7/imaplib.py", line 299, in open
self.sock = self._create_socket()
File "/usr/lib/python3.7/imaplib.py", line 1291, in _create_socket
sock = IMAP4._create_socket(self)
File "/usr/lib/python3.7/imaplib.py", line 289, in _create_socket
return socket.create_connection((host, self.port))
File "/usr/lib/python3.7/socket.py", line 707, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File "/usr/lib/python3.7/socket.py", line 748, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known`

from home-assistant-mail-and-packages.

firstof9 avatar firstof9 commented on June 19, 2024

socket.gaierror: [Errno -2] Name or service not known`

This error means the hostname isn't correct.

Check what you are putting in the host, if it's Gmail make sure you are putting imap.gmail.com not imap.google.com I've made that mistake once or twice myself.

from home-assistant-mail-and-packages.

ttaidapos avatar ttaidapos commented on June 19, 2024

socket.gaierror: [Errno -2] Name or service not known`

This error means the hostname isn't correct.

Check what you are putting in the host, if it's Gmail make sure you are putting imap.gmail.com not imap.google.com I've made that mistake once or twice myself.

You're absolutely right, so sorry for this novice error. This is what happens when you try to plow through troubleshooting. Couldn't find this anywhere else, can you use other labels (folders) in GMail besides "inbox". I've having a hell of a time getting it to work.

from home-assistant-mail-and-packages.

firstof9 avatar firstof9 commented on June 19, 2024

Step 2 has a drop down to select your labels. It pulls your folders list from the server itself now, for Gmail labels act as folders.

from home-assistant-mail-and-packages.

ttaidapos avatar ttaidapos commented on June 19, 2024

Step 2 has a drop down to select your labels. It pulls your folders list from the server itself now, for Gmail labels act as folders.

Not sure I understand. I created a gmail label named "Mail and Packages". Inputting that in the configuration screen doesn't seem to work.

Never mind, wrapped it in quotes and that did the trick. Thank you everyone!

from home-assistant-mail-and-packages.

moralmunky avatar moralmunky commented on June 19, 2024

Sounds like you are on an older version. The folder option was changed to a drop down menu that provides a list of the folders found in your mailbox.

from home-assistant-mail-and-packages.

moralmunky avatar moralmunky commented on June 19, 2024

Also, was your issue running on the pi fixed by using another version of the integration or by installing the suggested package?

from home-assistant-mail-and-packages.

firstof9 avatar firstof9 commented on June 19, 2024

Sounds like you are on an older version. The folder option was changed to a drop down menu that provides a list of the folders found in your mailbox.

To be fair, the 0.1.3 releases are marked as betas. I think once the Yahoo mail thing is sorted it should be good enough for everyone.

from home-assistant-mail-and-packages.

ttaidapos avatar ttaidapos commented on June 19, 2024

Sounds like you are on an older version. The folder option was changed to a drop down menu that provides a list of the folders found in your mailbox.

To be fair, the 0.1.3 releases are marked as betas. I think once the Yahoo mail thing is sorted it should be good enough for everyone.

Explains why i was going crazy lol I installed the latest greatest twice and didn't see it lol On another note, is it me or "packages in transit" total does not equal UPS+FEDEX+USPS packages in transit?
Untitled

from home-assistant-mail-and-packages.

firstof9 avatar firstof9 commented on June 19, 2024

That if i recall is fixed in the beta

from home-assistant-mail-and-packages.

ttaidapos avatar ttaidapos commented on June 19, 2024

That if i recall is fixed in the beta

Cool thanks! Also, seems like USPS Mail is counting not only mail but packages as well, unless that's intended?

from home-assistant-mail-and-packages.

moralmunky avatar moralmunky commented on June 19, 2024

The USPS Mail sensor should only be counting the number of mail pieces from the informed delivery email, no packages. Can you show what you are seeing?

from home-assistant-mail-and-packages.

ttaidapos avatar ttaidapos commented on June 19, 2024

The USPS Mail sensor should only be counting the number of mail pieces from the informed delivery email, no packages. Can you show what you are seeing?

Confirmed this was a goof on the USPS side. Ignore.

from home-assistant-mail-and-packages.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.