Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loxone Intercome XL support #19

Closed
rudyberends opened this issue Aug 6, 2023 · 38 comments
Closed

Loxone Intercome XL support #19

rudyberends opened this issue Aug 6, 2023 · 38 comments
Labels
enhancement New feature or request

Comments

@rudyberends
Copy link
Owner

Discussed in https://github.com/rudyberends/homebridge-loxone-proxy/discussions/18

Originally posted by 350d August 6, 2023
Hello! Will it support Loxone Intercome XL (camera + doorbell)?
I can help with tests if needed. Thanks!
loxone-intercom-xl

@rudyberends rudyberends added the enhancement New feature or request label Aug 6, 2023
@rudyberends
Copy link
Owner Author

Would you be able to share your Intercom entry from the structure file?

@350d
Copy link
Contributor

350d commented Aug 6, 2023

How to do that? Install the plugin, set login/pass and then what?

@rudyberends
Copy link
Owner Author

You can download the structure file using a webbrowser by using the following url (change the ip to match your miniserver);
http://192.168.1.200/data/LoxAPP3.json. You will need your Loxone credentials.

There should be a "type: Intercom" entry. You might need an editor that formats the json to properly read it. The plugin uses this info to map it to a HomeBridge accessory.

If you could share this intercom entry it would be very helpful.

@350d
Copy link
Contributor

350d commented Aug 6, 2023

"13a66236-0173-1b1c-ffffeab7a19e67ff": {
    "name": "Intercom",
    "type": "Intercom",
    "uuidAction": "13a66236-0173-1b1c-ffffeab7a19e67ff",
    "room": "13a6623e-0195-2031-ffffc1fe7adce52a",
    "cat": "13a6626c-0155-2f75-ffffc1fe7adce52a",
    "defaultRating": 1,
    "isFavorite": true,
    "isSecured": false,
    "restrictions": 0,
    "securedDetails": true,
    "details": {
        "jLockable": true,
        "deviceType": 1,
        "lastBellEventImages": true,
        "videoInfo": {},
        "audioInfo": {},
        "showBellImage": false,
        "outputs": [
            {
                "id": 0,
                "name": "Ava uks"
            },
            {
                "id": 1,
                "name": "Output 2"
            },
            {
                "id": 2,
                "name": "Output 3"
            }
        ]
    },
    "states": {
        "jLocked": "93a66236-0173-1b16-ffffd285cd00b460",
        "bell": "13a66236-0173-1b18-ffffd285cd00b460",
        "lastBellEvents": "1b59ac58-0065-7bd9-ffffeab7a19e67ff",
        "lastBellTimestamp": "1b59ac58-0065-7bdb-ffffeab7a19e67ff",
        "version": "1b59ac58-0065-7bda-ffffeab7a19e67ff"
    },
    "subControls": {
        "13a66236-0173-1b1c-ffffeab7a19e67ff/1": {
            "name": "Ava uks",
            "type": "Pushbutton",
            "uuidAction": "13a66236-0173-1b1c-ffffeab7a19e67ff/1",
            "defaultRating": 0,
            "isFavorite": false,
            "isSecured": false,
            "restrictions": 0,
            "states": {
                "active": "13a66236-0173-1b19-ffffd285cd00b460"
            }
        }
    }
}

@rudyberends rudyberends linked a pull request Aug 6, 2023 that will close this issue
@rudyberends
Copy link
Owner Author

So, basic layout of this item is the same as the Intercomv2 item.

I have added basic support for this item in the latest beta. It should give you the doorbell and the pushbutton (Ava uks) associated to the intercom.

However, the intercomv2 has an additional state called "address". Subscribing to this state will give you the ip address of the intercom, which can be used to access the webcam. I do not see how we are able to resolve this webcam ip on the v1 item. Do you see any other item in the structure file containing the webcam ip? I will also check the documentation for this.

As a workaround we could make a configuration option in the plugin where you specify the webcam url for a v1 item.

@350d
Copy link
Contributor

350d commented Aug 6, 2023

@rudyberends I've checked JSON again and there is no any IP/url/port related to camera video stream available unfortunately. I have internal ip and external video IP/address in config app and mobile apps.

@350d
Copy link
Contributor

350d commented Aug 6, 2023

