deconz-community / node-red-contrib-deconz

Node-Red Nodes for deCONZ connectivity.
GNU General Public License v3.0
84 stars 16 forks source link

Window Covering does not work with homekit node #196

Closed Nazarbayevv closed 2 years ago

Nazarbayevv commented 2 years ago

Current Behavior

Deconz outpoot node doesn't respond to homekit's node requests, when I use Homekit type of commands: image

Expected Behavior

It works, when I use windows cover mode and set lift field as expression with velue: (100 - msg.payload.TargetPosition). But it's not very user frendly. image

Steps To Reproduce

image

Example flow

[{"id":"4b90078f.78cc28","type":"homekit-service","z":"f7380f55.3bcd1","isParent":true,"bridge":"c887541e.9bc998","parentService":"","name":"Занавеска","serviceName":"WindowCovering","topic":"","filter":false,"manufacturer":"NRCHKB","model":"1.3.5","serialNo":"Default Serial Number","firmwareRev":"1.3.5","hardwareRev":"1.3.5","softwareRev":"1.3.5","cameraConfigVideoProcessor":"ffmpeg","cameraConfigSource":"","cameraConfigStillImageSource":"","cameraConfigMaxStreams":2,"cameraConfigMaxWidth":1280,"cameraConfigMaxHeight":720,"cameraConfigMaxFPS":10,"cameraConfigMaxBitrate":300,"cameraConfigVideoCodec":"libx264","cameraConfigAudioCodec":"libfdk_aac","cameraConfigAudio":false,"cameraConfigPacketSize":1316,"cameraConfigVerticalFlip":false,"cameraConfigHorizontalFlip":false,"cameraConfigMapVideo":"0:0","cameraConfigMapAudio":"0:1","cameraConfigVideoFilter":"scale=1280:720","cameraConfigAdditionalCommandLine":"-tune zerolatency","cameraConfigDebug":false,"cameraConfigSnapshotOutput":"disabled","cameraConfigInterfaceName":"","characteristicProperties":"{}","waitForSetupMsg":false,"outputs":2,"x":370,"y":4400,"wires":[["3a2e11926a079c60"],[]]},{"id":"684ae8fe7ab2f05b","type":"deconz-input","z":"f7380f55.3bcd1","name":"","topic":"","config_version":2,"server":"da76db0b.163948","statustext":"","statustext_type":"default","search_type":"device","device_list":["lights/uniqueid/5c:02:72:ff:fe:e1:60:3f-01"],"device_name":"","query":"{}","outputs":1,"output_rules":[{"type":"homekit","format":"single","onstart":true,"onerror":true,"payload":["CurrentPosition","TargetPosition"]}],"x":170,"y":4400,"wires":[["4b90078f.78cc28"]]},{"id":"3a2e11926a079c60","type":"deconz-output","z":"f7380f55.3bcd1","name":"","config_version":2,"server":"da76db0b.163948","statustext":"","statustext_type":"default","search_type":"device","device_list":["lights/uniqueid/5c:02:72:ff:fe:e1:60:3f-01"],"device_name":"","query":"{}","commands":[{"arg":{"payload":{"type":"msg","value":"payload"},"transitiontime":{"type":"num","value":""},"retryonerror":{"type":"num","value":"0"},"aftererror":{"type":"continue","value":""}},"type":"homekit","domain":""}],"specific":{"delay":{"type":"num","value":"50"},"result":{"type":"at_end","value":""}},"x":590,"y":4400,"wires":[[]]},{"id":"c887541e.9bc998","type":"homekit-bridge","bridgeName":"Node-RED_Access","pinCode":"400-44-000","port":"","allowInsecureRequest":false,"manufacturer":"NRCHKB","model":"1.2.0","serialNo":"Default Serial Number","firmwareRev":"1.2.0","hardwareRev":"1.2.0","softwareRev":"1.2.0","customMdnsConfig":false,"mdnsMulticast":true,"mdnsInterface":"","mdnsPort":"","mdnsIp":"","mdnsTtl":"","mdnsLoopback":true,"mdnsReuseAddr":true,"allowMessagePassthrough":false},{"id":"da76db0b.163948","type":"deconz-server","name":"Deconz","config_version":1,"ip":"192.168.88.9","port":"80","ws_port":"443","secure":false,"polling":"15"}]

Environment

Zehir commented 2 years ago

The fix is published in 2.3.1

Nazarbayevv commented 2 years ago

Hello. 2.3.1 doesn't work correctly in my case.

Every time it's close my window cover. If i try to close cover - ok, if I try to open window cover - it's open cover on 1% and close again. When I try to set persent of position - it's close mu window cover.

Zehir commented 2 years ago

Could you send the deconz events logs related to this beavior ?

Nazarbayevv commented 2 years ago

Logs from node red debug or logs from deconz-gui? Or any other logs?

Zehir commented 2 years ago

Logs from node red debug or logs from deconz-gui? Or any other logs?

Just plug an debug log after the input node to see what you get from deconz and also after the output node to see what you sent to it

Nazarbayevv commented 2 years ago

image 1-st debug: 28.01.2022, 18:45:54 node: 1 payload :

{
    CurrentPosition: 1,
    TargetPosition: 1
}

2-nd debug: 28.01.2022, 18:45:52 node: 2

{
    TargetPosition: 30
}

3-rd debug: 28.01.2022, 18:45:52node: 3

[
    {
        result: {
            lift: 100
        },
        request: {
            lift: 100
        },
        meta: {
            etag: "130ab19bffcc733b9821605fc9686f9e",
            hascolor: false,
            lastannounced: "2022-01-07T16:03:30Z",
            lastseen: "2022-01-07T16:03Z",
            manufacturername: "_TZE200_xuzcvlku",
            modelid: "TS0601",
            name: "Занавеска",
            state: {}, // Missing data from log
            swversion: null,
            type: "Window covering device",
            uniqueid: "5c:02:72:ff:fe:e1:60:3f-01",
            device_type: "lights",
            device_id: 44,
            device_path: "lights/uniqueid/5c:02:72:ff:fe:e1:60:3f-01"
        }
    }
]
Zehir commented 2 years ago

Could you send an export of your flow ?

Zehir commented 2 years ago

Could you try this :

Close the windows cover. Clear all logs Open the cover with the homekit app. Wait 10 seconds after the cover stop moving. Then send all logs you get from the nodes.

Zehir commented 2 years ago

For the next debug logs could you use the copy value button ? image

Nazarbayevv commented 2 years ago

Could you send an export of your flow ?

[{"id":"276cd89c880e0727","type":"deconz-input","z":"62a84518.fc2e2c","name":"","topic":"","config_version":2,"server":"da76db0b.163948","statustext":"","statustext_type":"default","search_type":"device","device_list":["lights/uniqueid/5c:02:72:ff:fe:e1:60:3f-01"],"device_name":"","query":"{}","outputs":1,"output_rules":[{"type":"homekit","format":"single","onstart":true,"onerror":true,"payload":["CurrentPosition","TargetPosition"],"uniqueId":"ui-id-11"}],"x":150,"y":480,"wires":[["c5e9ee34a4573cd3","37b4a55ad6577a83"]]},{"id":"0745d4f5296d7bae","type":"deconz-output","z":"62a84518.fc2e2c","name":"","config_version":2,"server":"da76db0b.163948","statustext":"","statustext_type":"default","search_type":"device","device_list":["lights/uniqueid/5c:02:72:ff:fe:e1:60:3f-01"],"device_name":"","query":"{}","commands":[{"arg":{"payload":{"type":"msg","value":"payload"},"transitiontime":{"type":"num","value":""},"retryonerror":{"type":"num","value":"0"},"aftererror":{"type":"continue","value":""}},"type":"homekit","domain":"","uniqueId":"ui-id-10"}],"specific":{"delay":{"type":"num","value":"50"},"result":{"type":"at_end","value":""}},"x":610,"y":480,"wires":[["908997aa4d3bfc5b"]]},{"id":"c5e9ee34a4573cd3","type":"debug","z":"62a84518.fc2e2c","name":"1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":300,"y":400,"wires":[]},{"id":"59fb1951dfad846a","type":"debug","z":"62a84518.fc2e2c","name":"2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":540,"y":400,"wires":[]},{"id":"908997aa4d3bfc5b","type":"debug","z":"62a84518.fc2e2c","name":"3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":790,"y":400,"wires":[]},{"id":"37b4a55ad6577a83","type":"homekit-service","z":"62a84518.fc2e2c","isParent":true,"hostType":"0","bridge":"c887541e.9bc998","accessoryId":"","parentService":"","name":"test","serviceName":"WindowCovering","topic":"","filter":false,"manufacturer":"NRCHKB","model":"1.4.3","serialNo":"Default Serial Number","firmwareRev":"1.4.3","hardwareRev":"1.4.3","softwareRev":"1.4.3","cameraConfigVideoProcessor":"ffmpeg","cameraConfigSource":"","cameraConfigStillImageSource":"","cameraConfigMaxStreams":2,"cameraConfigMaxWidth":1280,"cameraConfigMaxHeight":720,"cameraConfigMaxFPS":10,"cameraConfigMaxBitrate":300,"cameraConfigVideoCodec":"libx264","cameraConfigAudioCodec":"libfdk_aac","cameraConfigAudio":false,"cameraConfigPacketSize":1316,"cameraConfigVerticalFlip":false,"cameraConfigHorizontalFlip":false,"cameraConfigMapVideo":"0:0","cameraConfigMapAudio":"0:1","cameraConfigVideoFilter":"scale=1280:720","cameraConfigAdditionalCommandLine":"-tune zerolatency","cameraConfigDebug":false,"cameraConfigSnapshotOutput":"disabled","cameraConfigInterfaceName":"","characteristicProperties":"{}","waitForSetupMsg":false,"outputs":2,"x":370,"y":480,"wires":[["59fb1951dfad846a","0745d4f5296d7bae"],[]]},{"id":"da76db0b.163948","type":"deconz-server","name":"Deconz","config_version":1,"ip":"192.168.88.9","port":"80","ws_port":"443","secure":false,"polling":"15"},{"id":"c887541e.9bc998","type":"homekit-bridge","bridgeName":"Node-RED_Access","pinCode":"400-44-000","port":"","allowInsecureRequest":false,"manufacturer":"NRCHKB","model":"1.2.0","serialNo":"Default Serial Number","firmwareRev":"1.2.0","hardwareRev":"1.2.0","softwareRev":"1.2.0","customMdnsConfig":false,"mdnsMulticast":true,"mdnsInterface":"","mdnsPort":"","mdnsIp":"","mdnsTtl":"","mdnsLoopback":true,"mdnsReuseAddr":true,"allowMessagePassthrough":false}]

Nazarbayevv commented 2 years ago

Could you try this :

Close the windows cover. Clear all logs Open the cover with the homekit app. Wait 10 seconds after the cover stop moving. Then send all logs you get from the nodes.

image

  1. node: 2 {"TargetPosition":100}

  2. node: 3 [{"result":{"lift":100},"request":{"lift":100},"meta":{"etag":"abd929da9e2df64c4a7be025097a81f5","hascolor":false,"lastannounced":"2022-01-07T16:03:30Z","lastseen":"2022-01-07T16:03Z","manufacturername":"_TZE200_xuzcvlku","modelid":"TS0601","name":"Занавеска","state":{"alert":"none","bri":254,"lift":100,"on":true,"open":false,"reachable":true},"swversion":null,"type":"Window covering device","uniqueid":"5c:02:72:ff:fe:e1:60:3f-01","device_type":"lights","device_id":44,"device_path":"lights/uniqueid/5c:02:72:ff:fe:e1:60:3f-01"}}]

  3. node: 1 {"CurrentPosition":1,"TargetPosition":1}

Cover trying to open, but stoping on 1%

Nazarbayevv commented 2 years ago

Other example: my winow covering was opened on 8% and i tried to open on 29%. My winow covering closed: image

1. {"TargetPosition":29}

  1. [{"result":{"lift":100},"request":{"lift":100},"meta":{"etag":"4329753f1cfe3c38c62f420781cd27e7","hascolor":false,"lastannounced":"2022-01-07T16:03:30Z","lastseen":"2022-01-07T16:03Z","manufacturername":"_TZE200_xuzcvlku","modelid":"TS0601","name":"Занавеска","state":{"alert":"none","bri":233,"lift":92,"on":true,"open":true,"reachable":true},"swversion":null,"type":"Window covering device","uniqueid":"5c:02:72:ff:fe:e1:60:3f-01","device_type":"lights","device_id":44,"device_path":"lights/uniqueid/5c:02:72:ff:fe:e1:60:3f-01"}}]
  2. {"CurrentPosition":0,"TargetPosition":0}
  3. {"CurrentPosition":7,"TargetPosition":7}
  4. {"CurrentPosition":5,"TargetPosition":5}
  5. {"CurrentPosition":3,"TargetPosition":3}
  6. {"CurrentPosition":1,"TargetPosition":1}
  7. {"CurrentPosition":0,"TargetPosition":0}
Zehir commented 2 years ago

I don't undestand what is not working properly. Could you change the debug nodes to display the complete msg instead of msg.payload ?

Zehir commented 2 years ago

I found the issue, could you test with version 2.3.3 ?

Nazarbayevv commented 2 years ago

My issue was fixed in 2.3.3. Thank you.