marn06 / homebridge-vw

MIT License
4 stars 0 forks source link

Can't install this plugin #3

Closed CyberChris79 closed 7 months ago

CyberChris79 commented 1 year ago

Hello,

i just tried to install this plugin via Homebridge GUI, but i always recieve an error message.

0 verbose cli /usr/bin/node /usr/bin/npm 1 info using npm@9.5.0 2 info using node@v18.15.0 3 timing npm:load:whichnode Completed in 7ms 4 timing config:load:defaults Completed in 5ms 5 timing config:load:file:/usr/lib/node_modules/npm/npmrc Completed in 0ms 6 timing config:load:builtin Completed in 0ms 7 timing config:load:cli Completed in 1ms 8 warn config global-style This option has been deprecated in favor of--install-strategy=shallow` 9 timing config:load:env Completed in 1ms 10 timing config:load:project Completed in 0ms 11 timing config:load:file:/home/homebridge/.npmrc Completed in 0ms 12 timing config:load:user Completed in 0ms 13 timing config:load:file:/usr/etc/npmrc Completed in 0ms 14 timing config:load:global Completed in 0ms 15 timing config:load:setEnvs Completed in 0ms 16 timing config:load Completed in 9ms 17 timing npm:load:configload Completed in 9ms 18 timing npm:load:mkdirpcache Completed in 0ms 19 timing npm:load:mkdirplogs Completed in 0ms 20 verbose title npm install homebridge-vw@1.0.9 21 verbose argv "install" "--global" "homebridge-vw@1.0.9" 22 timing npm:load:setTitle Completed in 1ms 23 timing config:load:flatten Completed in 2ms 24 timing npm:load:display Completed in 2ms 25 verbose logfile logs-max:10 dir:/home/homebridge/.npm/_logs/2023-03-29T06_45_48_543Z- 26 verbose logfile /home/homebridge/.npm/_logs/2023-03-29T06_45_48_543Z-debug-0.log 27 timing npm:load:logFile Completed in 3ms 28 timing npm:load:timers Completed in 0ms 29 timing npm:load:configScope Completed in 0ms 30 timing npm:load Completed in 23ms 31 timing config:load:flatten Completed in 1ms 32 timing arborist:ctor Completed in 1ms 33 silly logfile start cleaning logs, removing 1 files 34 silly logfile done cleaning log files 35 timing idealTree:init Completed in 5ms 36 timing idealTree:userRequests Completed in 2ms 37 silly idealTree buildDeps 38 silly fetch manifest homebridge-vw@1.0.9 39 http fetch GET 200 https://registry.npmjs.org/homebridge-vw 979ms (cache revalidated) 40 silly placeDep ROOT homebridge-vw@1.0.9 OK for: want: 1.0.9 41 timing idealTree:#root Completed in 986ms 42 timing idealTree:node_modules/homebridge-vw Completed in 0ms 43 timing idealTree:buildDeps Completed in 987ms 44 timing idealTree:fixDepFlags Completed in 0ms 45 timing idealTree Completed in 995ms 46 timing reify:loadTrees Completed in 996ms 47 timing reify:diffTrees Completed in 0ms 48 silly reify moves {} 49 timing reify:retireShallow Completed in 1ms 50 timing reify:createSparse Completed in 1ms 51 timing reify:loadBundles Completed in 0ms 52 http fetch GET 200 https://registry.npmjs.org/homebridge-vw/-/homebridge-vw-1.0.9.tgz 709ms (cache revalidated) 53 timing reifyNode:node_modules/homebridge-vw Completed in 721ms 54 timing reify:unpack Completed in 721ms 55 timing reify:unretire Completed in 0ms 56 timing build:queue Completed in 0ms 57 info run homebridge-vw@1.0.9 postinstall node_modules/homebridge-vw node postinstall.js 58 info run homebridge-vw@1.0.9 postinstall { code: 1, signal: null } 59 timing reify:rollback:createSparse Completed in 2ms 60 timing reify:rollback:retireShallow Completed in 0ms 61 timing command:install Completed in 2140ms 62 verbose stack Error: command failed 62 verbose stack at ChildProcess. (/usr/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:53:27) 62 verbose stack at ChildProcess.emit (node:events:513:28) 62 verbose stack at maybeClose (node:internal/child_process:1091:16) 62 verbose stack at ChildProcess._handle.onexit (node:internal/child_process:302:5) 63 verbose pkgid homebridge-vw@1.0.9 64 verbose cwd /usr 65 verbose Linux 5.15.102-1-pve 66 verbose node v18.15.0 67 verbose npm v9.5.0 68 error code 1 69 error path /usr/lib/node_modules/homebridge-vw 70 error command failed 71 error command sh -c node postinstall.js 72 verbose exit 1 73 timing npm Completed in 2173ms 74 verbose unfinished npm timer reify 1680072348577 75 verbose unfinished npm timer reify:build 1680072350301 76 verbose unfinished npm timer build 1680072350301 77 verbose unfinished npm timer build:deps 1680072350301 78 verbose unfinished npm timer build:run:postinstall 1680072350302 79 verbose unfinished npm timer build:run:postinstall:node_modules/homebridge-vw 1680072350302 80 verbose code 1 81 error A complete log of this run can be found in: 81 error /home/homebridge/.npm/_logs/2023-03-29T06_45_48_543Z-debug-0.log

`

marn06 commented 1 year ago

Hi @CyberChris79 I am not really sure what the issue is but it seems the issue is related to the postinstall and all it does, is:

  1. Remove the "dist/venv" folder
  2. Install a new python environment with the following command: python3 -m venv dist/venv && dist/venv/bin/pip3 install beautifulsoup4 jsonpickle requests xmltodict

Maybe you don't have python3 in your path or something like that? You could also try and check /home/homebridge/.npm/_logs/2023-03-29T06_45_48_543Z-debug-0.log if it contains any useful information.

CyberChris79 commented 1 year ago

Hello @marn06 ,

thank you. The error message, i posted first, was the complete log in the file /home/homebridge/.npm/_logs/2023-03-29T06_45_48_543Z-debug-0.log

gawain33 commented 1 year ago

I can't install it either:

Error: Command failed: sh ./install.sh

at ChildProcess.exithandler (node:child_process:412:12)
at ChildProcess.emit (node:events:513:28)
at maybeClose (node:internal/child_process:1091:16)
at Socket.<anonymous> (node:internal/child_process:449:11)
at Socket.emit (node:events:513:28)
at Pipe.<anonymous> (node:net:313:12) {

code: 1, killed: false, signal: null, cmd: 'sh ./install.sh' }

Node.js v18.12.1 npm ERR! code 1 npm ERR! path /var/lib/homebridge/node_modules/homebridge-vw npm ERR! command failed npm ERR! command sh -c -- node postinstall.js

npm ERR! A complete log of this run can be found in: npm ERR! /home/pi/.npm/_logs/2023-04-17T10_41_36_322Z-debug-0.log

Operation failed. Please review log for details.

marn06 commented 1 year ago

Hi @gawain33 Do you know if you have python3 in path on your machine? Try running the command in terminal: python3

If it does not work, that's the reason.

gawain33 commented 1 year ago

Thank you for the quick response.

It seems to be installed:

@.***

@.***:/var/lib/homebridge $ python3 Python 3.9.2 (default, Mar 12 2021, 04:06:34) [GCC 10.2.1 20210110] on linux Type "help", "copyright", "credits" or "license" for more information.

On 17/04/2023, 13:41, "marn06" @.***> wrote:

Hi @gawain33https://github.com/gawain33 Do you know if you have python3 in path on your machine? Try running the command in terminal: python3

If it does not work, that's the reason.

— Reply to this email directly, view it on GitHubhttps://github.com/marn06/homebridge-vw/issues/3#issuecomment-1511184829, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A7EJHPY5KKAAUWIG4GZJXCLXBUT73ANCNFSM6AAAAAAWLQXRYU. You are receiving this because you were mentioned.Message ID: @.***>

marn06 commented 1 year ago

Try and run the command manually in the folder /var/lib/homebridge/node_modules/homebridge-vw: python3 -m venv dist/venv && dist/venv/bin/pip3 install beautifulsoup4 jsonpickle requests xmltodict

gawain33 commented 1 year ago

That folder doesn’t exist, probably because the install fails.

@.***:/var/lib/homebridge/node_modules $ dir dist homebridge homebridge-connexoon homebridge-doorbird homebridge-nest

I tried to run that command from the higher folder:

@.***:/var/lib/homebridge/node_modules $ python3 -m venv dist/venv && dist/venv/bin/pip3 install beautifulsoup4 jsonpickle requests xmltodict The virtual environment was not created successfully because ensurepip is not available. On Debian/Ubuntu systems, you need to install the python3-venv package using the following command.

apt-get install python3-venv

You may need to use sudo with that command. After installing the python3-venv package, recreate your virtual environment.

Failing command: ['/var/lib/homebridge/node_modules/dist/venv/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']