Another issue i guess will be about camera streaming format - i have only mjpeg feed at a moment and i dont known about any h264 streams out of this intercom. Ive managed to view it via ffmpeg camera plugin in homebridge with this source/command:

-use_wallclock_as_timestamps 1 -i http://10.6.254.10/mjpg/video.mjpg?login=logintokenhere

Snapshot jpeg available via http://10.6.254.10/jpg/image.jpg?login=logintokenhere

@rudyberends
Copy link
Owner Author

rudyberends commented Aug 6, 2023

mjpeg feed should be fine.

Could you check the output of the following url?
http://192.168.1.200/jdev/sps/io/13a66236-0173-1b1c-ffffeab7a19e67ff/securedDetails

Change the ip to match your miniserver. Note that the uuid is from your intercom item.
Could you give me the output of this url? There might be some credentials you want to mask. The main thing is if we can discover the internal video url.

@350d
Copy link
Contributor

350d commented Aug 6, 2023

{
  "LL": {
    "control": "dev/sps/io/13a66236-0173-1b1c-ffffeab7a19e67ff/securedDetails",
    "value": "{
      \"videoInfo\": {
        \"alertImage\": \"http://10.6.254.10/jpg/image.jpg\",
        \"streamUrl\": \"http://remoreipwashere:58925/mjpg/video.mjpg?login=deleted\",
        \"deviceUuid\": \"13a66231-021c-195d-ffffc1fe7adce52a\",
        \"user\": \"viewer\",
        \"pass\": \"deleted\"
      },
      \"audioInfo\": {
        \"host\": \"sip.antisip.com\",
        \"user\": \"deleted\",
        \"pass\": \"deleted\"
      }
    }",
    "Code": "200"
  }
}

"value" contains slash encoded json

@rudyberends
Copy link
Owner Author

strange that the internal stream url is not available in this output, but at least there is enough info here to create it ourselves.

Just to make sure, if you use the following url in your browser
http://10.6.254.10/mjpg/video.mjpg?login=deleted

And you add the logintoken as displayed in the output, you get instant access to the video stream right?

@350d
Copy link
Contributor

350d commented Aug 6, 2023

Correct, instant access via this local ip and external ip too.
I guess its make sense to parse local ip from alertImage address. Its about local snapshot in my case and it local ip.

@350d
Copy link
Contributor

350d commented Aug 8, 2023

JFYI: V1 works great with HomeKit notification and switch button to unlock the door! Thank you! Looking forward to help you with V2 of this Intercom support.

@350d
Copy link
Contributor

350d commented Aug 8, 2023

Some errors in HB console:

[08/08/2023, 21:51:30] [LoxonePlatform] Connected to Miniserver
SyntaxError: Unexpected identifier
    at new Function (<anonymous>)
    at Intercom.LoxoneAccessory.callBack (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/src/LoxoneAccessory.ts:91:29)
    at /var/lib/homebridge/node_modules/homebridge-loxone-proxy/src/loxone/LoxoneHandler.ts:54:56
    at Array.forEach (<anonymous>)
    at handleAnyEvent (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/src/loxone/LoxoneHandler.ts:54:36)
    at Object.socketOnEventReceived (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/src/loxone/LoxoneHandler.ts:80:17)
    at WebSocket._handleBinaryEvent (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/node_modules/lxcommunicator/modules/WebSocket.js:934:78)
    at WebSocket._binaryMessageHandler (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/node_modules/lxcommunicator/modules/WebSocket.js:773:26)
    at W3CWebSocket.onmessage (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/node_modules/lxcommunicator/vendor/WebSocketWrapper.js:107:62)
    at W3CWebSocket._dispatchEvent [as dispatchEvent] (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/node_modules/yaeti/lib/EventTarget.js:107:17)
[08/08/2023, 16:53:30] [Homebridge UI] Changes to config.json saved.
SyntaxError: Unexpected identifier
    at new Function (<anonymous>)
    at Intercom.LoxoneAccessory.callBack (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/src/LoxoneAccessory.ts:91:29)
    at /var/lib/homebridge/node_modules/homebridge-loxone-proxy/src/loxone/LoxoneHandler.ts:54:56
    at Array.forEach (<anonymous>)
    at handleAnyEvent (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/src/loxone/LoxoneHandler.ts:54:36)
    at Object.socketOnEventReceived (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/src/loxone/LoxoneHandler.ts:80:17)
    at WebSocket._handleBinaryEvent (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/node_modules/lxcommunicator/modules/WebSocket.js:934:78)
    at WebSocket._binaryMessageHandler (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/node_modules/lxcommunicator/modules/WebSocket.js:773:26)
    at W3CWebSocket.onmessage (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/node_modules/lxcommunicator/vendor/WebSocketWrapper.js:107:62)
    at W3CWebSocket._dispatchEvent [as dispatchEvent] (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/node_modules/yaeti/lib/EventTarget.js:107:17)
