Da dies mein erster Beitrag ist, möchte ich mich kurz vorstellen. Mein Smarthome läuft seid ca. 1 Jahr mit Blockly Scripte und einigen Adaptern. Ich bin von Iobroker begeistert und versuche nun auf meine Scripte auf Node Red umzustellen.
Ich versuche gerade in Node Red eine einfache Lampe mit Alexa und einen Button auf dem Dashboard zu steuern. Die Verbindung zu Alexa funktioniert. Ich kann sowohl mit Alexa als auch mit dem Button am Dashboard die Lampe steuern. Wenn ich mit Alexa die Lampe an oder aussschalte, bekomme ich den Zustand in der Alexa App angezeigt. Wenn ich dies aber mit dem Dashboard Button mache, bekomme ich nicht den richtigen Zustand in der Alexa App angezeigt.
Ich habe mich durch einige Internetseiten durchgekämpft, aber ich bekomme es nicht zusammen.
Ich benutze die Pallette node-red-contrib-amazon-echo. Ich habe zwei Debug eingefügt. der eine überprüft den Ausgang von der Alexa, der andere den Eingang. Ich glaube das ich hier das gleiche in die Alexa schicke, wie ich auch herausbekomme.
Vielleicht habe ich aber auch den Retourkanal nicht verstanden. Darum hoffe ich auf eure Erfahrung.
Das wäre mein Flow.
Spoiler
[
{
"id": "70d295d8a000ae9c",
"type": "ioBroker in",
"z": "fd777960455711e3",
"name": "Wohzimmerlicht_Zustand_in",
"topic": "sonoff.0.Schlafzimmer_Fernseher.POWER",
"payloadType": "value",
"onlyack": "update",
"func": "all",
"gap": "",
"fireOnStart": "true",
"outFormat": "MQTT",
"x": 140,
"y": 40,
"wires": [
[
"c93884d0.feed28",
"f9dd571ea72a0fe7"
]
]
},
{
"id": "3cec2de9b5852079",
"type": "ioBroker out",
"z": "fd777960455711e3",
"name": "Wohnzimmerlicht Zustand_out",
"topic": "sonoff.0.Schlafzimmer_Fernseher.POWER",
"ack": "false",
"autoCreate": "false",
"stateName": "",
"role": "",
"payloadType": "",
"readonly": "",
"stateUnit": "",
"stateMin": "",
"stateMax": "",
"x": 1210,
"y": 180,
"wires": []
},
{
"id": "7a3d4ecd1154580b",
"type": "switch",
"z": "fd777960455711e3",
"name": "an/aus",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "on",
"vt": "str"
},
{
"t": "eq",
"v": "off",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 730,
"y": 200,
"wires": [
[
"01f3553c6f985687"
],
[
"8d36aa6bb404bc6f"
]
]
},
{
"id": "01f3553c6f985687",
"type": "change",
"z": "fd777960455711e3",
"name": "",
"rules": [
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "on",
"fromt": "str",
"to": "true",
"tot": "bool"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 920,
"y": 180,
"wires": [
[
"3cec2de9b5852079"
]
]
},
{
"id": "8d36aa6bb404bc6f",
"type": "change",
"z": "fd777960455711e3",
"name": "",
"rules": [
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "off",
"fromt": "str",
"to": "false",
"tot": "bool"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 920,
"y": 220,
"wires": [
[
"3cec2de9b5852079"
]
]
},
{
"id": "329c84a2.30b45c",
"type": "ui_switch",
"z": "fd777960455711e3",
"name": "",
"label": "Wohnzimmer",
"tooltip": "tip",
"group": "6eb3ac754da90e0e",
"order": 17,
"width": 4,
"height": 1,
"passthru": false,
"decouple": "false",
"topic": "topic",
"topicType": "msg",
"style": "",
"onvalue": "true",
"onvalueType": "bool",
"onicon": "",
"oncolor": "",
"offvalue": "false",
"offvalueType": "bool",
"officon": "",
"offcolor": "",
"animate": false,
"className": "",
"x": 990,
"y": 120,
"wires": [
[
"3cec2de9b5852079"
]
]
},
{
"id": "c93884d0.feed28",
"type": "function",
"z": "fd777960455711e3",
"name": "Nachricht mit aktuellen Status erstellen",
"func": "let status = msg.payload;\nmsg = {};\n\nif (status == true) {\n msg.ui_control = {\n onicon: "fa-2x fa-wifi",\n oncolor: "#ffd700",\n officon: "fa-2x fa-wifi",\n offcolor: "#ffd700"\n }\n msg.payload = true;\n \n} else {\n msg.ui_control = {\n onicon: "fa-2x fa-wifi",\n oncolor: "lightgreen",\n officon: "fa-2x fa-wifi",\n offcolor: "#898989"\n }\n msg.payload = false;\n}\n\nreturn msg;\n\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 730,
"y": 120,
"wires": [
[
"329c84a2.30b45c"
]
]
},
{
"id": "f9dd571ea72a0fe7",
"type": "change",
"z": "fd777960455711e3",
"name": "Von true auf An, false auf Aus",
"rules": [
{
"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": 510,
"y": 40,
"wires": [
[
"1fafb16966e53f51"
]
]
},
{
"id": "1fafb16966e53f51",
"type": "function",
"z": "fd777960455711e3",
"name": "Ein/Aus",
"func": "return { payload: msg.payload };",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 140,
"y": 200,
"wires": [
[
"aef10237aec90c0f",
"d40b51d719082e48"
]
]
},
{
"id": "aef10237aec90c0f",
"type": "amazon-echo-hub",
"z": "fd777960455711e3",
"port": "80",
"processinput": "1",
"discovery": true,
"x": 370,
"y": 200,
"wires": [
[
"1cd744f3ca3d71ff",
"51e756f94fc1c9a8"
]
]
},
{
"id": "1cd744f3ca3d71ff",
"type": "amazon-echo-device",
"z": "fd777960455711e3",
"name": "virtruell",
"topic": "",
"x": 560,
"y": 200,
"wires": [
[
"7a3d4ecd1154580b"
]
]
},
{
"id": "51e756f94fc1c9a8",
"type": "debug",
"z": "fd777960455711e3",
"name": "Zustand",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 620,
"y": 280,
"wires": []
},
{
"id": "d40b51d719082e48",
"type": "debug",
"z": "fd777960455711e3",
"name": "Retour",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 370,
"y": 280,
"wires": []
},
{
"id": "6eb3ac754da90e0e",
"type": "ui_group",
"name": "Erdgeschoß",
"tab": "9e95cae1a62f9f7c",
"order": 1,
"disp": true,
"width": "6",
"collapse": false,
"className": ""
},
{
"id": "9e95cae1a62f9f7c",
"type": "ui_tab",
"name": "Lichter",
"icon": "dashboard",
"order": 3,
"disabled": false,
"hidden": false
}
]