snowdd1 / homebridge-knx

KNX platform shim for homebridge
https://github.com/nfarina/homebridge
GNU General Public License v2.0
97 stars 56 forks source link

Listen/Status - Not always updating #121

Closed Mr-S-D closed 3 years ago

Mr-S-D commented 6 years ago

I am experiencing some unwanted behaviour, making me distrust the homebridge. I have logic and sensors running on my KNX system changing light settings, temperatures etc. at different times of the day. Most om the time the home app shows the correct status of an object but sometimes it does not. It does not seem to follow any specific trend, sometimes it is a random light that is not showing the correct status, and other times it is a temperature setting. I have checked the KNXD service and for the last 36 hours it has been running without shutdowns. The KNXD service also has a send delay of 70ms (dont know if that has any effect on the listening function, but it makes sure that when rebooting the homebridge my knx statuses are correct). Just so I understand, when starting the home app on my iphone, where does it collect the status from? Does anyone know what might be causing this, or help me with trying to pin point where the error is?

furiaceka87 commented 6 years ago

I have a simular issue, not always but sometimes the Apple Home app is not updating the status.

wendelit commented 6 years ago

How do you get the status, do you have a status group object or do you just have the "set" and "listen" address as the same ?

Mr-S-D commented 6 years ago

I have a 1 set address and 1 status address. For example, when turning on/off a light bulb I have 1 Knx address that writes a 1/0 to the bus, and then a listen Knox address that knows the status of the objec. Every time there is a change in status the listen address communicates this on the Knx bus. So the listen address is correct, but for some reason the homebridge/Knxd does not pick it up... it’s like it got lost somewhere... it almost seems like the knxd looses connection for a few seconds, thus making it to miss updates that happens in those seconds...

wendelit commented 6 years ago

but KNXd gets the status ? As you wrote in your update on the first post so the problem is between KNX and knxd or is it between knxd and HomeKit ?

Mr-S-D commented 6 years ago

The status is sent on the bus, but the knxd does not receive it (at least sometimes it doesn’t). The thing is that this happens sporadically... it follows no particular pattern. After spending more time testing on the vbusmonitor does it seem like that the error is between Knx and the knxd... I’ll update my first post so it is correct! Thanks for pointing that out 👍🏻

wendelit commented 6 years ago

Ok than i think you should open an issue with KNXd as than this is not a problem for homebridge-knx. How do you know that the traffic it is sent on the bus, do you use a USB interface or something like that and there you see the traffic ?

I do not know if this will help you but i have an IP-tunnel gateway and than KNXd is connected to that, what i have noticed is that if i connect my computer directly to the IP-tunnel KNXd will not see traffic sent from my computer but it will see everything sent within the bus. If i instead connect my computer to KNXd it will see the traffic from my computer.

Mr-S-D commented 6 years ago

I am connecting the knxd by multicasting. I have a gateway multicasting all objects. The getaway also has a web interface that allow me to change/see status in objects. This gateway have never shown wrong status, so that is why I suspect something is wrong with the connection between the gateway and knxd. I have also tried to use ip tunneling directly to the ip interface to my Knx system but the error still occurring... this is why I think it might be a setting/installation issue with my Knxd setup

Mr-S-D commented 6 years ago

The issue with status/listen is resolved. I disabled IGMP snooping in my gateway/router and now the multicast packages are not lost, thus making sure my home app is showing the correct status.

However, I am now experiencing a new/another error. Sometimes my home app do not change status in “live” view. Meaning, if the app is open and shows a door/window that is open and I manually close it the change in status does not get shown in the app. However, closing the app and reopening it the home app shows the correct status... The strange thing is that i can have the home app open on my iPad (same time as my phone) the change in status shows on the iPad but not my phone. If I wait a few hours or restart my phone, it’s start working again... In my trials to figure out what is going on I believe I have found what might be causing this... if I use my iPhone or iPad to change a lot of lights, heating or what ever, this will cause the app not to update the correct status in live... if closing the app and not using it for a while the error corrects it self, but if changing a lot of things will again freeze the live status updates... The error only occurs on the device (iPhone/iPad) that has been used to change multiple accessories within a short time.

wendelit commented 6 years ago

I’m not sure how the HomeKit protocol works, but my guess is that home bridge has to send a package to each device, do you have a Apple TV in the system to enable remote control ?

What i’m thinking is that this could solve it as than home bridge only talked to the Apple TV and than the Apple TV takes care of the devices

Mr-S-D commented 6 years ago

I do have an Apple TV connected so I have remote access to the homebridge. And I am still seeing this error...

Mr-S-D commented 5 years ago

Hi, after a lot of investigation I seem to have found the issue, and the issue seems to be network related. I turned IMGP snooping off, and now I am not seeing this behavior. However, I am still seeing something similar. I have made scenes in the apple home app, and if they include more than 1 light I am experiencing the following:

I press the scene button and the lights turn on at the requested % and the home app updates. If I press the scene button again the lights gets turned off, but because the lights are connected to a motion sensor the KNX systems immediately turns them back on to a certain %, however, the home app to not updated with the new light status/%, it just shows the lights as being off.... this happens really fast, but on KNX Bus the lights are showing with the correct %...

PS: Awesome work you have done here snowed1 :)

snowdd1 commented 3 years ago

stale for long enough now.