@.***:/var/lib/homebridge/node_modules $

On 17/04/2023, 14:04, "marn06" @.***> wrote:

Try and run the command manually in the folder /var/lib/homebridge/node_modules/homebridge-vw: python3 -m venv dist/venv && dist/venv/bin/pip3 install beautifulsoup4 jsonpickle requests xmltodict

— Reply to this email directly, view it on GitHubhttps://github.com/marn06/homebridge-vw/issues/3#issuecomment-1511214473, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A7EJHP6HI54CPVEWCSGBMZDXBUWV7ANCNFSM6AAAAAAWLQXRYU. You are receiving this because you were mentioned.Message ID: @.***>

marn06 commented 1 year ago

Hi @gawain33 Then you are missing the package python3-venv which you install by running: apt-get install python3-venv This should of course be a dependency in this project.

gawain33 commented 1 year ago

Thank you for helping me with this. I tried that command and get this result:

@.:~ $ apt-get install python3-venv E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied) E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root? @.:~ $

On 18/04/2023, 10:58, "marn06" @.***> wrote:

Hi @gawain33https://github.com/gawain33 Then you are missing the package python3-venv which you install by running: apt-get install python3-venv This should of course be a dependency in this project.

— Reply to this email directly, view it on GitHubhttps://github.com/marn06/homebridge-vw/issues/3#issuecomment-1512716569, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A7EJHP6C4O2OYHGCQ3FFJ4DXBZJS7ANCNFSM6AAAAAAWLQXRYU. You are receiving this because you were mentioned.Message ID: @.***>

marn06 commented 1 year ago

Hi @gawain33 Try running it with sudo: sudo apt-get install python3-venv And also try run this command that should work if you have venv: python3 -m venv --help

gawain33 commented 1 year ago

Thanks again for sticking with me. I tried the first line with sudo and that worked, the node is now installed.

I entered my login info and the VIN and seem to be connected. I don’t understand SPIN. Can you help with that please?

[A picture containing text, electronics, screenshot Description automatically generated]

These are the symbols I see.

I try to click the fan symbol to heat the car but it keeps going back to the Off setting.

On 18/04/2023, 12:03, "marn06" @.***> wrote:

Hi @gawain33https://github.com/gawain33 Try running it with sudo: sudo apt-get install python3-venv And also try run this command that should work if you have venv: python3 -m venv --help

— Reply to this email directly, view it on GitHubhttps://github.com/marn06/homebridge-vw/issues/3#issuecomment-1512799405, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A7EJHP2KPT4OGGXAFVPSO3TXBZRHNANCNFSM6AAAAAAWLQXRYU. You are receiving this because you were mentioned.Message ID: @.***>

marn06 commented 1 year ago

Hi @gawain33 The spin is the 4-digit code that you chose in the offical WeConnect app to unlock/lock your car.

gawain33 commented 1 year ago

Hi @@.***>

Thank you for that, the locking is working now.

The climatization still turns off a few seconds after I turn it on. Is there perhaps a log I can send to you?

Gavin

On 20/04/2023, 09:05, "marn06" @.***> wrote:

Hi @gawain33https://github.com/gawain33 The spin is the 4-digit code that you chose in the offical WeConnect app to unlock/lock your car.

— Reply to this email directly, view it on GitHubhttps://github.com/marn06/homebridge-vw/issues/3#issuecomment-1515816860, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A7EJHP5ARURJE46BMPZNMU3XCDNZ5ANCNFSM6AAAAAAWLQXRYU. You are receiving this because you were mentioned.Message ID: @.***>

marn06 commented 1 year ago

Hi @gawain33 If you navigate to the folder of the plugin (./node_modules/homebridge-vw/dist) there is a weconnect.log file, that contains all the logs. It might be that there is no relevant information due to the logging level, and you can try manually changing it in the main.py or nativeAPI.py file to logging.DEBUG and restart homebridge.

gawain33 commented 1 year ago

I’m sorry @@.***> but I don’t have the knowledge of the pi environment to do that.

On 20/04/2023, 10:46, "marn06" @.***> wrote:

Hi @gawain33https://github.com/gawain33 If you navigate to the folder of the plugin (./node_modules/homebridge-vw/dist) there is a weconnect.log file, that contains all the logs. It might be that there is no relevant information due to the logging level, and you can try manually changing it in the main.py or nativeAPI.py file to logging.DEBUG

— Reply to this email directly, view it on GitHubhttps://github.com/marn06/homebridge-vw/issues/3#issuecomment-1515954554, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A7EJHP3VCLUEP2OYD3DH6BTXCDZVZANCNFSM6AAAAAAWLQXRYU. You are receiving this because you were mentioned.Message ID: @.***>

marn06 commented 1 year ago

Hi @gawain33 I have deployed a new version 1.0.14 in which you can add loggingLevel to the config, example: "showBatteryTile": false, "loggingLevel": "INFO",

gawain33 commented 1 year ago

Hi

Thank you for that. I have updated and added "loggingLevel": "INFO" to the config. How do I get that info to you?

Gavin

On 04/05/2023, 14:13, "marn06" @.***> wrote:

Hi @gawain33https://github.com/gawain33 I have deployed a new version 1.0.14 in which you can add loggingLevel to the config, example: "showBatteryTile": false, "loggingLevel": "INFO",

— Reply to this email directly, view it on GitHubhttps://github.com/marn06/homebridge-vw/issues/3#issuecomment-1534667011, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A7EJHP6RU727ATWO2C4SSNLXEOMPJANCNFSM6AAAAAAWLQXRYU. You are receiving this because you were mentioned.Message ID: @.***>

marn06 commented 1 year ago

Hi @gawain33 It was very informative yes, I have released a new verson 1.0.15, which should solve the problem.

marn06 commented 1 year ago

Hi @gawain33 Does climatisation work for you in the We Connect phone app? It might be that you need to login here: https://identity.vwgroup.io/signin-service/v1/signin/a827267f-6cc8-4b02-a178-3205b06a6210@apps_vw-dilab_com?relayState=f419755e75e27d8b924e8121a4825baf8bbac3d8

and consent to some terms and conditions, but else than that I am not sure on the error you get: The context was invalid, deduced from the fact that there are no security requirements for the combination of service, operation and channel stored in MBB R&R.

I deleted your previous comments, as they might contain sensitive information.

gawain33 commented 1 year ago

Thanks marn06 I really appreciate you trying to help.

I checked my login there and can see the connected apps:

[A close-up of a logo Description automatically generated with low confidence]

All of the functions work fine in the We Connect App.

On 11/05/2023, 12:18, "marn06" @.***> wrote:

Hi @gawain33https://github.com/gawain33 Does climatisation work for you in the We Connect phone app? It might be that you need to login here: @.***_vw-dilab_com?relayState=f419755e75e27d8b924e8121a4825baf8bbac3d8

and consent to some terms and conditions, but else than that I am not sure on the error you get: The context was invalid, deduced from the fact that there are no security requirements for the combination of service, operation and channel stored in MBB R&R.

— Reply to this email directly, view it on GitHubhttps://github.com/marn06/homebridge-vw/issues/3#issuecomment-1543729134, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A7EJHPZHA77QZJKAOVD4MP3XFS4IJANCNFSM6AAAAAAWLQXRYU. You are receiving this because you were mentioned.Message ID: @.***>

gawain33 commented 1 year ago

I don’t know if it was logging into that site but for some reason it appears to be working now. I’ll monitor for a few days and update you.

Thank you again for the fantastic support.

On 11/05/2023, 12:24, "Gavin Crayston" @.***> wrote:

Thanks marn06 I really appreciate you trying to help.

I checked my login there and can see the connected apps:

[A close-up of a logo Description automatically generated with low confidence]

All of the functions work fine in the We Connect App.

On 11/05/2023, 12:18, "marn06" @.***> wrote:

Hi @gawain33https://github.com/gawain33 Does climatisation work for you in the We Connect phone app? It might be that you need to login here: @.***_vw-dilab_com?relayState=f419755e75e27d8b924e8121a4825baf8bbac3d8

and consent to some terms and conditions, but else than that I am not sure on the error you get: The context was invalid, deduced from the fact that there are no security requirements for the combination of service, operation and channel stored in MBB R&R.

— Reply to this email directly, view it on GitHubhttps://github.com/marn06/homebridge-vw/issues/3#issuecomment-1543729134, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A7EJHPZHA77QZJKAOVD4MP3XFS4IJANCNFSM6AAAAAAWLQXRYU. You are receiving this because you were mentioned.Message ID: @.***>

CyberChris79 commented 1 year ago

Hello @marn06 ,

thank you for your support. I also could install this plugin after your instructions, because i recieved the same error messages one after the other like @gawain33

But i still can't start this plugin. My error message is

