TamirMa / google-nest-telegram-sync

MIT License
10 stars 0 forks source link

Error executing main.py #3

Open Plaatjesdraaier opened 2 months ago

Plaatjesdraaier commented 2 months ago

First of all, i'm a noob so excuse me on forehand. I unpacked the zip file into a directory c:\test where I also placed a .env file with the required data and executed pip install -r requirements.txt thru powershell When I now enter python3 main.py in my powershell window, I get the error message:

Traceback (most recent call last): File "C:\test\main.py", line 1, in from dotenv import load_dotenv ModuleNotFoundError: No module named 'dotenv'

What am I doing wrong ? Best regards, Jeffrey

Plaatjesdraaier commented 2 months ago

I uninstalled all python versions (had 2 versions installed) After that a did a fresh install and registered the path to Python. Now the error has changed into : c:\test> python main.py Traceback (most recent call last): File "c:\test\main.py", line 6, in from google_auth_wrapper import GoogleConnection File "c:\test\google_auth_wrapper.py", line 3, in from nest_api import NestDoorbellDevice ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\test\nest_api.py", line 3, in from models import CameraEvent File "c:\test\models.py", line 5, in from pydantic import BaseModel, validator ModuleNotFoundError: No module named 'pydantic'

TamirMa commented 2 months ago

Hi Jeffrey, you need to install the prerequisites using the requirements.txt file. pip3 install -r requirements.txt

Plaatjesdraaier commented 2 months ago

TamirMa.txt Hi Tamir, To be sure, I created a new Debian vm. I installed docker and python on it and it works fine without any errors. Then I downloaded your files and unziped them into a directory. (home/username/Downloads/google) After that I followed your instructions (in the directory where the files are): pip install -r requirements.txt sudo docker run --rm -it breph/ha-google-home_get-token sudo nano .env I put the data in the .env file and then started python3_main.py with the following result:

~/Downloads/google$ python3 main.py Traceback (most recent call last): File "/home/jeffrey/Downloads/google/main.py", line 6, in from google_auth_wrapper import GoogleConnection File "/home/jeffrey/Downloads/google/google_auth_wrapper.py", line 3, in from nest_api import NestDoorbellDevice ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/jeffrey/Downloads/google/nest_api.py", line 3, in from models import CameraEvent File "/home/jeffrey/Downloads/google/models.py", line 5, in from pydantic import BaseModel, validator ModuleNotFoundError: No module named 'pydantic'

Please help Best regards, Jeffrey

TamirMa commented 2 months ago

Try pip3 install pydantic

Plaatjesdraaier commented 2 months ago

Hi Tamir, It seems to make some difference but it 's still not working. TamirMa.txt The error is displayed in a loop Thanks again for looking into it.

TamirMa commented 2 months ago

It seems like you are almost there, it even found a Nest Camera. What type of camera do you have in this account? It looks a bit different than the one I have on my end (my device id starts "DEVICE_XXX...")

Plaatjesdraaier commented 2 months ago

Its a Nest_Hello.0 (I Think its one of the first versions)

Plaatjesdraaier commented 2 months ago

Any suggestions ?

TamirMa commented 2 months ago

I don't know if this API supports this device. Are you using the Google Home app and seeing the camera and its past events?

Plaatjesdraaier commented 2 months ago

The google nest doorbell is visible in the google home app (migrated from the nest app) and shows the events. I can also access the video stream via the web browser (home.google.com) My primary goal is actually to send a picture from the camera via Node-Red to an email adress when it is triggered by an event. Later I might want the stream to be cast to a TV when triggered

TamirMa commented 2 months ago

If you are interested we can debug it together (somehow). I can also point out this comment https://github.com/TamirMa/google-nest-telegram-sync/issues/1#issuecomment-1971134971 which sounds very similar to your issue

Plaatjesdraaier commented 2 months ago

The topic you refer to does seem to have similarities. I have already looked to see if I also have a testcam.py, but I can't find it (otherwise I would have adjusted the content as indicated) It's great that you take the time and want to help, but I have to warn you that I am not hindered by any knowledge (I am from the look at google academy)

TamirMa commented 2 months ago

It sounds like there's some kind of an issue when moving from Nest to Google Nest. I would suggest re-pairing your Nest might help.