@teemo
Sorry - hier nochmal
Spoiler
[{"id":"36b01892f29ff531","type":"trigger","z":"289f539dcc33814e","name":"","op1":"true","op2":"0","op1type":"bool","op2type":"str","duration":"-1","extend":false,"overrideDelay":false,"units":"s","reset":"0","bytopic":"all","topic":"topic","outputs":1,"x":580,"y":6980,"wires":[["7476062a19dd760e"]]},{"id":"7476062a19dd760e","type":"function","z":"289f539dcc33814e","name":"Timer","func":"var timer = context.get(\"timer\");\nif (msg.payload) {\n if (timer === undefined){\n // Initialisiere Timer\n timer = 5;\n msg.payload = timer;\n } else {\n msg.payload = --timer;\n }\n if (timer === 0) timer= undefined;\n context.set(\"timer\",timer);\n\n return msg;\n}","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":770,"y":6980,"wires":[["2c714fafbb7e37b5","076989755937eb8c"]]},{"id":"ba29eae86772b68f","type":"inject","z":"289f539dcc33814e","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":390,"y":6980,"wires":[["36b01892f29ff531"]]},{"id":"2c714fafbb7e37b5","type":"debug","z":"289f539dcc33814e","name":"Timer","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":950,"y":6980,"wires":[]},{"id":"076989755937eb8c","type":"switch","z":"289f539dcc33814e","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":650,"y":7040,"wires":[["36b01892f29ff531"]]}]
Achso und wie lange das runterzählt stellst Du hier ein:
84bd365c-dcde-4993-bf00-7d52d49004ec-image.png