SyntaxError: Unexpected identifier
    at new Function (<anonymous>)
    at Intercom.LoxoneAccessory.callBack (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/src/LoxoneAccessory.ts:91:29)
    at /var/lib/homebridge/node_modules/homebridge-loxone-proxy/src/loxone/LoxoneHandler.ts:54:56
    at Array.forEach (<anonymous>)
    at handleAnyEvent (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/src/loxone/LoxoneHandler.ts:54:36)
    at Object.socketOnEventReceived (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/src/loxone/LoxoneHandler.ts:80:17)
    at WebSocket._handleBinaryEvent (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/node_modules/lxcommunicator/modules/WebSocket.js:934:78)
    at WebSocket._binaryMessageHandler (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/node_modules/lxcommunicator/modules/WebSocket.js:773:26)
    at W3CWebSocket.onmessage (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/node_modules/lxcommunicator/vendor/WebSocketWrapper.js:107:62)
    at W3CWebSocket._dispatchEvent [as dispatchEvent] (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/node_modules/yaeti/lib/EventTarget.js:107:17)

@rudyberends
Copy link
Owner Author

rudyberends commented Aug 8, 2023

Some errors in HB console:

[08/08/2023, 16:53:30] [Homebridge UI] Changes to config.json saved.
SyntaxError: Unexpected identifier
    at new Function (<anonymous>)
    at Intercom.LoxoneAccessory.callBack (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/src/LoxoneAccessory.ts:91:29)
    at /var/lib/homebridge/node_modules/homebridge-loxone-proxy/src/loxone/LoxoneHandler.ts:54:56
    at Array.forEach (<anonymous>)
    at handleAnyEvent (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/src/loxone/LoxoneHandler.ts:54:36)
    at Object.socketOnEventReceived (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/src/loxone/LoxoneHandler.ts:80:17)
    at WebSocket._handleBinaryEvent (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/node_modules/lxcommunicator/modules/WebSocket.js:934:78)
    at WebSocket._binaryMessageHandler (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/node_modules/lxcommunicator/modules/WebSocket.js:773:26)
    at W3CWebSocket.onmessage (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/node_modules/lxcommunicator/vendor/WebSocketWrapper.js:107:62)
    at W3CWebSocket._dispatchEvent [as dispatchEvent] (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/node_modules/yaeti/lib/EventTarget.js:107:17)
SyntaxError: Unexpected identifier
    at new Function (<anonymous>)
    at Intercom.LoxoneAccessory.callBack (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/src/LoxoneAccessory.ts:91:29)
    at /var/lib/homebridge/node_modules/homebridge-loxone-proxy/src/loxone/LoxoneHandler.ts:54:56
    at Array.forEach (<anonymous>)
    at handleAnyEvent (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/src/loxone/LoxoneHandler.ts:54:36)
    at Object.socketOnEventReceived (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/src/loxone/LoxoneHandler.ts:80:17)
    at WebSocket._handleBinaryEvent (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/node_modules/lxcommunicator/modules/WebSocket.js:934:78)
    at WebSocket._binaryMessageHandler (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/node_modules/lxcommunicator/modules/WebSocket.js:773:26)
    at W3CWebSocket.onmessage (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/node_modules/lxcommunicator/vendor/WebSocketWrapper.js:107:62)
    at W3CWebSocket._dispatchEvent [as dispatchEvent] (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/node_modules/yaeti/lib/EventTarget.js:107:17)

It could be that this error was the result of a change in the config. I will look into this, but it might not be related to the intercom changes

@rudyberends
Copy link
Owner Author

rudyberends commented Aug 8, 2023

I have pushed a new version to the beta release, but I am not able to test this myself. It might also have broken the intercomv2 support, so I will test this part myself.

