...
You need to send a msg.payload of {"MSEVENT": 0, "UID": "FAKE1"}:
...
NodeRed flow:
Code Block | ||
---|---|---|
| ||
[{"id":"ad9350e1.02ae9","type":"tab","label":"Flow 22","disabled":false,"info":""},{"id":"e5af922f.d1ad4","type":"group","z":"ad9350e1.02ae9","name":"Injects simulating sensor events ","style":{"stroke":"#3f93cf","fill":"#bfdbef","label":true,"label-position":"n","color":"#0070c0"},"nodes":["5255a035.80381","4df3c9f4.c54c38","fc6ab9c7.9d54c8","ad84f038.8e2d","76240bf4.3375a4","a76c72a9.cffa2","bf0d6277.52521","47b4dc22.a62664"],"x":214,"y":219,"w":1112,"h":262},{"id":"5255a035.80381","type":"vertex action","z":"ad9350e1.02ae9","g":"e5af922f.d1ad4","name":"Motion sensor","typeButton":"motionsensor","bPayload":{"PRESENCE":{"action":"setbrightness","group":null,"param":"50","priority":"255"},"TRANSITION":{"action":"setbrightness","group":null,"param":"50","priority":"0"},"NOPRESENCE":{"action":"setbrightness","group":null,"param":"0","priority":"254"}},"bState":"","defaultpriority":true,"x":670,"y":340,"wires":[["47b4dc22.a62664"]]},{"id":"4df3c9f4.c54c38","type":"dali2devs","z":"ad9350e1.02ae9","g":"e5af922f.d1ad4","name":"Motion Sensor no1","uid":"00000003A4214709BC","dali2dev":"0","instanceType":3,"dali2t1":"10","dali2t2":"","mode":"","x":330,"y":260,"wires":[["5255a035.80381"]]},{"id":"fc6ab9c7.9d54c8","type":"dali2devs","z":"ad9350e1.02ae9","g":"e5af922f.d1ad4","name":"Motion Sensor no2","uid":"00000003A4214709BC","dali2dev":"0","instanceType":3,"dali2t1":"10","dali2t2":"","mode":"","x":330,"y":340,"wires":[["5255a035.80381"]]},{"id":"ad84f038.8e2d","type":"dali2devs","z":"ad9350e1.02ae9","g":"e5af922f.d1ad4","name":"Motion Sensor no3","uid":"00000003A4214709BC","dali2dev":"0","instanceType":3,"dali2t1":"10","dali2t2":"","mode":"","x":330,"y":420,"wires":[["5255a035.80381"]]},{"id":"76240bf4.3375a4","type":"vertex cluster","z":"ad9350e1.02ae9","g":"e5af922f.d1ad4","rate":5,"x":1230,"y":340,"wires":[]},{"id":"a76c72a9.cffa2","type":"inject","z":"ad9350e1.02ae9","g":"e5af922f.d1ad4","name":"Presence","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"MSEVENT\": 0, \"UID\": \"FAKE1\"}","payloadType":"json","x":640,"y":400,"wires":[["5255a035.80381"]]},{"id":"bf0d6277.52521","type":"inject","z":"ad9350e1.02ae9","g":"e5af922f.d1ad4","name":"No presence","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"MSEVENT\": 2, \"UID\": \"FAKE1\"}","payloadType":"json","x":650,"y":440,"wires":[["5255a035.80381"]]},{"id":"47b4dc22.a62664","type":"function","z":"ad9350e1.02ae9","g":"e5af922f.d1ad4","name":"Set presence state brightness value","func":"if(msg.topic.includes(\"MOTIONSENSOR/PRESENCE\"))\n{\n for(var gr in msg.payload.parameter.value)\n {\n\t msg.payload.parameter.value[gr] = flow.get(\"level\");\n }\n return msg;\n}\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":960,"y":340,"wires":[["76240bf4.3375a4"]]}] |
...