Closed AarneAarebye closed 1 year ago
Hi, @AarneAarebye can you share the flow?
the Flow meanwhile changed. It is for a sonoff ifan03 [ { "id": "b30538db.37a158", "type": "tab", "label": "Dining Room", "disabled": false, "info": "" }, { "id": "9a9f47fa038941c0", "type": "group", "z": "b30538db.37a158", "name": "Dining Room Fan & Light", "style": { "label": true }, "nodes": [ "37530c04.1309b4", "ba44e017.2e241", "9c9bd3d0.c088c", "2d9c3ae0.c26aa6", "f0be11a8d54e3460", "7222da2c69334e26", "06b083a157da394a", "866380d6.dafee", "d436084e.d6ca98", "f0f846b1.895a48", "a1c292e9.f65d5", "aa90cbf9.74ef58", "fd3980bf.24f86", "7a6cf9a78eb459cd", "f983716c02e62f84", "b7953a003c0c3611", "797ef284466b6305", "06b3b76d8715365d", "78b6a136cab57ef4", "e53a97f9a2906c7a", "9d72f9dfe2ff8055", "b8d7498c755acdd9", "af6ce1e447d58567", "286f06fa692b17c4", "2780a13729750a28" ], "x": 14, "y": 33, "w": 1932, "h": 548 }, { "id": "286f06fa692b17c4", "type": "group", "z": "b30538db.37a158", "g": "9a9f47fa038941c0", "name": "Fan & Light", "style": { "label": true }, "nodes": [ "0a9e52a91d3d8dcd", "e16e72f1.15fa7", "492b4917.9d2d68" ], "x": 814, "y": 59, "w": 192, "h": 202 }, { "id": "37530c04.1309b4", "type": "mqtt in", "z": "b30538db.37a158", "g": "9a9f47fa038941c0", "name": "Ceiling Fan Speed & Light", "topic": "stat/GF-DR-CF-LMP/RESULT", "qos": "2", "datatype": "json", "broker": "6e913629.497e08", "nl": false, "rap": false, "inputs": 0, "x": 150, "y": 240, "wires": [ [ "ba44e017.2e241" ] ] }, { "id": "ba44e017.2e241", "type": "switch", "z": "b30538db.37a158", "g": "9a9f47fa038941c0", "name": "Fan Speed / Light", "property": "payload", "propertyType": "msg", "rules": [ { "t": "hask", "v": "POWER1", "vt": "str" }, { "t": "hask", "v": "POWER2", "vt": "str" }, { "t": "hask", "v": "FanSpeed", "vt": "str" }, { "t": "else" } ], "checkall": "true", "repair": false, "outputs": 4, "x": 430, "y": 240, "wires": [ [ "9c9bd3d0.c088c" ], [ "f0be11a8d54e3460" ], [ "2d9c3ae0.c26aa6" ], [ "7222da2c69334e26" ] ] }, { "id": "9c9bd3d0.c088c", "type": "change", "z": "b30538db.37a158", "g": "9a9f47fa038941c0", "name": "ON/OFF Light", "rules": [ { "t": "move", "p": "payload.POWER1", "pt": "msg", "to": "payload", "tot": "msg" }, { "t": "change", "p": "payload", "pt": "msg", "from": "ON", "fromt": "str", "to": "{\"On\":true}", "tot": "json" }, { "t": "change", "p": "payload", "pt": "msg", "from": "OFF", "fromt": "str", "to": "{\"On\":false}", "tot": "json" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 680, "y": 160, "wires": [ [ "e16e72f1.15fa7" ] ] }, { "id": "2d9c3ae0.c26aa6", "type": "change", "z": "b30538db.37a158", "g": "9a9f47fa038941c0", "name": "Convert", "rules": [ { "t": "move", "p": "payload.FanSpeed", "pt": "msg", "to": "payload", "tot": "msg" }, { "t": "change", "p": "payload", "pt": "msg", "from": "0", "fromt": "num", "to": "{\"RotationSpeed\":0, \"Active\":0}", "tot": "json" }, { "t": "change", "p": "payload", "pt": "msg", "from": "1", "fromt": "num", "to": "{\"RotationSpeed\":33, \"Active\":1}", "tot": "json" }, { "t": "change", "p": "payload", "pt": "msg", "from": "2", "fromt": "num", "to": "{\"RotationSpeed\":66, \"Active\":1}", "tot": "json" }, { "t": "change", "p": "payload", "pt": "msg", "from": "3", "fromt": "num", "to": "{\"RotationSpeed\":100, \"Active\":1}", "tot": "json" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 660, "y": 280, "wires": [ [ "492b4917.9d2d68" ] ] }, { "id": "f0be11a8d54e3460", "type": "change", "z": "b30538db.37a158", "g": "9a9f47fa038941c0", "name": "ON/OFF Fan", "rules": [ { "t": "move", "p": "payload.POWER2", "pt": "msg", "to": "payload", "tot": "msg" }, { "t": "change", "p": "payload", "pt": "msg", "from": "ON", "fromt": "str", "to": "{\"Active\":1}", "tot": "json" }, { "t": "change", "p": "payload", "pt": "msg", "from": "OFF", "fromt": "str", "to": "{\"Active\":0}", "tot": "json" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 670, "y": 220, "wires": [ [ "492b4917.9d2d68" ] ] }, { "id": "7222da2c69334e26", "type": "debug", "z": "b30538db.37a158", "g": "9a9f47fa038941c0", "name": "Otherwise", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 660, "y": 340, "wires": [] }, { "id": "06b083a157da394a", "type": "comment", "z": "b30538db.37a158", "g": "9a9f47fa038941c0", "name": "Fan Attributes", "info": "{\"RotationSpeed\":{\"defaultValue\":33,\"validValue\":[0,33,66,100]}}", "x": 470, "y": 340, "wires": [] }, { "id": "866380d6.dafee", "type": "mqtt out", "z": "b30538db.37a158", "g": "9a9f47fa038941c0", "name": "Ceiling Fan Speed & Light", "topic": "", "qos": "2", "retain": "", "broker": "6e913629.497e08", "x": 1810, "y": 220, "wires": [] }, { "id": "d436084e.d6ca98", "type": "function", "z": "b30538db.37a158", "g": "9a9f47fa038941c0", "name": "DO NOT DELETE", "func": "/ Initialize your variables in \"Setup\" tab. \nReplace the default variable with whatever you\nwould like to send in case of reboot when\nthere is no context variable saved. The\nstatement for \"Active\" is read in english \nlike:\n \"create variable Active for this function\n use the context veriable if there is one\n otherwise set it to 0\"\nThese context variables hold the state of\neach setting so they can be passed to\nother nodes (i.e. Harmony remote, OpenHAB)/\n\nvar Active = context.get('Active');\nvar RotationSpeed = context.get('RotationSpeed');\nvar RotationDirection = context.get('RotationDirection');\nvar SwingMode = context.get('SwingMode');\n\nvar FullOutput = {};\nif (msg.payload.hasOwnProperty(\"Active\")) {\n context.set('Active', msg.payload.Active);\n if (msg.payload.Active === 0) {\n RotationSpeed = 0;\n context.set('RotationSpeed', RotationSpeed);\n } else {\n }\n FullOutput = {\n \"payload\" : context.get('Active') ? \"on\" : \"off\"\n };\n} else if (msg.payload.hasOwnProperty(\"RotationSpeed\")) {\n RotationSpeed = msg.payload.RotationSpeed;\n if (RotationSpeed < 10) {\n RotationSpeed = 0;\n } else if (RotationSpeed >= 10 && RotationSpeed < 50) {\n RotationSpeed = 1;\n } else if (RotationSpeed >= 50 && RotationSpeed < 85) {\n RotationSpeed = 2;\n } else {\n RotationSpeed = 3;\n }\n context.set('RotationSpeed', RotationSpeed);\n FullOutput = {\n \"payload\" : context.get('RotationSpeed')\n };\n} else if (msg.hap.context !== undefined) {\n FullOutput = {\n \"payload\" : context.get('RotationSpeed') \n };\n} else {\n FullOutput = {\n \"payload\" : RotationSpeed\n };\n}\nreturn [FullOutput]\n", "outputs": 1, "noerr": 0, "initialize": "// Code added here will be run once\n// whenever the node is deployed.\ncontext.set('Active', 0);\ncontext.set('RotationSpeed', 0);\ncontext.set('RotationDirection', 0);\ncontext.set('SwingMode', 0);\n", "finalize": "", "x": 1810, "y": 420, "wires": [ [] ], "info": "https://tasmota.github.io/docs/Commands/#control" }, { "id": "f0f846b1.895a48", "type": "change", "z": "b30538db.37a158", "g": "9a9f47fa038941c0", "name": "ON/OFF Light", "rules": [ { "t": "move", "p": "payload.On", "pt": "msg", "to": "payload", "tot": "msg" }, { "t": "change", "p": "payload", "pt": "msg", "from": "true", "fromt": "bool", "to": "ON", "tot": "str" }, { "t": "change", "p": "payload", "pt": "msg", "from": "false", "fromt": "bool", "to": "OFF", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1280, "y": 160, "wires": [ [ "7a6cf9a78eb459cd" ] ] }, { "id": "a1c292e9.f65d5", "type": "change", "z": "b30538db.37a158", "g": "9a9f47fa038941c0", "name": "FanSpeed", "rules": [ { "t": "set", "p": "topic", "pt": "msg", "to": "cmnd/GF-DR-CF-LMP/FanSpeed", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1550, "y": 280, "wires": [ [ "866380d6.dafee" ] ] }, { "id": "aa90cbf9.74ef58", "type": "switch", "z": "b30538db.37a158", "g": "9a9f47fa038941c0", "name": "", "property": "payload", "propertyType": "msg", "rules": [ { "t": "hask", "v": "Active", "vt": "str" }, { "t": "hask", "v": "RotationSpeed", "vt": "str" }, { "t": "else" } ], "checkall": "true", "repair": false, "outputs": 3, "x": 1070, "y": 220, "wires": [ [ "9d72f9dfe2ff8055" ], [ "fd3980bf.24f86" ], [ "b7953a003c0c3611" ] ] }, { "id": "fd3980bf.24f86", "type": "function", "z": "b30538db.37a158", "g": "9a9f47fa038941c0", "name": "RotationSpeed", "func": "var FullOutput = {\n 'payload' : 0\n};\nRotationSpeed = msg.payload.RotationSpeed;\nif (RotationSpeed < 10) {\n FullOutput.payload = 0;\n} else if (RotationSpeed >= 10 && RotationSpeed < 50) {\n FullOutput.payload = 1;\n} else if (RotationSpeed >= 50 && RotationSpeed < 85) {\n FullOutput.payload = 2;\n} else {\n FullOutput.payload = 3;\n}\nreturn [FullOutput];", "outputs": 1, "noerr": 0, "initialize": "// Code added here will be run once\n// whenever the node is deployed.\ncontext.set('Active', 0);\ncontext.set('RotationSpeed', 0);\ncontext.set('RotationDirection', 0);\ncontext.set('SwingMode', 0);\n", "finalize": "", "libs": [], "x": 1280, "y": 280, "wires": [ [ "a1c292e9.f65d5" ] ] }, { "id": "7a6cf9a78eb459cd", "type": "change", "z": "b30538db.37a158", "g": "9a9f47fa038941c0", "name": "POWER1", "rules": [ { "t": "set", "p": "topic", "pt": "msg", "to": "cmnd/GF-DR-CF-LMP/POWER1", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1540, "y": 160, "wires": [ [ "866380d6.dafee" ] ] }, { "id": "f983716c02e62f84", "type": "change", "z": "b30538db.37a158", "g": "9a9f47fa038941c0", "name": "POWER2", "rules": [ { "t": "set", "p": "topic", "pt": "msg", "to": "cmnd/GF-DR-CF-LMP/POWER2", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1540, "y": 220, "wires": [ [ "866380d6.dafee" ] ] }, { "id": "b7953a003c0c3611", "type": "debug", "z": "b30538db.37a158", "g": "9a9f47fa038941c0", "name": "Otherwise", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 1260, "y": 340, "wires": [] }, { "id": "797ef284466b6305", "type": "inject", "z": "b30538db.37a158", "g": "9a9f47fa038941c0", "name": "FanSpeed 0", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "0", "payloadType": "num", "x": 1270, "y": 380, "wires": [ [ "a1c292e9.f65d5" ] ] }, { "id": "06b3b76d8715365d", "type": "inject", "z": "b30538db.37a158", "g": "9a9f47fa038941c0", "name": "FanSpeed 3", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "3", "payloadType": "num", "x": 1270, "y": 500, "wires": [ [ "a1c292e9.f65d5" ] ] }, { "id": "78b6a136cab57ef4", "type": "inject", "z": "b30538db.37a158", "g": "9a9f47fa038941c0", "name": "FanSpeed 2", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "2", "payloadType": "num", "x": 1270, "y": 460, "wires": [ [ "a1c292e9.f65d5" ] ] }, { "id": "e53a97f9a2906c7a", "type": "inject", "z": "b30538db.37a158", "g": "9a9f47fa038941c0", "name": "FanSpeed 1", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "1", "payloadType": "num", "x": 1270, "y": 420, "wires": [ [ "a1c292e9.f65d5" ] ] }, { "id": "9d72f9dfe2ff8055", "type": "change", "z": "b30538db.37a158", "g": "9a9f47fa038941c0", "name": "ON = 33%, OFF = 0%", "rules": [ { "t": "move", "p": "payload.Active", "pt": "msg", "to": "payload", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1300, "y": 220, "wires": [ [ "a1c292e9.f65d5" ] ] }, { "id": "b8d7498c755acdd9", "type": "comment", "z": "b30538db.37a158", "g": "9a9f47fa038941c0", "name": "POWER2: ON and OFF will be set by RotationSpeed in addition automatically", "info": "ON and OFF will be set by RotationSpeed in addition automatically", "x": 1650, "y": 540, "wires": [] }, { "id": "af6ce1e447d58567", "type": "link in", "z": "b30538db.37a158", "g": "9a9f47fa038941c0", "name": "GF-DR-CF-LMP", "links": [ "d157799b2ed89b83" ], "x": 1325, "y": 540, "wires": [ [ "2780a13729750a28" ] ] }, { "id": "0a9e52a91d3d8dcd", "type": "homekit-service", "z": "b30538db.37a158", "d": true, "g": "286f06fa692b17c4", "isParent": true, "hostType": "0", "bridge": "b3af44cd70d89310", "accessoryId": "", "parentService": "", "name": "Fan & Light", "serviceName": "ServiceLabel", "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": 910, "y": 100, "wires": [ [], [] ] }, { "id": "e16e72f1.15fa7", "type": "homekit-service", "z": "b30538db.37a158", "g": "286f06fa692b17c4", "isParent": true, "hostType": "0", "bridge": "b3af44cd70d89310", "accessoryId": "", "parentService": "0a9e52a91d3d8dcd", "name": "Light", "serviceName": "Lightbulb", "topic": "", "filter": false, "manufacturer": "NEWSEE", "model": "DI-005-52", "serialNo": "Default Serial Number", "firmwareRev": "", "hardwareRev": "", "softwareRev": "", "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": 890, "y": 160, "wires": [ [ "f0f846b1.895a48" ], [] ] }, { "id": "492b4917.9d2d68", "type": "homekit-service", "z": "b30538db.37a158", "g": "286f06fa692b17c4", "isParent": true, "hostType": "0", "bridge": "b3af44cd70d89310", "accessoryId": "", "parentService": "0a9e52a91d3d8dcd", "name": "Fan", "serviceName": "Fanv2", "topic": "", "filter": false, "manufacturer": "NEWSEE", "model": "DI-005-52", "serialNo": "Default Serial Number", "firmwareRev": "", "hardwareRev": "", "softwareRev": "", "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": "{\"RotationSpeed\":{\"defaultValue\":33,\"validValue\":[0,33,66,100]}}", "waitForSetupMsg": false, "outputs": 2, "x": 890, "y": 220, "wires": [ [ "aa90cbf9.74ef58" ], [] ], "info": "{\"RotationSpeed\":{\"defaultValue\":33,\"validValue\":[0,33,66,100]}}" }, { "id": "2780a13729750a28", "type": "change", "z": "b30538db.37a158", "g": "9a9f47fa038941c0", "name": "", "rules": [ { "t": "set", "p": "topic", "pt": "msg", "to": "cmnd/GF-DR-CF-LMP/STATUS", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1560, "y": 340, "wires": [ [ "866380d6.dafee" ] ] }, { "id": "6e913629.497e08", "type": "mqtt-broker", "name": "MQTT", "broker": "192.168.178.78", "port": "1883", "clientid": "node-red", "autoConnect": true, "usetls": false, "protocolVersion": 4, "keepalive": "60", "cleansession": true, "birthTopic": "", "birthQos": "0", "birthPayload": "", "closeTopic": "", "closeQos": "0", "closePayload": "", "willTopic": "", "willQos": "0", "willPayload": "" }, { "id": "b3af44cd70d89310", "type": "homekit-bridge", "bridgeName": "Dining-Room", "pinCode": "111-11-111", "port": "", "advertiser": "bonjour-hap", "allowInsecureRequest": false, "manufacturer": "NRCHKB", "model": "1.4.3", "serialNo": "Default Serial Number", "firmwareRev": "1.4.3", "hardwareRev": "1.4.3", "softwareRev": "1.4.3", "customMdnsConfig": false, "mdnsMulticast": true, "mdnsInterface": "", "mdnsPort": "", "mdnsIp": "", "mdnsTtl": "", "mdnsLoopback": true, "mdnsReuseAddr": true, "allowMessagePassthrough": false } ]
Instead of "ServiceLabel" I had "AccessoryInformation" in the flow. Both, fan and bulb were linked to it. Within the "AccessoryInformation" Service Node I created the new bridge. Meanwhile I created several ones with the same error message. Then I did change the "AccessoryInformation" serive node to a "ServiceLabel" on and unlinked the Fan and Light node from it. They act now independent but with the new bridge.
With this new flow including a new bridge it is working meanwhile and the error does not appeared anymore.
But, I do not want to try again to create a new bridge for the moment. I'm happy that it works now.
This morning I added two more hubs in another flow and they worked fine. Do not know what caused the behaviour. So, you may close the case.
NRCHKB Plugin Version
1.4.3
Node JS Version
v14.20.1
NPM Version
6.14.17
Node-RED Version
V2.2.2
Operating System
Raspberry bullseye
What happened?
I set up a new bridge. The bridge is been displayed on my iphone when adding new accessaries. I do enter the code and then the message appears (see screenshot)
How to reproduce?
1) create new bridge in node-red 2) Deploy 3) On your iPhone: In HOME App add a new accessory, 4) Choose more options... 5) New bridge will displayed here 6) choose bridge 7) enter code 8) kaboom! (see screen shot)
Expected behavior:
Should be able to add a new bridge
Additional comments?
Additional comments here, if any.
Relevant log output
No response