hannseman / homebridge-mi-hygrothermograph

Homebridge plugin for the Xiaomi Mi Bluetooth Temperature and Humidity Sensor
MIT License
264 stars 52 forks source link

Plugin won't load after homebridge and node update #187

Closed KoCMoHaBTa closed 1 year ago

KoCMoHaBTa commented 1 year ago

Since I updated homebridge and node to the latest versions, the plugin does not load anymore

Expected Behavior

The plugin to load and work

Current Behavior

The plugin does not load

Steps to Reproduce (for bugs)

Update to the latest homebridge and node version

Versions

Homebridge Log / Command Output

ERROR INITIALIZING PLUGIN homebridge-mi-hygrothermograph:
[12/11/2022, 09:37:19] Error: The module '/usr/local/lib/node_modules/homebridge-mi-hygrothermograph/node_modules/@abandonware/bluetooth-hci-socket/lib/binding/bluetooth_hci_socket.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 93. This version of Node.js requires
NODE_MODULE_VERSION 108. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at Object.Module._extensions..node (node:internal/modules/cjs/loader:1243:18)
    at Module.load (node:internal/modules/cjs/loader:1037:32)
    at Function.Module._load (node:internal/modules/cjs/loader:878:12)
    at Module.require (node:internal/modules/cjs/loader:1061:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/homebridge-mi-hygrothermograph/node_modules/@abandonware/bluetooth-hci-socket/lib/native.js:6:15)
    at Module._compile (node:internal/modules/cjs/loader:1159:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
    at Module.load (node:internal/modules/cjs/loader:1037:32)
    at Function.Module._load (node:internal/modules/cjs/loader:878:12)
[12/11/2022, 09:37:19] ====================
kikher commented 1 year ago

I have the same problem, I have updated everything in a raspberry 4 and now the temperatures and humidity show a value of 0 in homebridge and in homekit it indicates that the accessory does not respond. I uninstalled the plugin and reinstalled it and it didn't work either.

Lyliya commented 1 year ago

I got the same issue, you need to uninstall the plugin and reinstall it, to compile it with the good version of node (Homebridge switched to node v18 if you are using docker) After that, it should work as expected

KoCMoHaBTa commented 1 year ago

After reinstalling the plugin - I've got it working. There were some errors during the install process, but didn't manage to copy them, because the install dialog disappeared immediately after completion. For now it seems to work as expected. The only inconvenience with reinstalling the plugin is that you have to reassign the rooms and recreate the automations, because they disappeared.