In theory you should now see the webcam from the doorbell in homekit. At the very least it will spit out some debug messages in the logs. If it is not working as expected, would you be able to share them? Please feel free to mask any sensitive data.

@350d
Copy link
Contributor

350d commented Aug 8, 2023

Installing right now and will report for any issues.

@350d
Copy link
Contributor

350d commented Aug 9, 2023

Morning! I be able to test it first time today.
Doorbell Camera always in OFF Mode and on door bell event notification there was no image/video unfortunately.
Errors in console:

SyntaxError: Unexpected identifier
    at new Function (<anonymous>)
    at Intercom.LoxoneAccessory.callBack (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/src/LoxoneAccessory.ts:91:29)
    at /var/lib/homebridge/node_modules/homebridge-loxone-proxy/src/loxone/LoxoneHandler.ts:54:56
    at Array.forEach (<anonymous>)
    at handleAnyEvent (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/src/loxone/LoxoneHandler.ts:54:36)
    at Object.socketOnEventReceived (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/src/loxone/LoxoneHandler.ts:80:17)
    at WebSocket._handleBinaryEvent (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/node_modules/lxcommunicator/modules/WebSocket.js:934:78)
    at WebSocket._binaryMessageHandler (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/node_modules/lxcommunicator/modules/WebSocket.js:773:26)
    at W3CWebSocket.onmessage (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/node_modules/lxcommunicator/vendor/WebSocketWrapper.js:107:62)
    at W3CWebSocket._dispatchEvent [as dispatchEvent] (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/node_modules/yaeti/lib/EventTarget.js:107:17)
SyntaxError: Unexpected identifier
    at new Function (<anonymous>)
    at Intercom.LoxoneAccessory.callBack (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/src/LoxoneAccessory.ts:91:29)
    at /var/lib/homebridge/node_modules/homebridge-loxone-proxy/src/loxone/LoxoneHandler.ts:54:56
    at Array.forEach (<anonymous>)
    at handleAnyEvent (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/src/loxone/LoxoneHandler.ts:54:36)
    at Object.socketOnEventReceived (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/src/loxone/LoxoneHandler.ts:80:17)
    at WebSocket._handleBinaryEvent (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/node_modules/lxcommunicator/modules/WebSocket.js:934:78)
    at WebSocket._binaryMessageHandler (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/node_modules/lxcommunicator/modules/WebSocket.js:773:26)
    at W3CWebSocket.onmessage (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/node_modules/lxcommunicator/vendor/WebSocketWrapper.js:107:62)
    at W3CWebSocket._dispatchEvent [as dispatchEvent] (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/node_modules/yaeti/lib/EventTarget.js:107:17)
Screenshot 2023-08-09 at 09 47 32

@rudyberends
Copy link
Owner Author

When you start/restart homebridge there should be some "debug !! ... !!" Messages in the console/log screen. Could you post these debug messages?

@350d
Copy link
Contributor

350d commented Aug 9, 2023

!!!!DEBUG !!!! Login String: dmll***6Y0c1
!!!! DEBUG: StreamingDelgate !!!!
!! dmll***6Y0c1 !!
!! using Token Auth !!

@rudyberends
Copy link
Owner Author

i am testing it against some public Loxone demo server which also has an intercomV1. Looks good to me. I can't get an image from the webcam, because I am not internal, but everything seems fine. I do not get your errors. The only difference is that this public demo server does not have authentication set, so it might be something with the token.

Maybe we can simplify things and skip the use of token authentication and stick with basic authentication.
In the json you posted earlier, there is a username and password. If you go to "http://10.6.254.10/mjpg/video.mjpg"
Do you get a basic authentication prompt from the browser? And is it possible to login using user and pass from the json?

@350d
Copy link
Contributor

350d commented Aug 9, 2023

Confirmed - popup auth requested and it works with login/pass from json response and without login=token query

@rudyberends
Copy link
Owner Author

i have changed the authentication in the latest beta. Could you test it again with this new version?

@350d
Copy link
Contributor

350d commented Aug 11, 2023

Video feed confirmed (no audio). Intercom call and door open action i will test tomorrow morning! Thanks!

@350d
Copy link
Contributor

350d commented Aug 12, 2023

Video works on door bell ring and preview on notification looks good but there is no any button in that video to open the door. Accessory switch available in intercom camera settings but not available on video feed for some reason. Only if i separate intercom button as standalone device i can add it as "nearby device" here but im not sure it should work
IMG_3055
this way. This is my first door bell Homekit device.

I've expected something like this:
yyIDjVil

Is it possible or not with Loxone intercom? As understand (via reddit) - any smart lock in same room will act like this for door camera.
Also, audio communication will not work, correct?

@350d
Copy link
Contributor

350d commented Aug 13, 2023

Still have this error on Homebridge restart:

[13/08/2023, 10:33:23] [LoxonePlatform] Connected to Miniserver
SyntaxError: Unexpected identifier
    at new Function (<anonymous>)
    at Intercom.LoxoneAccessory.callBack (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/src/LoxoneAccessory.ts:91:29)
    at /var/lib/homebridge/node_modules/homebridge-loxone-proxy/src/loxone/LoxoneHandler.ts:54:56
    at Array.forEach (<anonymous>)
    at handleAnyEvent (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/src/loxone/LoxoneHandler.ts:54:36)
    at Object.socketOnEventReceived (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/src/loxone/LoxoneHandler.ts:80:17)
    at WebSocket._handleBinaryEvent (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/node_modules/lxcommunicator/modules/WebSocket.js:934:78)
    at WebSocket._binaryMessageHandler (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/node_modules/lxcommunicator/modules/WebSocket.js:773:26)
    at W3CWebSocket.onmessage (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/node_modules/lxcommunicator/vendor/WebSocketWrapper.js:107:62)
    at W3CWebSocket._dispatchEvent [as dispatchEvent] (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/node_modules/yaeti/lib/EventTarget.js:107:17)

@rudyberends
Copy link
Owner Author

If video is working, then it now has the exact same features as the intercomV2 has using this plugin.

I think we should try to get rid of any errors you have and then push this implementation to the production build.

Concerning your request for audio; The video stream itself (mjpg) does not contain any audio. However, Loxone has 2 way audio implemented using a separate protocol for their intercoms. We should be able to implement this intercom function. I will look into this, and it will be implemented for all intercoms. (V1/XL and v2).

I am not sure if you are interested in it, but I am also looking into a homekit secure video implementation. This should also be possible and there is already some code in the current plugin to support this. It will also be available for all intercoms.

I do not have a lock mechanism on my doorbell myself, but I have also looked into this before. I think this "unlock button" is a screenshot from an older version of IOS and was removed in more recent versions and is now replaced by what you see in your setup. See also this thread;

Samfox2/homebridge-videodoorbell#62

However, if you find a working homebridge implementation of this feature in another plugin, then I guess we can also implement it for the loxone plugin.

@350d
Copy link
Contributor

350d commented Aug 13, 2023

I've tried to create fake HTTP Lock with Loxone API call to open the intercom door - it looks better then simple switch and its visible on Apple Watch in better way. Maybe it's possible to make this switch accessory act and looks like a Lock device - it will be better.

For faster video start I've added few ffmpeg params and it works better. Working SIP two way audio already discussed and implemented in FFMPEG CAMERA here. Few more discussions available here.

@rudyberends
Copy link
Owner Author

Turning it into a door lock is doable. You can do this already if you add a switch in your loxone config between the intercom push button and the output. Using a proper naming convention, this switch will turn into a lock.

Will this be a working solution for you?

@350d
Copy link
Contributor

350d commented Aug 13, 2023

@rudyberends Like this?
Screenshot 2023-08-13 at 17 49 33

@rudyberends
Copy link
Owner Author

It will only work on a switch for now. If you add a switch to your loxone config and you name it "Doorlock Front door" or something, and you set the alias in the config to "Doorlock", it will turn this switch into a doorlock.

If you put this switch between your pushbutton and the output in Loxone config, then you will have what you want in homekit.

We could also look at changing the pushbutton directly into a switch, but some code changes are then required. The issue with a pushbutton is that it does not have a state (on/off), so it does not map to a doorlock that well.

@350d
Copy link
Contributor

350d commented Aug 19, 2023

v 1.2.0:

