yenoiwesa / homebridge-connexoon

A homebridge plugin to integrate Somfy blinds with the Connexoon RTS hub
Apache License 2.0
27 stars 2 forks source link

Can't control Awning #79

Open Honigbrot opened 1 year ago

Honigbrot commented 1 year ago

Thanks to the latest update my shutters work perfectly. I tried to also control my Awning (Somfy RTS, same multi-channel remote as my shutters) via homebridge. It works flawlessly in the TaHoma app. However the homebridge plugin produces the following error message when trying to open / close via homebridge:

[26.2.2023, 16:37:03] [My Connexoon Hub] Failed to exec command {
  errorCode: 'UNSUPPORTED_OPERATION',
  error: 'No such command : open on device ogp://2105-5099-3932/9365770 (ogp:Awning)'
}
[26.2.2023, 16:37:03] [My Connexoon Hub] StatusCodeError: 400 - {"errorCode":"UNSUPPORTED_OPERATION","error":"No such command : open on device ogp://2105-5099-3932/9365770 (ogp:Awning)"}
    at new StatusCodeError (/usr/local/lib/node_modules/homebridge-connexoon/node_modules/request-promise-core/lib/errors.js:32:15)
    at Request.plumbing.callback (/usr/local/lib/node_modules/homebridge-connexoon/node_modules/request-promise-core/lib/plumbing.js:104:33)
    at Request.RP$callback [as _callback] (/usr/local/lib/node_modules/homebridge-connexoon/node_modules/request-promise-core/lib/plumbing.js:46:31)
    at Request.self.callback (/usr/local/lib/node_modules/homebridge-connexoon/node_modules/request/request.js:185:22)
    at Request.emit (node:events:390:28)
    at Request.<anonymous> (/usr/local/lib/node_modules/homebridge-connexoon/node_modules/request/request.js:1154:10)
    at Request.emit (node:events:390:28)
    at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/homebridge-connexoon/node_modules/request/request.js:1076:12)
    at Object.onceWrapper (node:events:509:28)
    at IncomingMessage.emit (node:events:402:35) {
  statusCode: 400,
  error: {
    errorCode: 'UNSUPPORTED_OPERATION',
    error: 'No such command : open on device ogp://2105-5099-3932/9365770 (ogp:Awning)'
  },
  options: {
    auth: {
      bearer: 'NmI4MGM3YzY4YzFmNjMyNzY1MzMwOGVhMjlhY2I1NTNjNTQzZjlkNzdhOGMxYWVjNmRhYWY3M2I2YzFhZjNkNQ'
    },
    url: 'https://ha101-1.overkiz.com/enduser-mobile-web/enduserAPI/exec/apply',
    json: true,
    body: Execution { label: 'Markise - Open - HomeKit', actions: [Array] },
    method: 'POST',
    callback: [Function: RP$callback],
    transform: undefined,
    simple: true,
    resolveWithFullResponse: false,
    transform2xxOnly: false
  },
yenoiwesa commented 1 year ago

Okay so the problem is that your Awning is an OGP device, which is a slightly different protocol. It does not support the open command on your Awning, which is the method the plugin sends.

After looking at other plugins, it seems that Awnings expect deploy and undeploy commands to be sent instead of open and close.

I currently do not support this obviously but also this would require some effort to implement unfortunately.

I have will mark this ticket as enhancement and try to implement it one day if I have time.

Honigbrot commented 10 months ago

Wouldn't the optional parameter "command" solve that? Or is there a fundamentally different approach because of the difference in device type?

Honigbrot commented 10 months ago

Confirmed it. Just setting the commands in the config works for my OGP Awning:

 "devices": {
                "Markise": {
                    "commands": [
                        "deploy",
                        "undeploy"
                    ]
                }
            }
jvhooijdonk commented 9 months ago

Confirmed it. Just setting the commands in the config works for my OGP Awning:

 "devices": {
                "Markise": {
                    "commands": [
                        "deploy",
                        "undeploy"
                    ]
                }
            }

Have the same issue but this din't solve my problem unfortunately.