Apollon77 / ioBroker.homekit-controller

Pair and control HomeKit devices directly

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IT4WIFI position-hold option not working

disaster123 opened this issue · comments

Describe the bug

Homekit-Controller detects device option as bool but device expects 0 / 1 as number values.

{
  "type": "state",
  "common": {
    "name": "",
    "read": false,
    "write": true,
    "type": "boolean",
    "role": "button"
  },
  "native": {
    "iid": 14,
    "type": "0000006F-0000-1000-8000-0026BB765291",
    "perms": [
      "pw"
    ],
    "format": "bool",
    "aid": "1",
    "serviceUuid": "00000041-0000-1000-8000-0026BB765291"
  },
  "_id": "homekit-controller.0.IP-86:FC:20:76:77:08.1.garage-door-opener-2.position-hold",
  "acl": {
    "object": 1636,
    "state": 1636,
    "owner": "system.user.admin",
    "ownerGroup": "system.group.administrator"
  },
  "from": "system.adapter.homekit-controller.0",
  "user": "system.user.admin",
  "ts": 1686741245935
}

To Reproduce
Steps to reproduce the behavior:

  1. buy a IT4WIFI device from nice
  2. try to set value for position-hold

Expected behavior
Value should be accepted by device.

Screenshots & Logfiles

Not sure which logfiles are needed.

homekit-controller.0 | 2023-06-16 08:13:54.911 | debug | IP-86:FC:20:76:77:08 Accessory Structure: {"accessories":[{"aid":1,"services":[{"iid":1,"type":"0000003E-0000-1000-8000-0026BB765291","characteristics":[{"iid":4,"type":"00000023-0000-1000-8000-0026BB765291","value":"NiceIT4WIFI712D10","perms":["pr"],"format":"string","maxLen":64},{"iid":5,"type":"00000014-0000-1000-8000-0026BB765291","perms":["pw"],"format":"bool"},{"iid":6,"type":"00000020-0000-1000-8000-0026BB765291","value":"Nice Spa ","perms":["pr"],"format":"string","maxLen":64},{"iid":7,"type":"00000021-0000-1000-8000-0026BB765291","value":"IT4WIFI","perms":["pr"],"format":"string","maxLen":64},{"iid":8,"type":"00000030-0000-1000-8000-0026BB765291","value":"0Q01231200H9225CE","perms":["pr"],"format":"string","maxLen":64},{"iid":9,"type":"00000052-0000-1000-8000-0026BB765291","value":"0.3.2","perms":["pr"],"format":"string"}]},{"iid":2,"type":"00000041-0000-1000-8000-0026BB765291","characteristics":[{"iid":10,"type":"0000000E-0000-1000-8000-0026BB765291","value":1,"perms":["pr","ev"],"format":"uint8","minValue":0,"maxValue":4,"minStep":1},{"iid":11,"type":"00000032-0000-1000-8000-0026BB765291","value":1,"perms":["pr","pw","ev"],"format":"uint8","minValue":0,"maxValue":1,"minStep":1},{"iid":12,"type":"00000024-0000-1000-8000-0026BB765291","value":0,"perms":["pr","ev"],"format":"bool"},{"iid":13,"type":"00000023-0000-1000-8000-0026BB765291","value":"Garage Door ","perms":["pr"],"format":"string","maxLen":64},{"iid":14,"type":"0000006F-0000-1000-8000-0026BB765291","perms":["pw"],"format":"bool"}]},{"iid":3,"type":"D639B30A-0268-4824-9F82-CB03B449D5F0","characteristics":[{"iid":15,"type":"D66FD9FA-4D09-47F2-AB5F-298700DD92AC","perms":["pw","hd"],"format":"bool"}]}]}]}
-- | -- | -- | --

position-hold "iid":14 should be write only and bool as 0 / 1 values instead of true and false. This works also fine with homekit implementation of apple itself. As i don't expect that apple implemented a workaround for this device i think this must be a bug in homelkit implementation or apple always sends 0 / 1 instead of true false.

Thanks a lot for your great work @Apollon77 !

I can help with testing. I also use an it4wifi.

I can fix this issue by manually assigning type number with min / max 0 / 1 to position-hold - but this gets overidden by homekit-controller after restarting instance.

I ned to check WHERE i need to fix that

If i can help or check anything please give me a note.

Ikea accessories have the same problem. Homekit-Controller detects device option as number but device received Boolean.

{
"type": "state",
"common": {
"name": "",
"read": true,
"write": false,
"min": 0,
"max": 1,
"step": 1,
"type": "number",
"role": "indicator.lowbat",
"custom": {
"history.0": {
"enabled": true,
"aliasId": "",
"debounceTime": 0,
"blockTime": 0,
"changesOnly": true,
"changesRelogInterval": 0,
"changesMinDelta": 0,
"ignoreBelowNumber": "",
"disableSkippedValueLogging": true,
"retention": 31536000,
"customRetentionDuration": 365,
"maxLength": 960,
"enableDebugLogs": false,
"debounce": 1000
}
}
},
"native": {
"iid": 227,
"type": "00000079-0000-1000-8000-0026BB765291",
"format": "uint8",
"perms": [
"pr",
"ev"
],
"ev": false,
"enc": false,
"minValue": 0,
"maxValue": 1,
"minStep": 1,
"aid": "808958426756566785",
"serviceUuid": "00000096-0000-1000-8000-0026BB765291"
},
"_id": "homekit-controller.0.IP-1A:49:24:D2:FB:3A.808958426756566785.battery-224.status-lo-batt",
"acl": {
"object": 1636,
"state": 1636,
"owner": "system.user.admin",
"ownerGroup": "system.group.administrator"
},
"from": "system.adapter.homekit-controller.0",
"user": "system.user.admin",
"ts": 1691657023724
}

State value to set for "homekit-controller.0.IP-1A:49:24:D2:FB:3A.2370808173038947585.battery-224.status-lo-batt" has to be type "number" but received type "boolean"

Please try GitHub version

@Apollon77 great - position hold is now working!! Thanks a lot!