[19/08/2023, 09:35:27] [LoxonePlatform] Connected to Miniserver
SyntaxError: Unexpected identifier
    at new Function (<anonymous>)
    at Intercom.LoxoneAccessory.callBack (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/src/LoxoneAccessory.ts:91:29)
    at /var/lib/homebridge/node_modules/homebridge-loxone-proxy/src/loxone/LoxoneHandler.ts:54:56
    at Array.forEach (<anonymous>)
    at handleAnyEvent (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/src/loxone/LoxoneHandler.ts:54:36)
    at Object.socketOnEventReceived (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/src/loxone/LoxoneHandler.ts:80:17)
    at WebSocket._handleBinaryEvent (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/node_modules/lxcommunicator/modules/WebSocket.js:934:78)
    at WebSocket._binaryMessageHandler (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/node_modules/lxcommunicator/modules/WebSocket.js:773:26)
    at W3CWebSocket.onmessage (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/node_modules/lxcommunicator/vendor/WebSocketWrapper.js:107:62)
    at W3CWebSocket._dispatchEvent [as dispatchEvent] (/var/lib/homebridge/node_modules/homebridge-loxone-proxy/node_modules/yaeti/lib/EventTarget.js:107:17)

@rudyberends
Copy link
Owner Author

The latest beta has some debug output. Could you post your error again with the additional debug output?

@350d
Copy link
Contributor

350d commented Aug 20, 2023

Two debug blocks and no errors/warnings:

