NEWS
Dimmen über Alex mit node-red-contrib-amazon-echo
-
Gude zusammen,
ich habe folgendes Problemchen:
Ich habe unten stehenden Flow mit welchem ich die Esszimmerleuchte (über deconz eingebunden) auf einen Wert dimmen möchte. Dies funktioniert ein bis zweimal auch. Danach kommt das Phänomen das die Leuchte z.B. auf 40% gedimmt ist und ich sie auf 80% stellen möchte. Dies geht auch ganz kurz, dann stellt sich aber wieder der Wert von 40% ein.
Schalte ich jetzt die Leuchte aus und danach wieder ein, schaltet sie sich mit dem gewünschten Wert von 80% ein.Wenn ich aber die Wert der Leuchte direkt im Objekt einstelle und übernehme funktioniert das ohne Probleme.
Leider komme ich hier nicht weiter und hoffe das mir einer von helfen kann.
Grüße Christian
[ { "id": "f8844367.809fe", "type": "tab", "label": "Flow 1", "disabled": false, "info": "" }, { "id": "4008945c.f0ab6c", "type": "amazon-echo-hub", "z": "f8844367.809fe", "port": "79", "processinput": 0, "discovery": true, "x": 170, "y": 160, "wires": [ [ "d3a6de2f.15e36" ] ] }, { "id": "d3a6de2f.15e36", "type": "amazon-echo-device", "z": "f8844367.809fe", "name": "Esszimmerdecke", "topic": "", "x": 410, "y": 160, "wires": [ [ "c65e340.8b5b6d" ] ] }, { "id": "c65e340.8b5b6d", "type": "change", "z": "f8844367.809fe", "name": "payload bri", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "bri", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 610, "y": 160, "wires": [ [ "b10e3bff.6f8928" ] ] }, { "id": "b10e3bff.6f8928", "type": "ioBroker out", "z": "f8844367.809fe", "name": "Esszimmer bri", "topic": "deconz.0.Groups.5.bri", "ack": "false", "autoCreate": "false", "stateName": "", "role": "", "payloadType": "", "readonly": "", "stateUnit": "", "stateMin": "", "stateMax": "", "x": 840, "y": 160, "wires": [] } ]
-
@Fam3xCE Hi, Versuch es mal so.
[ { "id": "93f4052e.75f798", "type": "amazon-echo-hub", "z": "909d4924.93f818", "port": "79", "processinput": 0, "discovery": true, "x": 170, "y": 160, "wires": [ [ "6293d4c4.929edc" ] ] }, { "id": "6293d4c4.929edc", "type": "amazon-echo-device", "z": "909d4924.93f818", "name": "Esszimmerdecke", "topic": "", "x": 410, "y": 160, "wires": [ [ "8d680b9a.57a308", "262fdae2.4dfd66" ] ] }, { "id": "d0d31471.98e188", "type": "ioBroker out", "z": "909d4924.93f818", "name": "Esszimmer bri", "topic": "deconz.0.Groups.5.bri", "ack": "false", "autoCreate": "false", "stateName": "", "role": "", "payloadType": "", "readonly": "", "stateUnit": "", "stateMin": "", "stateMax": "", "x": 920, "y": 160, "wires": [] }, { "id": "8d680b9a.57a308", "type": "change", "z": "909d4924.93f818", "name": "Dimmen", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "percentage", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 670, "y": 160, "wires": [ [ "d0d31471.98e188" ] ] }, { "id": "262fdae2.4dfd66", "type": "switch", "z": "909d4924.93f818", "name": "Schalter", "property": "payload", "propertyType": "msg", "rules": [ { "t": "eq", "v": "off", "vt": "str" } ], "checkall": "true", "repair": false, "outputs": 1, "x": 600, "y": 220, "wires": [ [ "a3115811.0aa828" ] ] }, { "id": "a3115811.0aa828", "type": "function", "z": "909d4924.93f818", "name": "false", "func": "msg.payload = false;\nreturn msg; ", "outputs": 1, "noerr": 0, "x": 730, "y": 220, "wires": [ [ "d0d31471.98e188" ] ] } ]
-
@Homer-J
Hey, danke aber leider hat das so auch nicht funktioniert.Es ist wie verhext. Der richtige Wert wird rein geschrieben und ein zwei Selkunden später ist der Wert wieder eingestellt welcher vorher drinnen stand.
-
Jetzt bin ich ein Stück weiter...
Das Phänomen hat die Ursache, das auch bei einer Änderung des Dimm-Wertes immer ein true von "Alexa" mit gesendet wird und dieser ist für das Verhalten verantwortlich. Jetzt habe ich alle Werte rausgefiltert außer den Dimm-Wert, nun lässt sich die Leuchte wie gewollt dimmen.
Jetzt stellt sich mir nur ein anderes Problem. Wie kann ich wenn über "Alexa" der Befehl "ein" kommt, diesen ausführen lassen, aber nicht wenn der "Ein" Wert von einem Dimm-Wert übergeben wird?Diese Werte werden alle immer übergeben ob "ein" oder "dimmen" gesendet wird.
msg : Object object on: true bri: 52 percentage: 20 hue: 0 sat: 254 xy: array[2] ct: 199 rgb: array[3] colormode: "ct" meta: object payload: "on" deviceid: "549eb22c6e80dc" topic: "" _msgid: "2ccd88d4.865f18"
-
Ich hatte das Problem auch. Ich habe die Fibaro Dimmer 2.
Beim Fibaro Dimmer muss ich noch den Dimmer-Wert von 0 bis 254 auf 0 bis 100 umrechnen.
Der Dimmerwert wird dann mit 10 ms Versatz nach dem Anschalten hinterher geschrieben.
Nicht besonders schön, aber funktioniert. Hier der code:[ { "id": "e5e551d5.9d365", "type": "amazon-echo-device", "z": "55f55167.7114a", "name": "Gang oben", "topic": "", "x": 350, "y": 600, "wires": [ [ "8195d147.c62f1" ] ] }, { "id": "2b3c1ae2.80f3f6", "type": "function", "z": "55f55167.7114a", "name": "message-->bri", "func": "var newMsg = {payload: msg.bri} ;\nreturn newMsg;", "outputs": 1, "noerr": 0, "x": 380, "y": 660, "wires": [ [ "47afd88c.e08168" ] ] }, { "id": "47afd88c.e08168", "type": "calculator", "z": "55f55167.7114a", "name": "", "inputMsgField": "payload", "outputMsgField": "payload", "operation": "div", "constant": "254", "x": 510, "y": 660, "wires": [ [ "88b5e064.3f64e" ] ] }, { "id": "1af242ed.a87b6d", "type": "calculator", "z": "55f55167.7114a", "name": "", "inputMsgField": "payload", "outputMsgField": "payload", "operation": "trunc", "constant": "", "x": 750, "y": 660, "wires": [ [ "b8d47d55.305a4" ] ] }, { "id": "38c460cb.fae3a", "type": "change", "z": "55f55167.7114a", "name": "off", "rules": [ { "t": "change", "p": "payload", "pt": "msg", "from": "off", "fromt": "str", "to": "0", "tot": "num" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 730, "y": 580, "wires": [ [ "b5247c55.4ba74" ] ] }, { "id": "8195d147.c62f1", "type": "switch", "z": "55f55167.7114a", "name": "off?", "property": "on", "propertyType": "msg", "rules": [ { "t": "false" }, { "t": "true" } ], "checkall": "true", "repair": false, "outputs": 2, "x": 490, "y": 600, "wires": [ [ "38c460cb.fae3a" ], [ "2b3c1ae2.80f3f6", "9a150326.d0586" ] ] }, { "id": "88b5e064.3f64e", "type": "calculator", "z": "55f55167.7114a", "name": "", "inputMsgField": "payload", "outputMsgField": "payload", "operation": "mult", "constant": "99", "x": 620, "y": 660, "wires": [ [ "1af242ed.a87b6d" ] ] }, { "id": "9a150326.d0586", "type": "change", "z": "55f55167.7114a", "name": "on --> 255", "rules": [ { "t": "change", "p": "payload", "pt": "msg", "from": "on", "fromt": "str", "to": "255", "tot": "num" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 750, "y": 620, "wires": [ [ "b5247c55.4ba74" ] ] }, { "id": "b8d47d55.305a4", "type": "delay", "z": "55f55167.7114a", "name": "", "pauseType": "delay", "timeout": "10", "timeoutUnits": "milliseconds", "rate": "1", "nbRateUnits": "1", "rateUnits": "second", "randomFirst": "1", "randomLast": "5", "randomUnits": "seconds", "drop": false, "x": 950, "y": 660, "wires": [ [ "b5247c55.4ba74" ] ] }, { "id": "b5247c55.4ba74", "type": "ioBroker out", "z": "55f55167.7114a", "name": "Gang oben", "topic": "zwave2.0.Node_015.Multilevel_Switch.targetValue_001", "ack": "false", "autoCreate": "false", "x": 1130, "y": 620, "wires": [] } ]