Hier mal ein Flow zum anlernen eines Nodon Unterputzmodul.
In dieser Version wird der Aktor über ein true und false gesteuert und
genauso wird auch das anzusteuernde Gerät geschaltet.
[{"id":"2a388c86.80bfb4","type":"function","z":"96b82b43.db49b8","name":"Aktor in homee anlernen ","func":"const Enocean = global.get('Enocean')\nvar LRN = \"55000d0701fdd4a00146000f01d2050f13a40101ffffffff58004b\";\nvar SwitchOn = \"550009070156d20460e4050f13a40101ffffffff50001f\";\nvar SwitchOff = \"550009070156d2046080050f13a40101ffffffff52006e\";\nvar channel = 17\n\nif(msg.payload === \"LRN\"){test = LRN}\nif(msg.payload === true){test = SwitchOn}\nif(msg.payload === false){test = SwitchOff}\n\nvar tel = Enocean.RadioERP1.from(test)\ntel.senderId = global.get(\"enocean-base-id\") + channel\n\nreturn {payload: tel.toString()}","outputs":1,"noerr":0,"x":953,"y":564,"wires":[["c734d2f1.ae0db"]]},{"id":"a8d08ada.92bde8","type":"enocean-in","z":"96b82b43.db49b8","serialport":"e208039e.4d30f","name":"","x":712,"y":654,"wires":[["befade68.c357d"]]},{"id":"b25be9cd.2f3148","type":"inject","z":"96b82b43.db49b8","name":"LRN","topic":"","payload":"{\"type\":\"LRN\",\"eep\":\"d2-01-0f\",\"senderId\":\"0184dbfc\",\"name\":\"Zentrale\"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":716,"y":701,"wires":[["befade68.c357d"]]},{"id":"befade68.c357d","type":"enocean-actor","z":"96b82b43.db49b8","name":"","channel":"17","adt":true,"x":881,"y":654,"wires":[["6add4974.103aa8"],[]]},{"id":"ce8d5fc5.e22f9","type":"inject","z":"96b82b43.db49b8","name":"","topic":"","payload":"LRN","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":727,"y":530,"wires":[["2a388c86.80bfb4"]]},{"id":"a8658352.fb849","type":"inject","z":"96b82b43.db49b8","name":"","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":728,"y":570,"wires":[["2a388c86.80bfb4"]]},{"id":"2160a422.87afec","type":"inject","z":"96b82b43.db49b8","name":"","topic":"","payload":"false","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":729,"y":605,"wires":[["2a388c86.80bfb4"]]},{"id":"c734d2f1.ae0db","type":"enocean-out","z":"96b82b43.db49b8","serialport":"e208039e.4d30f","name":"","logOutput":false,"x":1155,"y":564,"wires":[[]]},{"id":"6add4974.103aa8","type":"change","z":"96b82b43.db49b8","name":"","rules":[{"t":"change","p":"payload.OV.rawValue","pt":"msg","from":"0","fromt":"num","to":"false","tot":"bool"},{"t":"change","p":"payload.OV.rawValue","pt":"msg","from":"1","fromt":"num","to":"true","tot":"bool"},{"t":"move","p":"payload.OV.rawValue","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1072,"y":648,"wires":[["2a388c86.80bfb4"]]},{"id":"e208039e.4d30f","type":"enocean-config-node","z":"","serialport":"/dev/ttyUSB0"}]
Es muss lediglich der Channel angepasst werden und nach dem LRN Telegramm muss aus dem Debug die SenderID des homee ermittelt werden.
Diese ID kommt dann bei dem Aktor Node in das LRN Inject.
VG Micha