gormanb / homebridge-hivehome-control

Homebridge plugin to expose Hive Home features that are not natively available in Homekit; currently, this includes Hot Water and Heating Boost functions.
Apache License 2.0
1 stars 0 forks source link

Cannot activate Hive plugin on Homebridge #4

Closed Mercifull closed 1 week ago

Mercifull commented 2 weeks ago

EDIT:

I have attempted several fixes since making this original post, including removing all other plugins. My new current issue is the plugin failing to load see this post https://github.com/gormanb/homebridge-hivehome-control/issues/4#issuecomment-2456626275

ORIGINAL POST:

Describe Your Problem: I am running Homebridge v1.8.5 on a Raspberry Pi. I have installed the homebridge-hivehome-control plugin using the Plugins interface. I have run the command npx homebridge-hivehome-control in terminal. Instead of being prompted for credentials I get this output:

[ Python Error Call to 'python' failed:

const pyhiveapi = await python('pyhiveapi');

at async file:///var/lib/homebridge/node_modules/homebridge-hivehome-control/bin/hive2fa.mjs:25:19

... across the bridge ...

return _bootstrap._gcd_import(name[level:], package, level)

at import_module (/usr/lib/python3.11/importlib/init.py:126)

at _gcd_import (:1206)

at _find_and_load (:1178)

at _find_and_load_unlocked (:1142)

ModuleNotFoundError: No module named 'pyhiveapi']

Logs:

[03/11/2024, 23:04:30] Loaded plugin: homebridge-hivehome-control@1.0.3 [03/11/2024, 23:04:30] Registering platform 'homebridge-hivehome-control.HiveHomeController' [03/11/2024, 23:04:30] --- [03/11/2024, 23:04:33] Loaded plugin: @0x5e/homebridge-tuya-platform@1.7.0-beta.54 [03/11/2024, 23:04:33] Registering platform '@0x5e/homebridge-tuya-platform.TuyaPlatform' [03/11/2024, 23:04:33] --- [03/11/2024, 23:04:33] Loading 3 platforms... [03/11/2024, 23:04:33] Ignoring config for the platform "Govee" in your config.json as the plugin "homebridge-govee" has been disabled. [03/11/2024, 23:04:33] [HiveHomeController] Initializing HiveHomeController platform... [03/11/2024, 23:04:33] [HiveHomeController] Plugin suspended. Invalid configuration: [ 'No Hive username specified', 'No Hive password specified', 'No Hive Device Group Key specified', 'No Hive Device Key specified', 'No Hive Device Password specified' ] Setup Payload: X-HM://xxxxxxxxxxxx Enter this code with your HomeKit app on your iOS device to pair with Homebridge:

┌────────────┐     
│ xxxxxxxxxxx │     
└────────────┘     

[03/11/2024, 23:04:33] Homebridge v1.8.5 (HAP v0.12.3) (Homebridge B0D2) is running on port 51127. [03/11/2024, 23:04:33]

NOTICE TO USERS AND PLUGIN DEVELOPERS

Homebridge 2.0 is on the way and brings some breaking changes to existing plugins. Please visit the following link to learn more about the changes and how to prepare: https://github.com/homebridge/homebridge/wiki/Updating-To-Homebridge-v2.0

[03/11/2024, 23:06:16] [Homebridge UI] Starting terminal session [03/11/2024, 23:11:35] [Homebridge UI] Terminal session ended.

Plugin Config:

{ "bridge": { "name": "Homebridge B0D2", "username": "xxxxxxxx", "port": 51127, "pin": "xxxxxxxxxxx", "advertiser": "avahi" }, "accessories": [], "platforms": [ { "name": "Config", "port": 8581, "platform": "config", "theme": "deep-purple" }, { "name": "Govee", "username": "matt@simsmail.co.uk", "password": " xxxxxxxxxxxx", "platform": "Govee" }, { "hotWaterBoostMins": 60, "heatingBoostMins": 60, "heatingBoostTemp": 21, "enableDebugLog": false, "platform": "HiveHomeController" } ], "disabledPlugins": [ "homebridge-govee" ] }

Screenshots:

Screenshot 2024-11-03 at 23 07 10

Environment:

Mercifull commented 2 weeks ago

I just updated to node 22.11.0.

Confirmed python 3 and pip3 installed. pi@homebridge:/var/lib/homebridge $ pip3 --version pip 23.0.1 from /usr/lib/python3/dist-packages/pip (python 3.11)

Mercifull commented 2 weeks ago

Did a full install and its getting a little further in now.

Ceasing at: ImportError: libxslt.so.1: cannot open shared object file: No such file or directory]

Mercifull commented 1 week ago

I ran the following in terminal to attempt to fix the issue.

sudo apt-get update
sudo apt-get install -y libxslt1-dev

This allowed the command npx homebridge-hivehome-control to finally run whereby I was able to add in my login/password to get access to the device information required to populate the plugin settings.

However, now if I enable the plugin my Homebridge status changed to 'Not running' shortly after a restart. The following is presented in the log.

** Error in exception handler ** Error: ENOENT: no such file or directory, open '/var/lib/homebridge/node_modules/homebridge-hivehome-control/src/hivehome/hive-helpers.ts'
    at Object.readFileSync (node:fs:441:20)
    at processJSStacktrace (/var/lib/homebridge/node_modules/homebridge-hivehome-control/node_modules/pythonia/src/pythonia/errors.js:68:25)
    at Object.getErrorMessage (/var/lib/homebridge/node_modules/homebridge-hivehome-control/node_modules/pythonia/src/pythonia/errors.js:83:24)
    at new PythonException (/var/lib/homebridge/node_modules/homebridge-hivehome-control/node_modules/pythonia/src/pythonia/Bridge.js:21:25)
    at Bridge.call (/var/lib/homebridge/node_modules/homebridge-hivehome-control/node_modules/pythonia/src/pythonia/Bridge.js:251:37)
    at processTicksAndRejections (node:internal/process/task_queues:105:5)
    at startHiveSession (/var/lib/homebridge/node_modules/homebridge-hivehome-control/src/hivehome/hive-helpers.ts:38:17)
    at HiveHomeControllerPlatform.discoverDevices (/var/lib/homebridge/node_modules/homebridge-hivehome-control/src/platform.ts:111:25) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/var/lib/homebridge/node_modules/homebridge-hivehome-control/src/hivehome/hive-helpers.ts'
}
** JavaScript Stacktrace **
    at Bridge.call (/var/lib/homebridge/node_modules/homebridge-hivehome-control/node_modules/pythonia/src/pythonia/Bridge.js:251:37)
    at processTicksAndRejections (node:internal/process/task_queues:105:5)
    at startHiveSession (/var/lib/homebridge/node_modules/homebridge-hivehome-control/src/hivehome/hive-helpers.ts:38:17)
    at HiveHomeControllerPlatform.discoverDevices (/var/lib/homebridge/node_modules/homebridge-hivehome-control/src/platform.ts:111:25)
** Python Stacktrace **
Traceback (most recent call last):
  File "/var/lib/homebridge/node_modules/homebridge-hivehome-control/node_modules/pythonia/src/pythonia/Bridge.py", line 365, in onMessage
    return getattr(self, action)(r, ffid, key, args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/lib/homebridge/node_modules/homebridge-hivehome-control/node_modules/pythonia/src/pythonia/Bridge.py", line 338, in pcall
    self.call(r, ffid, key, pargs, kwargs or {})
  File "/var/lib/homebridge/node_modules/homebridge-hivehome-control/node_modules/pythonia/src/pythonia/Bridge.py", line 198, in call
    v = v(*args, **kwargs)
        ^^^^^^^^^^^^^^^^^^
  File "/var/lib/homebridge/node_modules/homebridge-hivehome-control/pylib/pyhiveapi/session.py", line 239, in login
    if "AuthenticationResult" in result:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'NoneType' is not iterable

[05/11/2024, 09:09:41] Got SIGTERM, shutting down Homebridge...

System attempts to restart and it just does this in a loop until I disable the plugin and restart Homebridge.

Mercifull commented 1 week ago

Looks like I was using a lowercase l instead if a 1 in the device ID. I changed this and now it appears to be working. So I suppose this issue is now resolved… although it would have been nicer to have had an error message that explained it better.