!!! DEBUG !!!
{ service: 'PrimaryService', state: 'tempActual' }
{ service: 'PrimaryService', state: 'tempActual' }
{
  uuid: '13a66d90-00dd-a46b-fffff33b270c95bf',
  value: 25.125,
  toString: [Function: evToString],
  service: 'PrimaryService',
  state: 'tempActual'
}
!!! DEBUG !!!
!!! DEBUG !!!
{ service: 'PrimaryService', state: 'tempTarget' }
{ service: 'PrimaryService', state: 'tempTarget' }
{
  uuid: '13a66d90-00dd-a490-fffff33b270c95bf',
  value: 25,
  toString: [Function: evToString],
  service: 'PrimaryService',
  state: 'tempTarget'
}
!!! DEBUG !!!
!!! DEBUG !!!
{ service: 'PrimaryService', state: 'tempActual' }
{ service: 'PrimaryService', state: 'tempActual' }
{
  uuid: '162438ea-02e9-da43-ffff75620d2832ef',
  value: 23,
  toString: [Function: evToString],
  service: 'PrimaryService',
  state: 'tempActual'
}
!!! DEBUG !!!
!!! DEBUG !!!
{ service: 'PrimaryService', state: 'tempTarget' }
{ service: 'PrimaryService', state: 'tempTarget' }
{
  uuid: '162438ea-02e9-da69-ffff75620d2832ef',
  value: 23,
  toString: [Function: evToString],
  service: 'PrimaryService',
  state: 'tempTarget'
}
!!! DEBUG !!!
!!! DEBUG !!!
{ service: 'PrimaryService', state: 'active' }
{ service: 'PrimaryService', state: 'active' }
{
  uuid: '16242176-002c-9d21-ffff988b9e0c7dec',
  value: 1,
  toString: [Function: evToString],
  service: 'PrimaryService',
  state: 'active'
}
!!! DEBUG !!!
!!! DEBUG !!!
{ service: 'PrimaryService', state: 'tempActual' }
{ service: 'PrimaryService', state: 'tempActual' }
{
  uuid: '1621a4af-0368-1fec-ffffe7403c26fd27',
  value: 24.0625,
  toString: [Function: evToString],
  service: 'PrimaryService',
  state: 'tempActual'
}
!!! DEBUG !!!
!!! DEBUG !!!
{ service: 'PrimaryService', state: 'tempTarget' }
{ service: 'PrimaryService', state: 'tempTarget' }
{
  uuid: '1621a4af-0368-2012-ffffe7403c26fd27',
  value: 24.5,
  toString: [Function: evToString],
  service: 'PrimaryService',
  state: 'tempTarget'
}
!!! DEBUG !!!
!!! DEBUG !!!
{ service: 'PrimaryService', state: 'active' }
{ service: 'PrimaryService', state: 'active' }
{
  uuid: '1624205a-038e-15f4-ffff32b74ffdc17e',
  value: 1,
  toString: [Function: evToString],
  service: 'PrimaryService',
  state: 'active'
}
!!! DEBUG !!!
!!! DEBUG !!!
{ service: 'PrimaryService', state: 'tempActual' }
{ service: 'PrimaryService', state: 'tempActual' }
{
  uuid: '162438c8-00d3-6f3b-ffffab73d0ca1b18',
  value: 23.5,
  toString: [Function: evToString],
  service: 'PrimaryService',
  state: 'tempActual'
}
!!! DEBUG !!!
!!! DEBUG !!!
{ service: 'PrimaryService', state: 'tempTarget' }
{ service: 'PrimaryService', state: 'tempTarget' }
{
  uuid: '162438c8-00d3-6f61-ffffab73d0ca1b18',
  value: 23.5,
  toString: [Function: evToString],
  service: 'PrimaryService',
  state: 'tempTarget'
}
!!! DEBUG !!!
!!! DEBUG !!!
{ service: 'PrimaryService', state: 'active' }
{ service: 'PrimaryService', state: 'active' }
{
  uuid: '16242164-025c-749f-ffff65105cbe3991',
  value: 1,
  toString: [Function: evToString],
  service: 'PrimaryService',
  state: 'active'
}
!!! DEBUG !!!
!!! DEBUG !!!
{ service: 'PrimaryService', state: 'active' }
{ service: 'PrimaryService', state: 'active' }
{
  uuid: '13a665aa-001b-e8d1-ffff074ebadfa46d',
  value: 0,
  toString: [Function: evToString],
  service: 'PrimaryService',
  state: 'active'
}
!!! DEBUG !!!
!!! DEBUG !!!
{ service: 'PrimaryService', state: 'bell' }
{ service: 'PrimaryService', state: 'bell' }
{
  uuid: '13a66236-0173-1b18-ffffd285cd00b460',
  value: 0,
  toString: [Function: evToString],
  service: 'PrimaryService',
  state: 'bell'
}
!!! DEBUG !!!
!!! DEBUG !!!
{ service: 'Ava uks', state: 'active' }
{ service: 'Ava uks', state: 'active' }
{
  uuid: '13a66236-0173-1b19-ffffd285cd00b460',
  value: 0,
  toString: [Function: evToString],
  service: 'Ava uks',
  state: 'active'
}
!!! DEBUG !!!
!!! DEBUG !!!
{ service: 'PrimaryService', state: 'active' }
{ service: 'PrimaryService', state: 'active' }
{
  uuid: '13a78c7e-0240-affb-ffff03169a47433a',
  value: 0,
  toString: [Function: evToString],
  service: 'PrimaryService',
  state: 'active'
}
!!! DEBUG !!!
!!! DEBUG !!!
{ service: 'PrimaryService', state: 'active' }
{ service: 'PrimaryService', state: 'active' }
{
  uuid: '13a78c7e-0240-aff2-ffff03169a47433a',
  value: 0,
  toString: [Function: evToString],
  service: 'PrimaryService',
  state: 'active'
}
!!! DEBUG !!!
!!! DEBUG !!!
{ service: 'PrimaryService', state: 'tempActual' }
{ service: 'PrimaryService', state: 'tempActual' }
{
  uuid: '16243918-03e1-34b1-ffff4a4d3d34e92e',
  value: 23.5,
  toString: [Function: evToString],
  service: 'PrimaryService',
  state: 'tempActual'
}
!!! DEBUG !!!
!!! DEBUG !!!
{ service: 'PrimaryService', state: 'tempTarget' }
{ service: 'PrimaryService', state: 'tempTarget' }
{
  uuid: '16243918-03e1-34d7-ffff4a4d3d34e92e',
  value: 23.5,
  toString: [Function: evToString],
  service: 'PrimaryService',
  state: 'tempTarget'
}
!!! DEBUG !!!
!!! DEBUG !!!
{ service: 'PrimaryService', state: 'active' }
{ service: 'PrimaryService', state: 'active' }
{
  uuid: '16241e8b-03a3-45ea-ffff37f64622d8c6',
  value: 1,
  toString: [Function: evToString],
  service: 'PrimaryService',
  state: 'active'
}
!!! DEBUG !!!
!!! DEBUG !!!
{ service: 'PrimaryService', state: 'tempActual' }
{ service: 'PrimaryService', state: 'tempActual' }
{
  uuid: '1624303b-0330-bc62-ffff84bbf02e8f0c',
  value: 24,
  toString: [Function: evToString],
  service: 'PrimaryService',
  state: 'tempActual'
}
!!! DEBUG !!!
!!! DEBUG !!!
{ service: 'PrimaryService', state: 'tempTarget' }
{ service: 'PrimaryService', state: 'tempTarget' }
{
  uuid: '1624303b-0330-bc88-ffff84bbf02e8f0c',
  value: 19.5,
  toString: [Function: evToString],
  service: 'PrimaryService',
  state: 'tempTarget'
}
!!! DEBUG !!!
!!! DEBUG !!!
{ service: 'PrimaryService', state: 'tempActual' }
{ service: 'PrimaryService', state: 'tempActual' }
{
  uuid: '16243c11-0041-91d9-ffffefb6eaa88fe6',
  value: 23.3125,
  toString: [Function: evToString],
  service: 'PrimaryService',
  state: 'tempActual'
}
!!! DEBUG !!!
!!! DEBUG !!!
{ service: 'PrimaryService', state: 'tempTarget' }
{ service: 'PrimaryService', state: 'tempTarget' }
{
  uuid: '16243c11-0041-91ff-ffffefb6eaa88fe6',
  value: 22,
  toString: [Function: evToString],
  service: 'PrimaryService',
  state: 'tempTarget'
}
!!! DEBUG !!!
!!! DEBUG !!!
{ service: 'PrimaryService', state: 'tempActual' }
{ service: 'PrimaryService', state: 'tempActual' }
{
  uuid: '1624303b-0330-bc62-ffff84bbf02e8f0c',
  value: 24.0625,
  toString: [Function: evToString],
  service: 'PrimaryService',
  state: 'tempActual'
}
!!! DEBUG !!!
[20/08/2023, 11:48:10] [miot] [Mi Robot] Starting property polling.
!!! DEBUG !!!
{ service: 'PrimaryService', state: 'tempActual' }
{ service: 'PrimaryService', state: 'tempActual' }
{
  uuid: '162438c8-00d3-6f3b-ffffab73d0ca1b18',
  value: 23.5625,
  toString: [Function: evToString],
  service: 'PrimaryService',
  state: 'tempActual'
}
!!! DEBUG !!!
!!! DEBUG !!!
{ service: 'PrimaryService', state: 'tempActual' }
{ service: 'PrimaryService', state: 'tempActual' }
{
  uuid: '1624303b-0330-bc62-ffff84bbf02e8f0c',
  value: 24,
  toString: [Function: evToString],
  service: 'PrimaryService',
  state: 'tempActual'
}
!!! DEBUG !!!
!!! DEBUG !!!
{ service: 'PrimaryService', state: 'tempActual' }
{ service: 'PrimaryService', state: 'tempActual' }
{
  uuid: '162438c8-00d3-6f3b-ffffab73d0ca1b18',
  value: 23.5,
  toString: [Function: evToString],
  service: 'PrimaryService',
  state: 'tempActual'
}
!!! DEBUG !!!
!!! DEBUG !!!
{ service: 'PrimaryService', state: 'tempActual' }
{ service: 'PrimaryService', state: 'tempActual' }
{
  uuid: '1621a4af-0368-1fec-ffffe7403c26fd27',
  value: 24.125,
  toString: [Function: evToString],
  service: 'PrimaryService',
  state: 'tempActual'
}
!!! DEBUG !!!

@rudyberends
Copy link
Owner Author

This might be the error for the issue;

{ service: 'Ava uks', state: 'active' }

The service takes the name from the pushbutton. In your case it contains spaces. I changed the code to remove all spaces from the service name. The code is in the latest beta. Could you see if this resolves your error?

@350d
Copy link
Contributor

350d commented Aug 20, 2023

Cool, no more warnings!

@rudyberends
Copy link
Owner Author

i will close this one, as it now has the same features as the V2 intercom.

I will try to implement 2 way communication. Please feel free to open another issue if you have more ideas for the intercom.
Thanks for testing

@350d
Copy link
Contributor

350d commented Aug 26, 2023

on 1.3.0 now I have this:

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

@rudyberends
Copy link
Owner Author

i made some new features and accidentally pushed it to the master branch. I am using semantic versioning with a workflow, so a build is automatically created and pushed to NPM.

The changes I made for the intercom are not (yet) in this release. I will publish them to the master branch in a while. Right now the latest beta should contain al your fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants