snowdd1 / homebridge-knx

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

GarageDoor icon keeps showing "Opening..." or "Closing..." indefinitely #91

Closed migabc closed 4 years ago

migabc commented 7 years ago

Hi 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 the value is binary 1 -> Open 0 -> Close

Thanks for any help

snowdd1 commented 7 years ago

Any reason why you've reversed the TargetDoorState but not the CurrentDoorState characteristics? If Open is 1 in you installation, then it immediately sets Current to 1 and Target to 0.
And if they don't match Home app assumed it's still in motion.

In Home it's

 Characteristic.CurrentDoorState.OPEN = 0;
 Characteristic.CurrentDoorState.CLOSED = 1;

So you should probably reverse the current state as well.

migabc commented 7 years ago

I reversed the CurrentDoorState but I still get an indefinite duration for the "Opening..." or "Closing..." icon state when using the Home app or Siri

On the other had, when I use KNX (Gira app) to open or close the gate the device's icon state on the Apple Home app is changed immediately (but in the wrong order - the Home app device icon shows "Closed" instead of "Open" and "Open" instead of "Closed") - I believe this "wrong order" is happening because the "Listen" statement under TargetDoorState cannot be reversed (so when I use Gira to open the gate the homebridge Listener receives the inverted state)

Here's my code:

    {
        "DeviceName": "Gates",
        "Services": [
            {
                "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"
                        ],
                        "DPT": "DPT1",
                        "Reverse": true
                    }
                ],
                "KNXReadRequests": [
                    "7/1/11"
                ],
                "subtype": "SUB_b3b2b56a-29ca-4065-9250-d8741957eeaf"
            },
snowdd1 commented 7 years ago

Reverse is supposed to apply to a characteristic, not to to Set or Listen individually.
But I am on my mobile, cannot check if Reverse can apply to an integer characteristic at all. Could you post the debug output of an opening action started via Home app?

migabc commented 7 years ago

What log file should I check for homebrige? I usually look in /var/log/syslog

Here's the debug output in syslog for OPEN and CLOSE actions:

May 31 11:38:42 raspberrypi homebridge[3786]: Wed, 31 May 2017 10:38:42 GMT EventedHTTPServer [::ffff:192.168.0.70] HTTP request: /characteristics
May 31 11:38:42 raspberrypi rsyslogd-2007: action 'action 17' suspended, next retry is Wed May 31 11:39:12 2017 [try http://www.rsyslog.com/e/2007 ]
May 31 11:38:42 raspberrypi homebridge[3786]: Wed, 31 May 2017 10:38:42 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: PUT /characteristics
May 31 11:38:42 raspberrypi homebridge[3786]: Wed, 31 May 2017 10:38:42 GMT Accessory [Homebridge] Processing characteristic set: [{"aid":42,"iid":10,"value":0}]
May 31 11:38:42 raspberrypi homebridge[3786]: Wed, 31 May 2017 10:38:42 GMT Accessory [Homebridge] Setting Characteristic "Target Door State" to value 0
May 31 11:38:42 raspberrypi homebridge[3786]: [5/31/2017, 11:38:42 AM] [homebridge-knx.KNX] DEBUG got dest=14603
May 31 11:38:42 raspberrypi homebridge[3786]: Wed, 31 May 2017 10:38:42 GMT EventedHTTPServer [::ffff:192.168.0.70] HTTP Response is finished
May 31 11:38:42 raspberrypi homebridge[3786]: [5/31/2017, 11:38:42 AM] [homebridge-knx.KNX] Value changed, updating homebridge
May 31 11:38:42 raspberrypi homebridge[3786]: Wed, 31 May 2017 10:38:42 GMT EventedHTTPServer [::ffff:192.168.0.64] Sending HTTP event '42.10' with data: {"characteristics":[{"aid":42,"iid":10,"value":1}]}
May 31 11:38:42 raspberrypi homebridge[3786]: Wed, 31 May 2017 10:38:42 GMT EventedHTTPServer [::ffff:192.168.0.70] Sending HTTP event '42.10' with data: {"characteristics":[{"aid":42,"iid":10,"value":1}]}
May 31 11:38:42 raspberrypi homebridge[3786]: [5/31/2017, 11:38:42 AM] [homebridge-knx.KNX] exiting writeValueHK()
May 31 11:38:42 raspberrypi homebridge[3786]: [5/31/2017, 11:38:42 AM] [homebridge-knx.KNX] Value changed, updating homebridge
May 31 11:38:42 raspberrypi homebridge[3786]: Wed, 31 May 2017 10:38:42 GMT EventedHTTPServer [::ffff:192.168.0.64] Sending HTTP event '42.9' with data: {"characteristics":[{"aid":42,"iid":9,"value":1}]}
May 31 11:38:42 raspberrypi homebridge[3786]: Wed, 31 May 2017 10:38:42 GMT EventedHTTPServer [::ffff:192.168.0.70] Sending HTTP event '42.9' with data: {"characteristics":[{"aid":42,"iid":9,"value":1}]}
May 31 11:38:42 raspberrypi homebridge[3786]: [5/31/2017, 11:38:42 AM] [homebridge-knx.KNX] exiting writeValueHK()
May 31 11:38:55 raspberrypi homebridge[3786]: Wed, 31 May 2017 10:38:55 GMT EventedHTTPServer [::ffff:192.168.0.70] HTTP request: /characteristics
May 31 11:38:55 raspberrypi homebridge[3786]: Wed, 31 May 2017 10:38:55 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: PUT /characteristics
May 31 11:38:55 raspberrypi homebridge[3786]: Wed, 31 May 2017 10:38:55 GMT Accessory [Homebridge] Processing characteristic set: [{"aid":42,"iid":10,"value":1}]
May 31 11:38:55 raspberrypi homebridge[3786]: Wed, 31 May 2017 10:38:55 GMT Accessory [Homebridge] Setting Characteristic "Target Door State" to value 1
May 31 11:38:55 raspberrypi homebridge[3786]: [5/31/2017, 11:38:55 AM] [homebridge-knx.KNX] DEBUG got dest=14603
May 31 11:38:55 raspberrypi homebridge[3786]: Wed, 31 May 2017 10:38:55 GMT EventedHTTPServer [::ffff:192.168.0.70] HTTP Response is finished
May 31 11:38:55 raspberrypi homebridge[3786]: [5/31/2017, 11:38:55 AM] [homebridge-knx.KNX] Value changed, updating homebridge
May 31 11:38:55 raspberrypi homebridge[3786]: Wed, 31 May 2017 10:38:55 GMT EventedHTTPServer [::ffff:192.168.0.64] Sending HTTP event '42.10' with data: {"characteristics":[{"aid":42,"iid":10,"value":0}]}
May 31 11:38:55 raspberrypi homebridge[3786]: Wed, 31 May 2017 10:38:55 GMT EventedHTTPServer [::ffff:192.168.0.70] Sending HTTP event '42.10' with data: {"characteristics":[{"aid":42,"iid":10,"value":0}]}
May 31 11:38:55 raspberrypi homebridge[3786]: [5/31/2017, 11:38:55 AM] [homebridge-knx.KNX] exiting writeValueHK()
May 31 11:38:55 raspberrypi homebridge[3786]: [5/31/2017, 11:38:55 AM] [homebridge-knx.KNX] Value changed, updating homebridge
May 31 11:38:55 raspberrypi homebridge[3786]: Wed, 31 May 2017 10:38:55 GMT EventedHTTPServer [::ffff:192.168.0.64] Sending HTTP event '42.9' with data: {"characteristics":[{"aid":42,"iid":9,"value":0}]}
May 31 11:38:55 raspberrypi homebridge[3786]: Wed, 31 May 2017 10:38:55 GMT EventedHTTPServer [::ffff:192.168.0.70] Sending HTTP event '42.9' with data: {"characteristics":[{"aid":42,"iid":9,"value":0}]}
May 31 11:38:55 raspberrypi homebridge[3786]: [5/31/2017, 11:38:55 AM] [homebridge-knx.KNX] exiting writeValueHK()

Thanks for your help.

snowdd1 commented 7 years ago

I think I can trace what is happening. For some reason it is reversing the action ("set") but not the answers. I think that the reason for that is that the forced dpt to 1 is only used when writing to the bus, but on getting answers it reads the characteristic type from HomeKit (to avoid illegal answers and the consequential lock-out of the bridge ) so it sees integer type, and integers cannot be reversed (what would be the opposite of 42?). For contact sensors I once had the same issue and wrote a handler for that case. Have to think how to generally make integers that are basically Boolean (only 0 and 1 allowed) be treated like true Boolean types (such as the power "On" characteristic.
I am not sure when I can get down to it, family has booked me the whole weekend.

migabc commented 7 years ago

That's fine. Whenever you can Thanks for your help on this.

migabc commented 7 years ago

By the way, do you have a complete list of the supported ServiceTypes and their Characteristics? Real working examples would be helpful as well Thanks

snowdd1 commented 7 years ago

Supported Services etc: last link in that paragraph https://github.com/snowdd1/homebridge-knx/blob/master/knx_config.json.md#services

migabc commented 7 years ago

Thanks for providing the link I have another GarageDoor that is operated with a simple push button that has no fixed state. It simply does "up", "stop", "down", every time I press the button. When I press the button it returns to its initial state after being triggered

1 -> Up 1 -> Stop 1 -> Down 1 -> Stop . . .

How can I control this GarageDoor via the homebridge?

Should I use the StatelessProgrammableSwitch. Can you please give me an example on how to accomplish this?

snowdd1 commented 7 years ago

The StatelessProgramableSwitch is a sensor to HomeKit , not an actuator. It is thought to be a wall switch that can trigger actions in HomeKit.

An actuator that receives only a one way trigger and the switch returns to its initial state is not part of HomeKit as of now, you might use the handler OneWaySwitch I wrote for the "all lights off" group address use case.

migabc commented 7 years ago

That's cool. I'm also using a "All lights Off" switch that does not return to previous state:

    {
        "DeviceName": "All Lights",
        "Services": [
            {
                "ServiceType": "Switch",
                "ServiceName": "All Lights",
                "Characteristics": [
                    {
                        "Type": "On",
                        "Set": [
                            "5/6/24"
                        ],
                        "DPT": "DPT1",
                        "Reverse": true
                    }
                ]
            }
        ]
    },

How can I use your OneWaySwitch handler with my switch?

P.S. Can I also apply this handler to my "pushbutton" GarageDoorOpener?

            {
                "ServiceType": "GarageDoorOpener",
                "ServiceName": "South Garage Door",
                "Characteristics": [
                    {
                        "Type": "TargetDoorState",
                        "Set": [
                            "7/1/31"
                        ],
                        "DPT": "DPT1",
                        "Reverse": true,
                        "Listen": [
                            "7/1/31"
                        ]
                    },
                    {
                        "Type": "CurrentDoorState",
                        "Listen": [
                            "7/1/31"
                        ],
                        "DPT": "DPT1",
                        "Reverse": true
                    }
                ],
                "KNXReadRequests": [
                    "7/1/31"
                ]
            }

Thanks

snowdd1 commented 7 years ago

I've just committed https://github.com/snowdd1/homebridge-knx/commit/9b284d5d286962cb2fcf816f196512a34025841c that should support Reverse on the incoming value in HomeKit from KNX (see my https://github.com/snowdd1/homebridge-knx/issues/91#issuecomment-305266948).

Could you please test it and give feedback? I am away and have no testing site available.

As for the OneWaySwitch, for your convenience I paste the comments from the file linked above:


/* ***************************************************************************************************************
 * The config for that should look like this 
 * Reverse keyword is not allowed for custom handlers
 * 
 * SwitchSends can be set to 1 or 0, so it only sends a 1 or a zero to the bus when the switch is triggered.
 * The switch in HomeKit resets itself to off after 0,3 seconds
 * 
"Services": [{
    "ServiceType": "Lightbulb",
    "Handler": "OneWaySwitch",
    "ServiceName": "Centrally off",
    "Characteristics": [{
        "Type": "On",
        "Set": "1/2/1"
    }],
    "LocalConstants": {
        "SwitchSends": 0
    }
}]
*/ 

You can configure the value for the KNX bus:

migabc commented 7 years ago

Hi,

Installed the new homebridge-knx but it has not solved this Reverse issue:

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"
                            ],
                            "DPT": "DPT1",
                            "Reverse": true
                        }
                    ],
                    "KNXReadRequests": [
                        "7/1/11"
                    ],
                    "subtype": "SUB_b3b2b56a-29ca-4065-9250-d8741957eeaf"
                },

Here's the DEBUG log for "Closing"

Jun 15 16:58:25 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 15:58:25 GMT EventedHTTPServer [::ffff:192.168.0.70] HTTP request: /characteristics Jun 15 16:58:25 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 15:58:25 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: PUT /characteristics Jun 15 16:58:25 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 15:58:25 GMT Accessory [Homebridge] Processing characteristic set: [{"aid":42,"iid":10,"value":1}] Jun 15 16:58:25 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 15:58:25 GMT Accessory [Homebridge] Setting Characteristic "Target Door State" to value 1 Jun 15 16:58:25 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 15:58:25 GMT EventedHTTPServer [::ffff:192.168.0.70] HTTP Response is finished Jun 15 16:58:25 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 15:58:25 GMT EventedHTTPServer [::ffff:192.168.0.64] Sending HTTP event '42.10' with data: {"characteristics":[{"aid":42,"iid":10,"value":0}]} Jun 15 16:58:25 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 15:58:25 GMT EventedHTTPServer [::ffff:192.168.0.70] Sending HTTP event '42.10' with data: {"characteristics":[{"aid":42,"iid":10,"value":0}]} Jun 15 16:58:25 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 15:58:25 GMT EventedHTTPServer [::ffff:192.168.0.64] Sending HTTP event '42.9' with data: {"characteristics":[{"aid":42,"iid":9,"value":0}]} Jun 15 16:58:25 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 15:58:25 GMT EventedHTTPServer [::ffff:192.168.0.70] Sending HTTP event '42.9' with data: {"characteristics":[{"aid":42,"iid":9,"value":0}]} Jun 15 16:58:31 raspberrypi homebridge[12026]: DEBUG: Contact Sensor State has now validValue of 0,1 Jun 15 16:58:31 raspberrypi rsyslogd-2007: action 'action 17' suspended, next retry is Thu Jun 15 17:00:01 2017 [try http://www.rsyslog.com/e/2007 ] Jun 15 16:58:31 raspberrypi homebridge[12026]: DEBUG: Contact Sensor State has now validValue of 0,1

Jun 15 16:59:53 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 15:59:53 GMT Accessory [Homebridge] Getting value for Characteristic "Current Door State" Jun 15 16:59:53 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 15:59:53 GMT Accessory [Homebridge] Got Characteristic "Current Door State" value: 0 Jun 15 16:59:53 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 15:59:53 GMT Accessory [Homebridge] Getting value for Characteristic "Obstruction Detected" Jun 15 16:59:53 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 15:59:53 GMT Accessory [Homebridge] Got Characteristic "Obstruction Detected" value: false Jun 15 16:59:53 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 15:59:53 GMT Accessory [Homebridge] Getting value for Characteristic "Target Door State" Jun 15 16:59:53 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 15:59:53 GMT Accessory [Homebridge] Got Characteristic "Target Door State" value: 0 Jun 15 16:59:53 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 15:59:53 GMT Accessory [Homebridge] Getting value for Characteristic "Obstruction Detected" Jun 15 16:59:53 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 15:59:53 GMT Accessory [Homebridge] Got Characteristic "Obstruction Detected" value: false Jun 15 16:59:53 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 15:59:53 GMT Accessory [Homebridge] Getting value for Characteristic "Target Door State" Jun 15 16:59:53 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 15:59:53 GMT Accessory [Homebridge] Got Characteristic "Target Door State" value: 0 Jun 15 16:59:53 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 15:59:53 GMT Accessory [Homebridge] Getting value for Characteristic "Current Door State" Jun 15 16:59:53 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 15:59:53 GMT Accessory [Homebridge] Got Characteristic "Current Door State" value: 0 Jun 15 16:59:53 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 15:59:53 GMT Accessory [Homebridge] Getting value for Characteristic "Current Door State" Jun 15 16:59:53 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 15:59:53 GMT Accessory [Homebridge] Got Characteristic "Current Door State" value: 0 Jun 15 16:59:53 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 15:59:53 GMT Accessory [Homebridge] Getting value for Characteristic "Obstruction Detected" Jun 15 16:59:53 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 15:59:53 GMT Accessory [Homebridge] Got Characteristic "Obstruction Detected" value: false Jun 15 16:59:53 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 15:59:53 GMT Accessory [Homebridge] Getting value for Characteristic "Target Door State" Jun 15 16:59:53 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 15:59:53 GMT Accessory [Homebridge] Got Characteristic "Target Door State" value: 0 Jun 15 16:59:53 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 15:59:53 GMT EventedHTTPServer [::ffff:192.168.0.70] HTTP Response is finished

. . .

Here's the DEBUG log for "Opening"

Jun 15 17:01:41 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 16:01:41 GMT EventedHTTPServer [::ffff:192.168.0.70] HTTP request: /characteristics Jun 15 17:01:41 raspberrypi rsyslogd-2007: action 'action 17' suspended, next retry is Thu Jun 15 17:03:11 2017 [try http://www.rsyslog.com/e/2007 ] Jun 15 17:01:41 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 16:01:41 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: PUT /characteristics Jun 15 17:01:41 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 16:01:41 GMT Accessory [Homebridge] Processing characteristic set: [{"aid":42,"iid":10,"value":0}] Jun 15 17:01:41 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 16:01:41 GMT Accessory [Homebridge] Setting Characteristic "Target Door State" to value 0 Jun 15 17:01:41 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 16:01:41 GMT EventedHTTPServer [::ffff:192.168.0.70] HTTP Response is finished Jun 15 17:01:41 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 16:01:41 GMT EventedHTTPServer [::ffff:192.168.0.64] Sending HTTP event '42.10' with data: {"characteristics":[{"aid":42,"iid":10,"value":1}]} Jun 15 17:01:41 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 16:01:41 GMT EventedHTTPServer [::ffff:192.168.0.70] Sending HTTP event '42.10' with data: {"characteristics":[{"aid":42,"iid":10,"value":1}]} Jun 15 17:01:41 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 16:01:41 GMT EventedHTTPServer [::ffff:192.168.0.64] Sending HTTP event '42.9' with data: {"characteristics":[{"aid":42,"iid":9,"value":1}]} Jun 15 17:01:41 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 16:01:41 GMT EventedHTTPServer [::ffff:192.168.0.70] Sending HTTP event '42.9' with data: {"characteristics":[{"aid":42,"iid":9,"value":1}]} Jun 15 17:01:45 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 16:01:45 GMT EventedHTTPServer [::ffff:192.168.0.70] HTTP request: /characteristics?id=42.9,42.11,42.10,42.16,42.15,42.14,42.19,42.21,42.20 Jun 15 17:01:45 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 16:01:45 GMT HAPServer [CC:22:3D:E3:CE:30] HAP Request: GET /characteristics?id=42.9,42.11,42.10,42.16,42.15,42.14,42.19,42.21,42.20 Jun 15 17:01:45 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 16:01:45 GMT Accessory [Homebridge] Getting value for Characteristic "Current Door State" Jun 15 17:01:45 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 16:01:45 GMT Accessory [Homebridge] Got Characteristic "Current Door State" value: 1 Jun 15 17:01:45 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 16:01:45 GMT Accessory [Homebridge] Getting value for Characteristic "Obstruction Detected" Jun 15 17:01:45 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 16:01:45 GMT Accessory [Homebridge] Got Characteristic "Obstruction Detected" value: false Jun 15 17:01:45 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 16:01:45 GMT Accessory [Homebridge] Getting value for Characteristic "Target Door State" Jun 15 17:01:45 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 16:01:45 GMT Accessory [Homebridge] Got Characteristic "Target Door State" value: 1 Jun 15 17:01:45 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 16:01:45 GMT Accessory [Homebridge] Getting value for Characteristic "Obstruction Detected" Jun 15 17:01:45 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 16:01:45 GMT Accessory [Homebridge] Got Characteristic "Obstruction Detected" value: false Jun 15 17:01:45 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 16:01:45 GMT Accessory [Homebridge] Getting value for Characteristic "Target Door State" Jun 15 17:01:45 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 16:01:45 GMT Accessory [Homebridge] Got Characteristic "Target Door State" value: 0 Jun 15 17:01:45 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 16:01:45 GMT Accessory [Homebridge] Getting value for Characteristic "Current Door State" Jun 15 17:01:45 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 16:01:45 GMT Accessory [Homebridge] Got Characteristic "Current Door State" value: 0 Jun 15 17:01:45 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 16:01:45 GMT Accessory [Homebridge] Getting value for Characteristic "Current Door State" Jun 15 17:01:45 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 16:01:45 GMT Accessory [Homebridge] Got Characteristic "Current Door State" value: 0 Jun 15 17:01:45 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 16:01:45 GMT Accessory [Homebridge] Getting value for Characteristic "Obstruction Detected" Jun 15 17:01:45 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 16:01:45 GMT Accessory [Homebridge] Got Characteristic "Obstruction Detected" value: false Jun 15 17:01:45 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 16:01:45 GMT Accessory [Homebridge] Getting value for Characteristic "Target Door State" Jun 15 17:01:45 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 16:01:45 GMT Accessory [Homebridge] Got Characteristic "Target Door State" value: 0 Jun 15 17:01:45 raspberrypi homebridge[12026]: Thu, 15 Jun 2017 16:01:45 GMT EventedHTTPServer [::ffff:192.168.0.70] HTTP Response is finished

migabc commented 7 years ago

Regarding the OneWaySwitch it works fine on the Home app (all my lights are turned off and the switch returns to previous state), but it does not work when I ask Siri to turn off All lights (in this case the switch changes state but it does not return to previous state and the Lights are not turned off)

Here's my code:

        {
            "DeviceName": "All Lights",
            "Services": [
                {
                    "ServiceType": "Switch",
                    "Handler": "OneWaySwitch",
                    "ServiceName": "All Lights",
                    "Characteristics": [
                        {
                            "Type": "On",
                            "Set": [
                                "5/6/24"
                            ]
                        }
                    ],
                    "LocalConstants": {
                        "SwitchSends": 1
                    },
                    "subtype": "SUB_649ec1e9-bdad-4dad-991c-e81936327019"
                }
            ],
            "UUID": "4b1776ea-654b-4ef5-bc87-ba46ae4192d9"
        },

Why does it work fine when I manually press the button on the Home app but it doesn't work when I Ask Siri to to do it?

snowdd1 commented 7 years ago

Because you manually turn the switch on, not off, so you need to tell Siri to turn "All Lights" ON.

migabc commented 7 years ago

Yes, I know that. But when I command it via Siri the switch stays ON (does not return to previous state) and the Lights are not turned off.

When I press the Homekit button on the app it works perfectly.

Strange!!

migabc commented 7 years ago

Any idea why it works fine with the app but not with Siri?

snowdd1 commented 7 years ago

That's really strange. Maybe I find some time next weekend to set up my dev environment to test that. What iOS are you on?

migabc commented 7 years ago

OK, Thx. I'm on iOS 10.3.2 Same problem on iPad, iPhone or Apple TV (Siri just responds that it has been activated but in fact it has not - and when I check the app I see that the switch changed to ON but did not return to previous state)

P.S. What about the GarageDoorOpener reversing issue? Any news on this one?

migabc commented 7 years ago

Hi,

Any news on the GarageDoorOpener reversing issue? Were you able to add "Reverse" support on the incoming value in HomeKit from KNX:

            {
                "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/12"
                        ],
                        "DPT": "DPT1",
                        "Reverse": true
                    }
                ],
                "KNXReadRequests": [
                    "7/1/12"
                ],
                "subtype": "SUB_b3b2b56a-29ca-4065-9250-d8741957eeaf"
            },

Thanks, Miguel

migabc commented 7 years ago

Hi,

Since the "Reverse" action does not work for the CurrentDoorState I solved the issue by doing the reversing in a handler

onKNXValueChange(field, oldValue, knxValue) {
            . . .
    if (field==="CurrentDoorState") {
        this.myAPI.setValue("CurrentDoorState", 1-knxValue);
    }

It's working OK.

Thanks, Miguel

unaxboy commented 6 years ago

Hi snowdd1,

Any news on "Reverse" support on the incoming value in HomeKit from KNX?

I have the same issue, but with LockMechanism.

Mr-S-D commented 6 years ago

@migabc How did you solve your push button situation for your garage? I also have a garage opener that works like yours... 1 -> Up 1 -> Stop 1 -> Down 1 -> Stop . . .

I am struggling with this one!! Help :)

BR, Mr.D

snowdd1 commented 4 years ago

There are now multiple handlers for garage doors, the ADVANCED one should fit your needs.