rudyberends / homebridge-loxone-proxy

Homebridge Dynamic Platform Plugin which exposes a Loxone System to Homekit
Apache License 2.0
12 stars 6 forks source link

Multiple errors #54

Closed supajo closed 10 months ago

supajo commented 10 months ago

Hello, i installed a few days ago the plugin into homebridge and got following error at starting the plugin:

TypeError: Cannot read properties of undefined (reading 'alertImage') at Intercom.configureCamera (/usr/lib/node_modules/homebridge-loxone-proxy/src/loxone/items/Intercom.ts:35:26) at processTicksAndRejections (node:internal/process/task_queues:95:5) at runNextTicks (node:internal/process/task_queues:64:3) at processImmediate (node:internal/timers:447:9)

In the end, the solution was renaming the Intercom.ts file in the pluginfolder so it dont get loaded and luckily the plugin could start. Maybe its a problem because i have no intercom?

The second problem regarding to the log is the following: But here i cant guess whats the problem or if it is any problem at all :)

SyntaxError: Unexpected identifier at new Function () at LightControllerV2.LoxoneAccessory.callBack (/usr/lib/node_modules/homebridge-loxone-proxy/src/LoxoneAccessory.ts:91:29) at /usr/lib/node_modules/homebridge-loxone-proxy/src/loxone/LoxoneHandler.ts:69:56 at Array.forEach () at handleAnyEvent (/usr/lib/node_modules/homebridge-loxone-proxy/src/loxone/LoxoneHandler.ts:69:36) at Object.socketOnEventReceived (/usr/lib/node_modules/homebridge-loxone-proxy/src/loxone/LoxoneHandler.ts:99:17) at WebSocket._handleBinaryEvent (/usr/lib/node_modules/homebridge-loxone-proxy/node_modules/lxcommunicator/modules/WebSocket.js:934:78) at WebSocket._binaryMessageHandler (/usr/lib/node_modules/homebridge-loxone-proxy/node_modules/lxcommunicator/modules/WebSocket.js:773:26) at W3CWebSocket.onmessage (/usr/lib/node_modules/homebridge-loxone-proxy/node_modules/lxcommunicator/vendor/WebSocketWrapper.js:107:62) at W3CWebSocket._dispatchEvent [as dispatchEvent] (/usr/lib/node_modules/homebridge-loxone-proxy/node_modules/yaeti/lib/EventTarget.js:107:17) todo: colortemp(100,4775) todo: colortemp(100,4775) todo: colortemp(100,4775)

sv-ochis commented 10 months ago

I have also lots of errors at the similar location

at LightControllerV2.LoxoneAccessory.callBack (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/src/LoxoneAccessory.ts:92:21)
TypeError: Cannot read properties of undefined (reading 'updateService')
rudyberends commented 10 months ago

TypeError: Cannot read properties of undefined (reading 'alertImage') at Intercom.configureCamera (/usr/lib/node_modules/homebridge-loxone-proxy/src/loxone/items/Intercom.ts:35:26) at processTicksAndRejections (node:internal/process/task_queues:95:5) at runNextTicks (node:internal/process/task_queues:64:3) at processImmediate (node:internal/timers:447:9)

In the end, the solution was renaming the Intercom.ts file in the pluginfolder so it dont get loaded and luckily the plugin could start. Maybe its a problem because i have no intercom?

This is a strange error. It should not do this if you do not have an Intercom configured.

The Proxy fetches the Loxone structure file from the miniserver. This file is located at http://miniserverIP/data/loxapp3.json. It then tries to parse every entry in the "controls" section of the structure file. IF (and this should not happen with your miniserver) it finds an item with type "Intercom" or "IntercomV2" it tries to create an homekit Intercom accessory based on that item.

Are you sure there are no entries of type "intercom" or "intercomv2" in your structure file?

supajo commented 10 months ago

I searched in the loxapp3.json File but there was no entry for Intercom / IntercomV2 also I searched in the Loxone Config too but i could not find anything regarding Intercom. Is there more i can do here to help?

rudyberends commented 10 months ago

The other error messages are solved in the latest release

rudyberends commented 10 months ago

I searched in the loxapp3.json File but there was no entry for Intercom / IntercomV2 also I searched in the Loxone Config too but i could not find anything regarding Intercom. Is there more i can do here to help?

If you run HomeBridge in debug mode, the proxy will also log debug messages. If you try the latest release with the intercom.ts file untouched and you start/restart homebridge, perhaps we can find the issue in the logs.

supajo commented 10 months ago

Here is the homebridge.log interesstingly, i get the error now only one time and then it restarts but keeps running. homebridge.log.txt

A few hours ago, i re-addet a virtual output to sonos for my Bell (Door Controller) maybee this could have changed something...?

The other errors i dont see anymore with the new 1.5.1 Version - thank you

rudyberends commented 10 months ago

This is in your log;

[19/12/2023, 22:23:50] [LoxonePlatform] [IntercomItem] Restoring accessory from cache: Klingel [19/12/2023, 22:23:50] [LoxonePlatform] [Klingel] Register Listeners for IntercomItem

The door controller you are mentioning is an Intercom Item. So this is why it is happening. I added an Intercom item without a camera to my config and I was able to reproduce te issue.

There is a new beta version (v1.6.0-beta.2) available that solves the issue. It skips the camera config and configures the intercom. This will probably give you a doorbell via homekit, although HomeKit does not support doorbells without camera anymore.

Could you test this new functionality. I know it doesn't crash anymore, but I am curious if the doorbell works. If it doesn't we can also make the proxy skip the entire Item when a camera isn't found.

supajo commented 10 months ago

Ah thank you, did not know that this is an Intercom Type item. And upfront thank you for your fast responses. I see now a Doorbell in my Home App but as you mentioned it above, there is a new Item in the App but with the note „Not supported“. If i press the bell button there happens sadly nothing.

rudyberends commented 10 months ago

This does seem to work for my test setup. It should also work for you, as long as you have the doorbell input connected to the "Bell" input of the Door Controller.

supajo commented 10 months ago

This does seem to work for my test setup. It should also work for you, as long as you have the doorbell input connected to the "Bell" input of the Door Controller.

That's actually exactly the setup that i have. Tried it earlier again but there happens nothing in the Home App.

PS: Is it to be expected, if you have in loxone 2 outputs (seperate lights) and you put them into a group in the Home app, that there is a noticable delay between output 1 and output 2 ?

rudyberends commented 10 months ago

Since it is not actually supported in HomeBridge i will leave the code as it is now. If you want to exclude it in your setup, you can add "Intercom" as an excluded ItemType in the newest release. This will prevent the intercom from being mapped in HomeKit.

The delay in grouped outputs is to be expected. This is not something we can handle in the plugin. It's just how HomeKite behaves with these grouped outputs.

I will close this SR. Please let me now if you have any further requests for enhancement.