HiH virtuelles Gerät Zweifach Ein.Aus

Ich versuche einen (Zweifach )Schalter der über Tasmota in IoBroker gesteuert wird über NodeRed in Homee einzubinden. Leider scheitere ich bei dem Versuch.

Ein einfacher Schalter (Ein/Aus) klappt problemlos. Doch sobald ich den Flow abändere und die zwei einzelnen Schalter als ein Gerät haben will funktioniert nicht einmal das schalten im debug.

Könnt Ihr mir hier helfen?

[
    {
        "id": "6051d29ed2ee6d48",
        "type": "switch",
        "z": "7c2a774f7d914ad1",
        "name": "Switch",
        "property": "payload.attributeId",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "221",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "220",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 410,
        "y": 1120,
        "wires": [
            [
                "a8c674be7581034c",
                "8c5ed1cc7fadaaad"
            ],
            [
                "36043d218eb23d61",
                "8c5ed1cc7fadaaad"
            ]
        ]
    },
    {
        "id": "36043d218eb23d61",
        "type": "change",
        "z": "7c2a774f7d914ad1",
        "name": "",
        "rules": [
            {
                "t": "change",
                "p": "payload.targetValue",
                "pt": "msg",
                "from": "0",
                "fromt": "num",
                "to": "false",
                "tot": "bool"
            },
            {
                "t": "change",
                "p": "payload.targetValue",
                "pt": "msg",
                "from": "1",
                "fromt": "num",
                "to": "true",
                "tot": "bool"
            },
            {
                "t": "move",
                "p": "payload.targetValue",
                "pt": "msg",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 710,
        "y": 1180,
        "wires": [
            [
                "c4425faada999e6c"
            ]
        ]
    },
    {
        "id": "c4425faada999e6c",
        "type": "ioBroker out",
        "z": "7c2a774f7d914ad1",
        "name": "[object Object]",
        "topic": "sonoff.0.DVES_14BF06.POWER2",
        "ack": "false",
        "autoCreate": "false",
        "stateName": "",
        "role": "",
        "payloadType": "",
        "readonly": "",
        "stateUnit": "",
        "stateMin": "",
        "stateMax": "",
        "x": 980,
        "y": 1180,
        "wires": []
    },
    {
        "id": "17810f0a21e32f7c",
        "type": "homeeDevice",
        "z": "7c2a774f7d914ad1",
        "virtual-homee": "",
        "name": "Kellertuer",
        "nodeId": "200",
        "showNodeId": true,
        "profile": "18",
        "icon": "nodeicon_patiodoubledoor",
        "attributes": [
            {
                "type": 1,
                "state": 1,
                "instance": 0,
                "minimum": 0,
                "maximum": 1,
                "current_value": 0,
                "target_value": 0,
                "last_value": 0,
                "data": "",
                "name": "",
                "unit": "",
                "step_value": 1,
                "editable": 1,
                "last_changed": 1693168683,
                "changed_by": 1,
                "changed_by_id": 0,
                "based_on": 1,
                "options": [],
                "id": "220",
                "node_id": "200"
            },
            {
                "type": 1,
                "state": 1,
                "instance": 0,
                "minimum": 0,
                "maximum": 1,
                "current_value": 0,
                "target_value": 0,
                "last_value": 0,
                "data": "",
                "name": "",
                "unit": "",
                "step_value": 1,
                "editable": 1,
                "last_changed": 1690528421,
                "changed_by": 1,
                "changed_by_id": 0,
                "based_on": 1,
                "options": [],
                "id": "221",
                "node_id": "200"
            }
        ],
        "statusTemplate": "",
        "x": 240,
        "y": 1120,
        "wires": [
            [
                "6051d29ed2ee6d48"
            ]
        ]
    },
    {
        "id": "a8c674be7581034c",
        "type": "change",
        "z": "7c2a774f7d914ad1",
        "name": "",
        "rules": [
            {
                "t": "change",
                "p": "payload.targetValue",
                "pt": "msg",
                "from": "0",
                "fromt": "num",
                "to": "false",
                "tot": "bool"
            },
            {
                "t": "change",
                "p": "payload.targetValue",
                "pt": "msg",
                "from": "1",
                "fromt": "num",
                "to": "true",
                "tot": "bool"
            },
            {
                "t": "move",
                "p": "payload.targetValue",
                "pt": "msg",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 710,
        "y": 1020,
        "wires": [
            [
                "dad77fc3e29cf4c5"
            ]
        ]
    },
    {
        "id": "dad77fc3e29cf4c5",
        "type": "ioBroker out",
        "z": "7c2a774f7d914ad1",
        "name": "[object Object]",
        "topic": "sonoff.0.DVES_14BF06.POWER1",
        "ack": "false",
        "autoCreate": "false",
        "stateName": "",
        "role": "",
        "payloadType": "",
        "readonly": "",
        "stateUnit": "",
        "stateMin": "",
        "stateMax": "",
        "x": 980,
        "y": 1020,
        "wires": []
    },
    {
        "id": "455b82f50a28830e",
        "type": "function",
        "z": "7c2a774f7d914ad1",
        "name": "Rückkanal auf",
        "func": "if (msg.payload === true)\n       return {payload:{\"attribute\":{\"id\":221,\"value\":1}}};\nif (msg.payload === false)\n        return {payload:{\"attribute\":{\"id\":221,\"value\":0}}};\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 300,
        "y": 1020,
        "wires": [
            [
                "17810f0a21e32f7c"
            ]
        ]
    },
    {
        "id": "ec09d5220536d7ba",
        "type": "ioBroker in",
        "z": "7c2a774f7d914ad1",
        "name": "[object Object]",
        "topic": "sonoff.0.DVES_14BF06.POWER1",
        "payloadType": "value",
        "onlyack": "",
        "func": "all",
        "gap": "",
        "fireOnStart": "false",
        "outFormat": "MQTT",
        "x": 100,
        "y": 1020,
        "wires": [
            [
                "455b82f50a28830e"
            ]
        ]
    },
    {
        "id": "0ebc5bde59c01c90",
        "type": "function",
        "z": "7c2a774f7d914ad1",
        "name": "Rückkanal zu",
        "func": "if (msg.payload === true)\n    return { payload: { \"attribute\": { \"id\": 220, \"value\": 1 } } };\nif (msg.payload === false)\n    return { payload: { \"attribute\": { \"id\": 220, \"value\": 0 } } };",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 320,
        "y": 1260,
        "wires": [
            [
                "17810f0a21e32f7c"
            ]
        ]
    },
    {
        "id": "84b1bb01949fd501",
        "type": "ioBroker in",
        "z": "7c2a774f7d914ad1",
        "name": "[object Object]",
        "topic": "sonoff.0.DVES_14BF06.POWER2",
        "payloadType": "value",
        "onlyack": "",
        "func": "all",
        "gap": "",
        "fireOnStart": "false",
        "outFormat": "MQTT",
        "x": 100,
        "y": 1260,
        "wires": [
            [
                "0ebc5bde59c01c90"
            ]
        ]
    },
    {
        "id": "8c5ed1cc7fadaaad",
        "type": "debug",
        "z": "7c2a774f7d914ad1",
        "name": "debug 8",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 600,
        "y": 1120,
        "wires": []
    }
]

Der erste Fehler ist mir mal beim überfliegen des Code aufgefallen.

Das erste Attribut besitzt die Instance 0 und das zweite ebenso. Die Instancen werden bei gleichen Typen hochgezählt.

Schau mal ob das schon dein Problem gehabt.

1 „Gefällt mir“

Hallo Micha,
vielen Dank das hat zumindest soweit geholfen das es nun 2 Schalter korrekt anzeigt und nicht mehr Taster.

Doch schaltet es nach wie vor nicht, es bleibt mir weiterhin ein Rätsel.

Einfach habe ich es so und das geht:

[
    {
        "id": "7aec3b0257dee08f",
        "type": "homeeDevice",
        "z": "7c2a774f7d914ad1",
        "virtual-homee": "",
        "name": "Kellertuer schließen",
        "nodeId": "553",
        "showNodeId": true,
        "profile": "16",
        "icon": "nodeicon_patiodoubledoor",
        "attributes": [
            {
                "type": 1,
                "state": 1,
                "instance": 0,
                "minimum": 0,
                "maximum": 1,
                "current_value": 0,
                "target_value": 0,
                "last_value": 0,
                "data": "",
                "name": "",
                "unit": "",
                "step_value": 1,
                "editable": 1,
                "last_changed": 1690528421,
                "changed_by": 1,
                "changed_by_id": 0,
                "based_on": 1,
                "options": [],
                "id": "552",
                "node_id": "553"
            }
        ],
        "statusTemplate": "",
        "x": 380,
        "y": 620,
        "wires": [
            [
                "027296bede18ca2f",
                "01aca14c408e945b"
            ]
        ]
    },
    {
        "id": "027296bede18ca2f",
        "type": "change",
        "z": "7c2a774f7d914ad1",
        "name": "",
        "rules": [
            {
                "t": "change",
                "p": "payload.targetValue",
                "pt": "msg",
                "from": "0",
                "fromt": "num",
                "to": "false",
                "tot": "bool"
            },
            {
                "t": "change",
                "p": "payload.targetValue",
                "pt": "msg",
                "from": "1",
                "fromt": "num",
                "to": "true",
                "tot": "bool"
            },
            {
                "t": "move",
                "p": "payload.targetValue",
                "pt": "msg",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 650,
        "y": 620,
        "wires": [
            [
                "66ab73733073cea7"
            ]
        ]
    },
    {
        "id": "66ab73733073cea7",
        "type": "ioBroker out",
        "z": "7c2a774f7d914ad1",
        "name": "[object Object]",
        "topic": "sonoff.0.DVES_14BF06.POWER2",
        "ack": "false",
        "autoCreate": "false",
        "stateName": "",
        "role": "",
        "payloadType": "",
        "readonly": "",
        "stateUnit": "",
        "stateMin": "",
        "stateMax": "",
        "x": 860,
        "y": 620,
        "wires": []
    },
    {
        "id": "9293e548182d47c5",
        "type": "function",
        "z": "7c2a774f7d914ad1",
        "name": "Rückkanal on off",
        "func": "if (msg.payload === true)\n       return {payload:{\"attribute\":{\"id\":552,\"value\":1}}};\nif (msg.payload === false)\n        return {payload:{\"attribute\":{\"id\":552,\"value\":0}}};",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 940,
        "y": 540,
        "wires": [
            [
                "7aec3b0257dee08f"
            ]
        ]
    },
    {
        "id": "c1c8ace87bdd1f58",
        "type": "ioBroker in",
        "z": "7c2a774f7d914ad1",
        "name": "[object Object]",
        "topic": "sonoff.0.DVES_14BF06.POWER2",
        "payloadType": "value",
        "onlyack": "",
        "func": "all",
        "gap": "",
        "fireOnStart": "false",
        "outFormat": "MQTT",
        "x": 730,
        "y": 540,
        "wires": [
            [
                "9293e548182d47c5"
            ]
        ]
    },
    {
        "id": "01aca14c408e945b",
        "type": "debug",
        "z": "7c2a774f7d914ad1",
        "name": "debug 7",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 520,
        "y": 740,
        "wires": []
    }
]
1 „Gefällt mir“

Ich kann es mir heute Abend mal auf nen Rechner ziehen nd anschauen was da noch klemmt.

3 „Gefällt mir“

Sehr gerne, was ich auch wieder versucht habe war ohne Erfolg. Hab einfach keine Erfahrung und es ist bestimmt eine Kleinigkeit.

Habe gerade deinen Flow importiert und die Änderungen an den Instanzen vorgenommen sowie an den ersten beiden Funktionen noch ein ‚else‘ eingefügt und es funktioniert problemlos.

[
    {
        "id": "6051d29ed2ee6d48",
        "type": "switch",
        "z": "88dc04c0c956cce9",
        "name": "Switch",
        "property": "payload.attributeId",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "221",
                "vt": "str"
            },
            {
                "t": "eq",
                "v": "220",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 410,
        "y": 260,
        "wires": [
            [
                "a8c674be7581034c",
                "8c5ed1cc7fadaaad"
            ],
            [
                "36043d218eb23d61",
                "8c5ed1cc7fadaaad"
            ]
        ]
    },
    {
        "id": "36043d218eb23d61",
        "type": "change",
        "z": "88dc04c0c956cce9",
        "name": "",
        "rules": [
            {
                "t": "change",
                "p": "payload.targetValue",
                "pt": "msg",
                "from": "0",
                "fromt": "num",
                "to": "false",
                "tot": "bool"
            },
            {
                "t": "change",
                "p": "payload.targetValue",
                "pt": "msg",
                "from": "1",
                "fromt": "num",
                "to": "true",
                "tot": "bool"
            },
            {
                "t": "move",
                "p": "payload.targetValue",
                "pt": "msg",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 710,
        "y": 320,
        "wires": [
            [
                "c4425faada999e6c"
            ]
        ]
    },
    {
        "id": "c4425faada999e6c",
        "type": "ioBroker out",
        "z": "88dc04c0c956cce9",
        "name": "[object Object]",
        "topic": "sonoff.0.DVES_14BF06.POWER2",
        "ack": "false",
        "autoCreate": "false",
        "stateName": "",
        "role": "",
        "payloadType": "",
        "readonly": "",
        "stateUnit": "",
        "stateMin": "",
        "stateMax": "",
        "x": 980,
        "y": 320,
        "wires": []
    },
    {
        "id": "17810f0a21e32f7c",
        "type": "homeeDevice",
        "z": "88dc04c0c956cce9",
        "virtual-homee": "",
        "name": "Kellertuer",
        "nodeId": "200",
        "showNodeId": true,
        "profile": "18",
        "icon": "nodeicon_patiodoubledoor",
        "attributes": [
            {
                "type": 1,
                "state": 1,
                "instance": 0,
                "minimum": 0,
                "maximum": 1,
                "current_value": 0,
                "target_value": 0,
                "last_value": 0,
                "data": "",
                "name": "",
                "unit": "",
                "step_value": 1,
                "editable": 1,
                "last_changed": 1693168683,
                "changed_by": 1,
                "changed_by_id": 0,
                "based_on": 1,
                "options": [],
                "id": "220",
                "node_id": "200"
            },
            {
                "type": 1,
                "state": 1,
                "instance": 1,
                "minimum": 0,
                "maximum": 1,
                "current_value": 0,
                "target_value": 0,
                "last_value": 0,
                "data": "",
                "name": "",
                "unit": "",
                "step_value": 1,
                "editable": 1,
                "last_changed": 1690528421,
                "changed_by": 1,
                "changed_by_id": 0,
                "based_on": 1,
                "options": [],
                "id": "221",
                "node_id": "200"
            }
        ],
        "statusTemplate": "",
        "x": 240,
        "y": 260,
        "wires": [
            [
                "6051d29ed2ee6d48"
            ]
        ]
    },
    {
        "id": "a8c674be7581034c",
        "type": "change",
        "z": "88dc04c0c956cce9",
        "name": "",
        "rules": [
            {
                "t": "change",
                "p": "payload.targetValue",
                "pt": "msg",
                "from": "0",
                "fromt": "num",
                "to": "false",
                "tot": "bool"
            },
            {
                "t": "change",
                "p": "payload.targetValue",
                "pt": "msg",
                "from": "1",
                "fromt": "num",
                "to": "true",
                "tot": "bool"
            },
            {
                "t": "move",
                "p": "payload.targetValue",
                "pt": "msg",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 710,
        "y": 160,
        "wires": [
            [
                "dad77fc3e29cf4c5"
            ]
        ]
    },
    {
        "id": "dad77fc3e29cf4c5",
        "type": "ioBroker out",
        "z": "88dc04c0c956cce9",
        "name": "[object Object]",
        "topic": "sonoff.0.DVES_14BF06.POWER1",
        "ack": "false",
        "autoCreate": "false",
        "stateName": "",
        "role": "",
        "payloadType": "",
        "readonly": "",
        "stateUnit": "",
        "stateMin": "",
        "stateMax": "",
        "x": 980,
        "y": 160,
        "wires": []
    },
    {
        "id": "455b82f50a28830e",
        "type": "function",
        "z": "88dc04c0c956cce9",
        "name": "Rückkanal auf",
        "func": "if (msg.payload === true)\n       return {payload:{\"attribute\":{\"id\":221,\"value\":1}}};\nelse if (msg.payload === false)\n        return {payload:{\"attribute\":{\"id\":221,\"value\":0}}};\nelse return",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 300,
        "y": 160,
        "wires": [
            [
                "17810f0a21e32f7c"
            ]
        ]
    },
    {
        "id": "ec09d5220536d7ba",
        "type": "ioBroker in",
        "z": "88dc04c0c956cce9",
        "name": "[object Object]",
        "topic": "sonoff.0.DVES_14BF06.POWER1",
        "payloadType": "value",
        "onlyack": "",
        "func": "all",
        "gap": "",
        "fireOnStart": "false",
        "outFormat": "MQTT",
        "x": 100,
        "y": 160,
        "wires": [
            [
                "455b82f50a28830e"
            ]
        ]
    },
    {
        "id": "0ebc5bde59c01c90",
        "type": "function",
        "z": "88dc04c0c956cce9",
        "name": "Rückkanal zu",
        "func": "if (msg.payload === true)\n    return { payload: { \"attribute\": { \"id\": 220, \"value\": 1 } } };\nelse if (msg.payload === false)\n    return { payload: { \"attribute\": { \"id\": 220, \"value\": 0 } } };\nelse return ",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 320,
        "y": 400,
        "wires": [
            [
                "17810f0a21e32f7c"
            ]
        ]
    },
    {
        "id": "84b1bb01949fd501",
        "type": "ioBroker in",
        "z": "88dc04c0c956cce9",
        "name": "[object Object]",
        "topic": "sonoff.0.DVES_14BF06.POWER2",
        "payloadType": "value",
        "onlyack": "",
        "func": "all",
        "gap": "",
        "fireOnStart": "false",
        "outFormat": "MQTT",
        "x": 100,
        "y": 400,
        "wires": [
            [
                "0ebc5bde59c01c90"
            ]
        ]
    },
    {
        "id": "8c5ed1cc7fadaaad",
        "type": "debug",
        "z": "88dc04c0c956cce9",
        "name": "debug 8",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 600,
        "y": 260,
        "wires": []
    },
    {
        "id": "eec4d6534f111e3f",
        "type": "inject",
        "z": "88dc04c0c956cce9",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "true",
        "payloadType": "bool",
        "x": 70,
        "y": 300,
        "wires": [
            [
                "455b82f50a28830e",
                "0ebc5bde59c01c90"
            ]
        ]
    },
    {
        "id": "98e06f41037cbc81",
        "type": "inject",
        "z": "88dc04c0c956cce9",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "false",
        "payloadType": "bool",
        "x": 70,
        "y": 340,
        "wires": [
            [
                "455b82f50a28830e",
                "0ebc5bde59c01c90"
            ]
        ]
    }
]
2 „Gefällt mir“

Danke! - Hmm aber leider nein, die Injects ändern es zwar im Flow und in der Homee Android App, aber schalten tut sich nichts.

Wenn ich dann in der App bei egal welchen Schalter auf Ein oder Aus drücke ändert sich im Flow nichts.
Am richtigen Schalter tut sich auch nichts logischerweise. Es ist wie verhext.

Häng mal bitte ein Debug an deinen Iobroker out und Poste mal das Ergebnis wenn du schaltest.


Debug bleibt leer, da nichts passiert.

In den Bilder sieht man das ein Inject den oberen Status ein Ein oder Aus ändert, aber unten am Schalter selbst passiert nichts und deshalb auch kein Log

Hast du zufällig Teamviewer bei dir drauf ? dann würde ich mich gerne mal kurz drauf schalten.

3 „Gefällt mir“

Also die Lösung ist Dank Micha gefunden. Vielen herzlichen Dank für deine Mühe.

Das Problem ist tatsächlich die Android App. Über die Webapp geht’s.

Sprich Zweifach Schalter ist bei vhih unter Android nicht nutzbar.

6 „Gefällt mir“

Wo sollte der Fehler auch sonst stecken? :rofl::see_no_evil: :man_shrugging: