node-red-contrib-homekit-bridged: window covering " current state "not working at all

searched around the web everywhere and tried different flows from other people but can’t get it to work at all.

I can add and control the window coverings through homekit but the current state is never right.

the flow from @crxporter when the shutters are open it displays closed on homekit , then when I click it show spinning wheel as if its opens the currents but off course nothing happens because they are already open, but when I click again to close they actually close`

I added a video to show the problem and the flow from it

hope someone can figure this out

thx

video hope you guys can view it, didn’t know how to show else on GitHub https://share.icloud.com/photos/0rTEhywAWEf3YPFDpNfc7iSTA#Wervik_-_Geluwe

flow:

[{“id”:“293fb4d.0d8f1cc”,“type”:“tab”,“label”:“Flow 1”,“disabled”:false,“info”:“”},{“id”:“320daa8e.7b5226”,“type”:“function”,“z”:“293fb4d.0d8f1cc”,“name”:“Target Position”,“func”:“var input = msg.payload;\nvar delay = {payload:0};\nif(input < 101){\n msg.payload = {\n "TargetPosition": input\n };\n delay.payload = {\n "CurrentPosition": input\n };\n return [msg,delay];\n}”,“outputs”:2,“noerr”:0,“x”:220,“y”:60,“wires”:[[“5fe1c5be.2da3a4”],[“3794b37e.5f61c4”]]},{“id”:“5fe1c5be.2da3a4”,“type”:“homekit-service”,“z”:“293fb4d.0d8f1cc”,“isParent”:true,“bridge”:“4bc87cd0.337f6c”,“parentService”:“”,“name”:“Window”,“serviceName”:“WindowCovering”,“topic”:“”,“filter”:false,“manufacturer”:“geani”,“model”:“rolluik”,“serialNo”:“2”,“cameraConfigVideoProcessor”:“”,“cameraConfigSource”:“”,“cameraConfigStillImageSource”:“”,“cameraConfigMaxStreams”:“”,“cameraConfigMaxWidth”:“”,“cameraConfigMaxHeight”:“”,“cameraConfigMaxFPS”:“”,“cameraConfigMaxBitrate”:“”,“cameraConfigVideoCodec”:“”,“cameraConfigAudioCodec”:“”,“cameraConfigAudio”:false,“cameraConfigPacketSize”:“”,“cameraConfigVerticalFlip”:false,“cameraConfigHorizontalFlip”:false,“cameraConfigMapVideo”:“”,“cameraConfigMapAudio”:“”,“cameraConfigVideoFilter”:“”,“cameraConfigAdditionalCommandLine”:“”,“cameraConfigDebug”:false,“cameraConfigSnapshotOutput”:“disabled”,“cameraConfigInterfaceName”:“”,“characteristicProperties”:“{"Brightness":true}”,“x”:560,“y”:60,“wires”:[[“53512652.d14d88”],[]]},{“id”:“3794b37e.5f61c4”,“type”:“delay”,“z”:“293fb4d.0d8f1cc”,“name”:“”,“pauseType”:“delay”,“timeout”:“12”,“timeoutUnits”:“seconds”,“rate”:“1”,“nbRateUnits”:“1”,“rateUnits”:“second”,“randomFirst”:“1”,“randomLast”:“5”,“randomUnits”:“seconds”,“drop”:false,“x”:400,“y”:100,“wires”:[[“5fe1c5be.2da3a4”]]},{“id”:“49e17f83.3e741”,“type”:“openhab2-in”,“z”:“293fb4d.0d8f1cc”,“name”:“Window”,“controller”:“1324a901.5aef0f”,“itemname”:“RolluikVooraan_Rollershutter”,“x”:80,“y”:120,“wires”:[[“320daa8e.7b5226”],[]]},{“id”:“53512652.d14d88”,“type”:“function”,“z”:“293fb4d.0d8f1cc”,“name”:“Curtain Out”,“func”:“var t = context.get(‘t’)||0;\nvar delay = {payload:0}\nif(msg.payload.TargetPosition){\n t = msg.payload.TargetPosition;\n context.set(‘t’,t);\n msg.payload=t\n}\nif(msg.payload.TargetPosition === 0){\n t = msg.payload.TargetPosition;\n context.set(‘t’,t);\n msg.payload=t\n}\nif (msg.hap.context !== undefined){\n delay.payload = {\n "CurrentPosition": t\n };\n return [msg,delay]\n}”,“outputs”:2,“noerr”:0,“x”:710,“y”:60,“wires”:[[“a99a1867.9f4ea”],[“b9f9948.6680968”]]},{“id”:“471228ad.f257a”,“type”:“link in”,“z”:“293fb4d.0d8f1cc”,“name”:“”,“links”:[“b9f9948.6680968”],“x”:295,“y”:120,“wires”:[[“3794b37e.5f61c4”]]},{“id”:“a99a1867.9f4ea”,“type”:“openhab2-out”,“z”:“293fb4d.0d8f1cc”,“name”:“Window”,“controller”:“1324a901.5aef0f”,“itemname”:“RolluikVooraan_Rollershutter”,“topic”:“ItemCommand”,“payload”:“”,“x”:880,“y”:60,“wires”:[[]]},{“id”:“b9f9948.6680968”,“type”:“link out”,“z”:“293fb4d.0d8f1cc”,“name”:“”,“links”:[“471228ad.f257a”],“x”:855,“y”:120,“wires”:[]},{“id”:“3f718ce3.acc744”,“type”:“inject”,“z”:“293fb4d.0d8f1cc”,“name”:“”,“topic”:“”,“payload”:“{"TargetPosition": 0}”,“payloadType”:“json”,“repeat”:“”,“crontab”:“”,“once”:false,“onceDelay”:0.1,“x”:350,“y”:200,“wires”:[[“5fe1c5be.2da3a4”]]},{“id”:“5fbcfe45.80989”,“type”:“inject”,“z”:“293fb4d.0d8f1cc”,“name”:“”,“topic”:“”,“payload”:“{"CurrentPosition": 0}”,“payloadType”:“json”,“repeat”:“”,“crontab”:“”,“once”:false,“onceDelay”:0.1,“x”:380,“y”:360,“wires”:[[“5fe1c5be.2da3a4”]]},{“id”:“4bc87cd0.337f6c”,“type”:“homekit-bridge”,“z”:“”,“bridgeName”:“Rolluik achter”,“pinCode”:“111-11-201”,“port”:“”,“allowInsecureRequest”:false,“manufacturer”:“Default Manufacturer”,“model”:“Default Model”,“serialNo”:“Default Serial Number”,“customMdnsConfig”:false,“mdnsMulticast”:true,“mdnsInterface”:“”,“mdnsPort”:“”,“mdnsIp”:“”,“mdnsTtl”:“”,“mdnsLoopback”:true,“mdnsReuseAddr”:true,“allowMessagePassthrough”:true},{“id”:“1324a901.5aef0f”,“type”:“openhab2-controller”,“z”:“”,“name”:“Pi bridge”,“protocol”:“http”,“host”:"192.168.0.1

3",“port”:“8080”,“path”:“”,“username”:“”,“password”:“”}]

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 38 (17 by maintainers)

Most upvoted comments

Figured out if I use the Niko app the shutters not showing correctly in openHAB so wil ask the creator tomorrow if he is aware off. I’ll get back to you afterwards

I think I see what’s happening, I’m going to rework the functions a bit and send new copies

[{"id":"293fb4d.0d8f1cc","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"320daa8e.7b5226","type":"function","z":"293fb4d.0d8f1cc","name":"Target Position","func":"var input = msg.payload;\nvar delay = {payload:0};\nif(input < 101){\n msg.payload = {\n \"TargetPosition\": input\n };\n delay.payload = {\n \"CurrentPosition\": input\n };\n return [msg,delay];\n}","outputs":2,"noerr":0,"x":220,"y":60,"wires":[["5fe1c5be.2da3a4"],["3794b37e.5f61c4"]]},{"id":"5fe1c5be.2da3a4","type":"homekit-service","z":"293fb4d.0d8f1cc","isParent":true,"bridge":"4bc87cd0.337f6c","parentService":"","name":"Window","serviceName":"WindowCovering","topic":"","filter":false,"manufacturer":"geani","model":"rolluik","serialNo":"2","cameraConfigVideoProcessor":"","cameraConfigSource":"","cameraConfigStillImageSource":"","cameraConfigMaxStreams":"","cameraConfigMaxWidth":"","cameraConfigMaxHeight":"","cameraConfigMaxFPS":"","cameraConfigMaxBitrate":"","cameraConfigVideoCodec":"","cameraConfigAudioCodec":"","cameraConfigAudio":false,"cameraConfigPacketSize":"","cameraConfigVerticalFlip":false,"cameraConfigHorizontalFlip":false,"cameraConfigMapVideo":"","cameraConfigMapAudio":"","cameraConfigVideoFilter":"","cameraConfigAdditionalCommandLine":"","cameraConfigDebug":false,"cameraConfigSnapshotOutput":"disabled","cameraConfigInterfaceName":"","characteristicProperties":"{\"Brightness\":true}","x":560,"y":60,"wires":[["53512652.d14d88"],[]]},{"id":"3794b37e.5f61c4","type":"delay","z":"293fb4d.0d8f1cc","name":"","pauseType":"delay","timeout":"12","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":400,"y":100,"wires":[["5fe1c5be.2da3a4"]]},{"id":"49e17f83.3e741","type":"openhab2-in","z":"293fb4d.0d8f1cc","name":"Window","controller":"1324a901.5aef0f","itemname":"RolluikVooraan_Rollershutter","x":80,"y":120,"wires":[["320daa8e.7b5226"],[]]},{"id":"53512652.d14d88","type":"function","z":"293fb4d.0d8f1cc","name":"Curtain Out","func":"var t = context.get('t')||0;\nvar delay = {payload:0}\nif(msg.payload.TargetPosition){\n t = msg.payload.TargetPosition;\n context.set('t',t);\n msg.payload=t\n}\nif(msg.payload.TargetPosition === 0){\n t = msg.payload.TargetPosition;\n context.set('t',t);\n msg.payload=t\n}\nif (msg.hap.context !== undefined){\n delay.payload = {\n \"CurrentPosition\": t\n };\n return [msg,delay]\n}","outputs":2,"noerr":0,"x":710,"y":60,"wires":[["a99a1867.9f4ea"],["b9f9948.6680968"]]},{"id":"471228ad.f257a","type":"link in","z":"293fb4d.0d8f1cc","name":"","links":["b9f9948.6680968"],"x":295,"y":120,"wires":[["3794b37e.5f61c4"]]},{"id":"a99a1867.9f4ea","type":"openhab2-out","z":"293fb4d.0d8f1cc","name":"Window","controller":"1324a901.5aef0f","itemname":"RolluikVooraan_Rollershutter","topic":"ItemCommand","payload":"","x":880,"y":60,"wires":[[]]},{"id":"b9f9948.6680968","type":"link out","z":"293fb4d.0d8f1cc","name":"","links":["471228ad.f257a"],"x":855,"y":120,"wires":[]},{"id":"3f718ce3.acc744","type":"inject","z":"293fb4d.0d8f1cc","name":"","topic":"","payload":"{\"TargetPosition\": 0}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":350,"y":200,"wires":[["5fe1c5be.2da3a4"]]},{"id":"5fbcfe45.80989","type":"inject","z":"293fb4d.0d8f1cc","name":"","topic":"","payload":"{\"CurrentPosition\": 0}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":380,"y":360,"wires":[["5fe1c5be.2da3a4"]]},{"id":"4bc87cd0.337f6c","type":"homekit-bridge","z":"","bridgeName":"Rolluik achter","pinCode":"111-11-201","port":"","allowInsecureRequest":false,"manufacturer":"Default Manufacturer","model":"Default Model","serialNo":"Default Serial Number","customMdnsConfig":false,"mdnsMulticast":true,"mdnsInterface":"","mdnsPort":"","mdnsIp":"","mdnsTtl":"","mdnsLoopback":true,"mdnsReuseAddr":true,"allowMessagePassthrough":true},{"id":"1324a901.5aef0f","type":"openhab2-controller","z":"","name":"Pi bridge","protocol":"http","host":"192.168.0.13","port":"8080","path":"","username":"","password":""}]