vniehues / homebridge-linak

Apache License 2.0
18 stars 2 forks source link

Command after variable height update not working anymore #4

Closed Pob4acke closed 2 years ago

Pob4acke commented 2 years ago

Describe The Bug: On restart of Homebridge Idasen-controller is not working anymore. Even so the values for base-height and movement-range are entered in the web interface of Homebridge, the log shows, that they are undefined. (I will not try to check for movement, as I'm not home atm) Linak-controller is updated to latest version.

To Reproduce: On every restart restart of Homebridge.

Logs: [Linak Platform for Ikea Idasen] polling error: Error: Command failed: /home/pi/.local/bin/idasen-controller --mac-address C0:86:F6:2B:99:3C --base-height undefined --movement-range undefined usage: idasen-controller [-h] [--mac-address MAC_ADDRESS] [--base-height BASE_HEIGHT] [--movement-range MOVEMENT_RANGE] [--stand-height STAND_HEIGHT] [--sit-height SIT_HEIGHT] [--stand-height-offset STAND_HEIGHT_OFFSET] [--sit-height-offset SIT_HEIGHT_OFFSET] [--height-tolerance HEIGHT_TOLERANCE] [--adapter ADAPTER_NAME] [--scan-timeout SCAN_TIMEOUT] [--connection-timeout CONNECTION_TIMEOUT] [--movement-timeout MOVEMENT_TIMEOUT] [--forward] [--server-address SERVER_ADDRESS] [--server_port SERVER_PORT] [--config CONFIG] [--sit | --stand | --monitor | --move-to MOVE_TO | --scan | --server] idasen-controller: error: argument --base-height: invalid int value: 'undefined'

at ChildProcess.exithandler (node:child_process:397:12)
at ChildProcess.emit (node:events:390:28)
at maybeClose (node:internal/child_process:1064:16)
at Socket.<anonymous> (node:internal/child_process:450:11)
at Socket.emit (node:events:390:28)
at Pipe.<anonymous> (node:net:687:12) {

killed: false, code: 2, signal: null, cmd: '/home/pi/.local/bin/idasen-controller --mac-address C0:86:F6:2B:99:3C --base-height undefined --movement-range undefined' }

Plugin Config: { "name": "Linak Platform", "pollingRate": 300, "idasenControllerPath": "/home/pi/.local/bin/idasen-controller", "desks": [ { "name": "Schreibttisch", "macAddress": "C0:86:F6:2B:99:3C", "baseHeight": 620, "movementRange": 650 } ], "platform": "LinakController" }

vniehues commented 2 years ago

Hey again :) Thanks for your report! Can you add the plugin version you're using?

Another thing to note is that because these properties were added with an update, your homebridge probably still has them cached without these properties. You could try to remove them from the cache (config ui -> homebridge settings -> scroll down and select remove device from cache -> delete the desk). But please be aware that this will likely remove the device from your HomeKit scenes as well.

I'll look for a better way to handle the cached devices :)

vniehues commented 2 years ago

The above still stands but this should be fixed in v1.1.1 Please report back if you still face these issues :)

Pob4acke commented 2 years ago

I was already using 1.1.0 from your plugin and Idasen-controller 1.0.8.

But works like a charm now! I guess what your fix now does is to reinitiate the accessories on every restart of Homebridge. So even without deleting the desk, everything seems to work now. Thanks!

vniehues commented 2 years ago

I don't want to take the credit for it though. It was literally commenting in 2 lines that the example plugin had written as a comment haha