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

garagedoor stucks on opening or closing when CurrentDoorState received from knx #65

Closed gjniewenhuijse closed 7 years ago

gjniewenhuijse commented 7 years ago

First: great work for the new homebridge-knx version.

U use the ios10 home app.

When opening or closing a garagedoor my TargetDoorState and CurrentDoorState works perfect.

But when i open of close my garagedoor by KNX, the groupaddress for CurrentDoorState is updated, but my home app displayed: opening or closing. But i only use 0 or 1: Characteristic.CurrentDoorState.OPEN = 0; Characteristic.CurrentDoorState.CLOSED = 1;

"ServiceType": "GarageDoorOpener",
                    "ServiceName": "Garagedeur",
                    "Characteristics": [
                        {
                            "Type": "TargetDoorState",
                            "Set": [
                                "10/2/1"
                            ]
                        },
                        {
                            "Type": "CurrentDoorState",
                            "Listen": [
                                "10/2/2"
                            ]
                        }
                    ],
                    "KNXReadRequests": [
                        "10/2/2"
                    ],
gjniewenhuijse commented 7 years ago

I think now its better to use script below to solve this:

"ServiceType": "GarageDoorOpener",
                    "ServiceName": "Garagedeur",
                    "Characteristics": [
                        {
                            "Type": "TargetDoorState",
                            "Set": [
                                "10/2/1"
                            ],
                            "Listen": [
                                "10/2/2"
                            ]
                        },
                        {
                            "Type": "CurrentDoorState",
                            "Listen": [
                                "10/2/2"
                            ]
                        }
                    ],
                    "KNXReadRequests": [
                        "10/2/2"
                    ]
snowdd1 commented 7 years ago

Sorry for the late response! I was off to the real world.
Your solution is quite ok, but has one major drawback: if the app you're using sends multiple TargetPositions in a fast sequence, you might also trigger multiple CurrentPosition responses. The effect would be that the control on the screen (slider for example) is not moving smoothly but start to stutter- that's why the handler has a little timer build in to suppress setting TargetPosition to KNX responses if they come a short time after issuing a TargetPosition to the bus.

snowdd1 commented 7 years ago

Forget my previous answer. I was thinking of a window covering type, and you were talking about a garage door opener - didn't match. Your solution is perfectly fine!

migabc commented 7 years ago

Hi I'm having the same problem. My garagedoor icon keeps showing "Opening..." or "Closing..." indefinitely It works OK (meaning I can actually open and close the gate) - it's just the icon that keeps stuck in a wait state ...

Here's my code.

            {
                "ServiceType": "GarageDoorOpener",
                "ServiceName": "Front Gate",
                "Characteristics": [
                    {
                        "Type": "TargetDoorState",
                        "Set": [
                            "7/1/11"
                        ],
                        "DPT": "DPT1",
                        "Reverse": true,
                        "Listen": [
                            "7/1/11"
                        ]
                    },
                    {
                        "Type": "CurrentDoorState",
                        "Listen": [
                            "7/1/11"
                        ]
                    }
                ],
                "KNXReadRequests": [
                    "7/1/11"
                ]
            },

Any help on this?

P.S. My gate only has one Knx address (7/1/11) and is binary 1 -> Open 0 -> Close

Thanks for any help

snowdd1 commented 7 years ago

See https://github.com/snowdd1/homebridge-knx/issues/91