`5/16/2023, 7:44:22 PM] [WeConnect] Python: Traceback (most recent call last): File "/usr/lib/node_modules/homebridge-vw/dist/main.py", line 7, in from car import Car File "/usr/lib/node_modules/homebridge-vw/dist/car.py", line 10, in from car_states import CarStates File "/usr/lib/node_modules/homebridge-vw/dist/car_states.py", line 1, in from typing import TypedDict ImportError: cannot import name 'TypedDict' from 'typing' (/usr/lib/python3.7/typing.py)

[5/16/2023, 7:44:22 PM] [WeConnect] Get climatisation state: Error: Traceback (most recent call last): File "/usr/lib/node_modules/homebridge-vw/dist/main.py", line 7, in from car import Car File "/usr/lib/node_modules/homebridge-vw/dist/car.py", line 10, in from car_states import CarStates File "/usr/lib/node_modules/homebridge-vw/dist/car_states.py", line 1, in from typing import TypedDict ImportError: cannot import name 'TypedDict' from 'typing' (/usr/lib/python3.7/typing.py)`

marn06 commented 1 year ago

Hi @CyberChris79 I am using a library that was introduced in Python 3.8, and you’re using Python 3.7 so the easiest would be to upgrade Python. Alternatively I could deploy a new version that installs the library if it is missing.

CyberChris79 commented 1 year ago

Hello @marn06 ,

thank you for the fast answer. I think a new version with autoinstall the library would be very helpful.

CyberChris79 commented 1 year ago

Hello @marn06 ,

i just did an upgrade from Debian 11 Buster to Debian 11 Bullseye and now i got Pyhton 3.9.2 Now after installation of this plugin, i get this error message

`Python: Traceback (most recent call last): File "/usr/lib/node_modules/homebridge-vw/dist/main.py", line 25, in

[5/17/2023, 8:35:31 AM] [WeConnect] Python: logging.FileHandler('weconnect.log'), File "/usr/lib/python3.9/logging/init.py", line 1142, in init StreamHandler.init(self, self._open()) File "/usr/lib/python3.9/logging/init.py", line 1171, in _open

[5/17/2023, 8:35:31 AM] [WeConnect] Python: return open(self.baseFilename, self.mode, encoding=self.encoding, PermissionError: [Errno 13] Permission denied: '/usr/lib/node_modules/homebridge-vw/dist/weconnect.log'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/node_modules/homebridge-vw/dist/main.py", line 43, in logger.error('Fatal Error: ' + str(e)) NameError: name 'logger' is not defined

[5/17/2023, 8:35:31 AM] [WeConnect] Get climatisation state: Error: return open(self.baseFilename, self.mode, encoding=self.encoding, PermissionError: [Errno 13] Permission denied: '/usr/lib/node_modules/homebridge-vw/dist/weconnect.log'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/node_modules/homebridge-vw/dist/main.py", line 43, in logger.error('Fatal Error: ' + str(e)) NameError: name 'logger' is not defined`

marn06 commented 1 year ago

Hi @CyberChris79 The issue is that your homebridge does not have write permission to the folder in which the log file is stored, personally I would try and uninstall the plugin and then reinstall it. If that does not work you should be able to run: sudo chmod -R 777 /usr/lib/node_modules/homebridge-vw/dist

which enables r+w and execute for all users.

CyberChris79 commented 1 year ago

Hallo @marn06 ,

thank you i could solve this by setting the permision rights.

Now i get this message

`[5/17/2023, 7:28:03 PM] [WeConnect] Python: [17/05/2023 19:28:03] [API::WARNING] Session file not found

[5/17/2023, 7:28:03 PM] [WeConnect] Python: [17/05/2023 19:28:03] [API::WARNING] Access file not found [17/05/2023 19:28:03] [API::WARNING] Forcing login

[5/17/2023, 7:28:05 PM] [WeConnect] Python: [17/05/2023 19:28:05] [API::WARNING] X-client-id not found. Requesting a new one

[5/17/2023, 7:28:05 PM] [CameraUI] camera.ui v5.0.27 is listening on port 8081 (http) [5/17/2023, 7:28:06 PM] [homebridge-vw] This plugin slows down Homebridge. The read handler for the characteristic 'On' was slow to respond! See https://homebridge.io/w/JtMGR for more info. [5/17/2023, 7:28:06 PM] [homebridge-vw] This plugin slows down Homebridge. The read handler for the characteristic 'On' was slow to respond! See https://homebridge.io/w/JtMGR for more info. [5/17/2023, 7:28:06 PM] [homebridge-vw] This plugin slows down Homebridge. The read handler for the characteristic 'Lock Current State' was slow to respond! See https://homebridge.io/w/JtMGR for more info. [5/17/2023, 7:28:06 PM] [homebridge-vw] This plugin slows down Homebridge. The read handler for the characteristic 'On' was slow to respond! See https://homebridge.io/w/JtMGR for more info. [5/17/2023, 7:28:06 PM] [homebridge-vw] This plugin slows down Homebridge. The read handler for the characteristic 'Battery Level' was slow to respond! See https://homebridge.io/w/JtMGR for more info. [5/17/2023, 7:28:06 PM] [WeConnect] Python: [17/05/2023 19:28:06] [API::CRITICAL] Raising error msg: Error 403: [climatisation.auth.forbidden] The service: rclima_v1 for VIN: XXXXXXXXXX could not be found.

[5/17/2023, 7:28:06 PM] [WeConnect] Python: [17/05/2023 19:28:06] [WeConnect::ERROR] VWError: Error 403: [climatisation.auth.forbidden] The service: rclima_v1 for VIN: XXXXXXXXXXXXX could not be found.

[5/17/2023, 7:28:06 PM] [WeConnect] Get climatisation state: Error: [17/05/2023 19:28:06] [WeConnect::ERROR] VWError: Error 403: [climatisation.auth.forbidden] The service: rclima_v1 for VIN: XXXXXXXXXXXX could not be found. `

marn06 commented 1 year ago

Hi @CyberChris79 Can you send your config for the plugin? It seems that you have defined a VIN that is XXXXXXXXXXXXX ?

CyberChris79 commented 1 year ago

Hi @marn06 ,

sure, but the XXXX is shown, because i hide my VIN number.

{ "name": "WeConnect", "climaterName": "Climatisation", "windowHeatingName": "Window Heating", "lockName": "Doors", "chargingSwitchName": "Charging", "batteryName": "Battery", "username": "xxxxxxxx", "password": "xxxxxxx", "spin": "0000", "pollInterval": 300, "temperature": 24, "combineHeating": false, "showBatteryTile": false, "loggingLevel": "WARNING", "accessory": "WeConnect" }

marn06 commented 1 year ago

Hi @CyberChris79 Makes sense.. does lock/unlock work?

CyberChris79 commented 1 year ago

i will test it tomorrow and let you know.

Thank you

CyberChris79 commented 1 year ago

Hello @marn06 ,

unlock/lock does also not work. I tried and get this error messages back

`[5/18/2023, 7:03:28 AM] [WeConnect] Python: [18/05/2023 07:03:28] [API::WARNING] Access file not found

[5/18/2023, 7:03:28 AM] [WeConnect] Python: [18/05/2023 07:03:28] [API::WARNING] Forcing login

[5/18/2023, 7:03:29 AM] [WeConnect] Python: [18/05/2023 07:03:29] [API::WARNING] X-client-id not found. Requesting a new one

[5/18/2023, 7:03:30 AM] [WeConnect] Python: [18/05/2023 07:03:30] [API::CRITICAL] Raising error msg: Error 404: [mbbc.vds.sopCalculationFailed] Could not calculate the SOP for vin=xxxxxxxxxx

[5/18/2023, 7:03:30 AM] [WeConnect] Python: [18/05/2023 07:03:30] [WeConnect::ERROR] VWError: Error 404: [mbbc.vds.sopCalculationFailed] Could not calculate the SOP for vin=xxxxxxxxxx

[5/18/2023, 7:03:30 AM] [WeConnect] Get climatisation state: Error: [18/05/2023 07:03:30] [WeConnect::ERROR] VWError: Error 404: [mbbc.vds.sopCalculationFailed] Could not calculate the SOP for vin=xxxxxxxxxx

[5/18/2023, 7:03:42 AM] [WeConnect] Python: [18/05/2023 07:03:42] [API::WARNING] Access file not found [18/05/2023 07:03:42] [API::WARNING] Forcing login

[5/18/2023, 7:03:44 AM] [WeConnect] Python: [18/05/2023 07:03:44] [API::WARNING] X-client-id not found. Requesting a new one

[5/18/2023, 7:03:45 AM] [WeConnect] Python: [18/05/2023 07:03:45] [API::CRITICAL] Raising error msg: Error 404: [mbbc.vds.sopCalculationFailed] Could not calculate the SOP for vin=xxxxxxxxxx [18/05/2023 07:03:45] [WeConnect::ERROR] VWError: Error 404: [mbbc.vds.sopCalculationFailed] Could not calculate the SOP for vin=xxxxxxxxxx

[5/18/2023, 7:03:45 AM] [WeConnect] Set climatisation state Error: [18/05/2023 07:03:45] [API::CRITICAL] Raising error msg: Error 404: [mbbc.vds.sopCalculationFailed] Could not calculate the SOP for vin=xxxxxxxxxx [18/05/2023 07:03:45] [WeConnect::ERROR] VWError: Error 404: [mbbc.vds.sopCalculationFailed] Could not calculate the SOP for vin=xxxxxxxxxx

[5/18/2023, 7:03:48 AM] [WeConnect] Python: [18/05/2023 07:03:48] [API::WARNING] Access file not found

[5/18/2023, 7:03:48 AM] [WeConnect] Python: [18/05/2023 07:03:48] [API::WARNING] Forcing login

[5/18/2023, 7:03:50 AM] [WeConnect] Python: [18/05/2023 07:03:50] [API::WARNING] X-client-id not found. Requesting a new one

[5/18/2023, 7:03:51 AM] [WeConnect] Python: [18/05/2023 07:03:51] [API::CRITICAL] Raising error msg: Error 404: [mbbc.vds.sopCalculationFailed] Could not calculate the SOP for vin=xxxxxxxxxx [18/05/2023 07:03:51] [WeConnect::ERROR] VWError: Error 404: [mbbc.vds.sopCalculationFailed] Could not calculate the SOP for vin=xxxxxxxxxx

[5/18/2023, 7:03:51 AM] [WeConnect] Set charging state Error: [18/05/2023 07:03:51] [API::CRITICAL] Raising error msg: Error 404: [mbbc.vds.sopCalculationFailed] Could not calculate the SOP for vin=xxxxxxxxxx [18/05/2023 07:03:51] [WeConnect::ERROR] VWError: Error 404: [mbbc.vds.sopCalculationFailed] Could not calculate the SOP for vin=xxxxxxxxxx

[5/18/2023, 7:03:55 AM] [WeConnect] Python: [18/05/2023 07:03:55] [API::WARNING] Access file not found [18/05/2023 07:03:55] [API::WARNING] Forcing login

[5/18/2023, 7:03:56 AM] [WeConnect] Python: [18/05/2023 07:03:56] [API::WARNING] X-client-id not found. Requesting a new one

[5/18/2023, 7:03:57 AM] [WeConnect] Python: [18/05/2023 07:03:57] [API::CRITICAL] Raising error msg: Error 404: [mbbc.vds.sopCalculationFailed] Could not calculate the SOP for vin=xxxxxxxxxx

[5/18/2023, 7:03:57 AM] [WeConnect] Python: [18/05/2023 07:03:57] [WeConnect::ERROR] VWError: Error 404: [mbbc.vds.sopCalculationFailed] Could not calculate the SOP for vin=xxxxxxxxxx

[5/18/2023, 7:03:57 AM] [WeConnect] Set locked state: [18/05/2023 07:03:57] [WeConnect::ERROR] VWError: Error 404: [mbbc.vds.sopCalculationFailed] Could not calculate the SOP for vin=xxxxxxxxxx

[5/18/2023, 7:04:00 AM] [WeConnect] Python: [18/05/2023 07:04:00] [API::WARNING] Access file not found

[5/18/2023, 7:04:00 AM] [WeConnect] Python: [18/05/2023 07:04:00] [API::WARNING] Forcing login

[5/18/2023, 7:04:02 AM] [WeConnect] Python: [18/05/2023 07:04:02] [API::WARNING] X-client-id not found. Requesting a new one

[5/18/2023, 7:04:03 AM] [WeConnect] Python: [18/05/2023 07:04:03] [API::CRITICAL] Raising error msg: Error 404: [mbbc.vds.sopCalculationFailed] Could not calculate the SOP for vin=xxxxxxxxxx

[5/18/2023, 7:04:03 AM] [WeConnect] Python: [18/05/2023 07:04:03] [WeConnect::ERROR] VWError: Error 404: [mbbc.vds.sopCalculationFailed] Could not calculate the SOP for vin=xxxxxxxxxx

[5/18/2023, 7:04:03 AM] [WeConnect] Set window heating state Error: [18/05/2023 07:04:03] [WeConnect::ERROR] VWError: Error 404: [mbbc.vds.sopCalculationFailed] Could not calculate the SOP for vin=xxxxxxxxxx `

marn06 commented 1 year ago

Hi @CyberChris79 it is strange that it keeps saying that access file is not found, can you check the dist folder and see if it contains a weconnectAPI.access file? Path should be /var/lib/homebridge/node_modules/homebridge-vw/dist if it doesn’t it might be permissions issue again, you Can check by creating a file manually at the location from the homebridge terminal

CyberChris79 commented 1 year ago

Hello @marn06 ,

ok, now it's more clear. My node_module path is under /usr/lib/node_modules/ and not under /var/lib/homebridge/node_modules/ I really don't know why, but all plugins are located there. That's why the file doesn't exist.

marn06 commented 1 year ago

Hi @CyberChris79 Eventhough your path is different it should still create the file there, but if the file does not exist in your path then I would guess that the homebridge user is missing permissions to write to the path. Try creating a file in your path using the homebridge terminal.

CyberChris79 commented 1 year ago

Hello @marn06 ,

i have created the folder and file manually and gave the whole folder "777" rights, The owner of this folder is "root" and the homebridge user is called "homebridge". Is this maybe also imortant. Because it still show the error message "Access File not found"

marn06 commented 1 year ago

Hi @CyberChris79 I would suggest that you open terminal from homebridge and run: touch /usr/lib/node_modules/homebridge-vw/dist/test.access to test if you get permission denied.

CyberChris79 commented 1 year ago

Hello @marn06 ,

that works for me.

image

image

marn06 commented 1 year ago

Hi @CyberChris79 So permission is not the issue and I also see it has created the session file. Can you change loggingLevel to INFO and restart homebridge? Hopefully the info logs tells something useful.

marn06 commented 1 year ago

Hi @CyberChris79 Based on the fact that your config does not have a VIN I assume that the plugin retrieved the VIN from the API. Try and delete the carStates.json which contains the VIN and then restart the plugin. You should see the following in the log with logLevel INFO:

[5/21/2023, 11:32:10 AM] [VW Passat] Python: [21/05/2023 11:32:10] [API::INFO] Sending GET request to https://customer-profile.apps.emea.vwapps.io/v1/customers/XXX/realCarData

[5/21/2023, 11:32:10 AM] [VW Passat] Python: [21/05/2023 11:32:10] [API::INFO] Response with code: 200

[5/21/2023, 11:32:10 AM] [VW Passat] Python: [21/05/2023 11:32:10] [WeConnect::INFO] VIN: XXX

CyberChris79 commented 1 year ago

Hello @marn06 ,

but i am using my VIN number in the config file. It is not empty. I just replaced it to xxxxxxx before i post it here. In my config the VIN filed is not empy I tried the config also without a VIN number and deletet also the carSatest,json, but i never get back this log information you posted.

Sorry about that.

marn06 commented 1 year ago

Hi @CyberChris79 That is okay, but I think you should try and remove it from the config and have the plugin fetch the VIN because the only reason I can come up with based on your responses is that your VIN is incorrect. If the plugin will not return a VIN it will never work, because it would mean that no cars are registered to your account. Can you show a log with logLevel INFO after deleting carStates.json and removing VIN from config?

marn06 commented 1 year ago

Hi @CyberChris79 Based on your last post I Think you should try to login here, and see if it resolves anything. https://identity.vwgroup.io/signin-service/v1/signin/a827267f-6cc8-4b02-a178-3205b06a6210@apps_vw-dilab_com?relayState=f419755e75e27d8b924e8121a4825baf8bbac3d8

CyberChris79 commented 1 year ago

Hello @marn06 ,

i tried this already without success, because so posted the link here 2 weeks ago https://github.com/marn06/homebridge-vw/issues/3#issuecomment-1543729134

Does your plugin works for diesel models? I just want to make sure that this is not just for electrics cars

marn06 commented 1 year ago

Hi @CyberChris79 No idea unfortunately, but are you able to turn on climatisation from the native weconnect app from vw?

CyberChris79 commented 1 year ago

Hello @marn06 ,

yes, i can cool down or heat the car with the WeConnect App. Also i can unlock/lock the car.

marn06 commented 1 year ago

Hi @CyberChris79 What does the log show when trying to lock the car?

marn06 commented 1 year ago

Hi @CyberChris79 The thing you said about diesel just made me remember that the plug-in sets heating source to Electric with climatisation. So maybe it works to heat with one of the other Methods in NativeAPI.py. But it would be interesting to see the response from lock/unlock, since that should not be related to the diesel part.

marn06 commented 1 year ago

Hi @CyberChris79 It actually makes sense because I get status of everything when either accessory state is requested to prevent multiple requests. So it Will always try to get the climatisation State and fail. Try and comment the self.setClimatisationStatus in the car.py file, and maybe you need to restart homebridge.

image

marn06 commented 1 year ago

Hi @CyberChris79 And now the issue is getting charger status because your car is a diesel, which I could have said myself ofc. So you also need to comment the setChargingStatus